From 0c543f9bb2dfa4239a601bff70e66020c2daec59 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Tue, 26 Jul 2016 13:41:04 -0700 Subject: greybus: interface: Add quirk for no PM for S2 Loader S2 Loader doesn't support runtime PM operations currently and we will fail to suspend/resume the bundle for firmware management protocols. Once that happens, the bundle and its connections will be pretty much useless as we would have tried to disable/enable all connections during such an operation and the S2 loader doesn't expect the connections to go away during normal operation (except in the case of mode-switch). This patch defines a new quirk GB_INTERFACE_QUIRK_NO_PM and uses a new interface init status value (GB_INIT_S2_LOADER_INITIALIZED) which will be advertised by S2 Loader now in the init status. After detecting the currently running stage as S2 Loader, the kernel wouldn't attempt suspending or resuming the bundle. Reviewed-by: David Lin Reviewed-by: Johan Hovold Signed-off-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/interface.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/staging/greybus/interface.c') diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c index c20077a..faa6239 100644 --- a/drivers/staging/greybus/interface.c +++ b/drivers/staging/greybus/interface.c @@ -363,6 +363,7 @@ static int gb_interface_read_and_clear_init_status(struct gb_interface *intf) { struct gb_host_device *hd = intf->hd; unsigned long bootrom_quirks; + unsigned long s2l_quirks; int ret; u32 value; u16 attr; @@ -413,13 +414,22 @@ static int gb_interface_read_and_clear_init_status(struct gb_interface *intf) GB_INTERFACE_QUIRK_FORCED_DISABLE | GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH | GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE; + + s2l_quirks = GB_INTERFACE_QUIRK_NO_PM; + switch (init_status) { case GB_INIT_BOOTROM_UNIPRO_BOOT_STARTED: case GB_INIT_BOOTROM_FALLBACK_UNIPRO_BOOT_STARTED: intf->quirks |= bootrom_quirks; break; + case GB_INIT_S2_LOADER_BOOT_STARTED: + /* S2 Loader doesn't support runtime PM */ + intf->quirks &= ~bootrom_quirks; + intf->quirks |= s2l_quirks; + break; default: intf->quirks &= ~bootrom_quirks; + intf->quirks &= ~s2l_quirks; } /* Clear the init status. */ -- cgit v1.1