aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/platform_data/ti-sysc.h
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2021-05-18 09:47:23 +0300
committerTony Lindgren <tony@atomide.com>2021-05-18 10:11:06 +0300
commit4d7b324e231366ea772ab10df46be31273ca39af (patch)
tree7c897f6e52f3b46959d6d6e065b8e60948bed6d2 /include/linux/platform_data/ti-sysc.h
parentMerge branch 'fixes-rc1' into fixes (diff)
downloadwireguard-linux-4d7b324e231366ea772ab10df46be31273ca39af.tar.xz
wireguard-linux-4d7b324e231366ea772ab10df46be31273ca39af.zip
bus: ti-sysc: Fix am335x resume hang for usb otg module
On am335x, suspend and resume only works once, and the system hangs if suspend is attempted again. However, turns out suspend and resume works fine multiple times if the USB OTG driver for musb controller is loaded. The issue is caused my the interconnect target module losing context during suspend, and it needs a restore on resume to be reconfigure again as debugged earlier by Dave Gerlach <d-gerlach@ti.com>. There are also other modules that need a restore on resume, like gpmc as noted by Dave. So let's add a common way to restore an interconnect target module based on a quirk flag. For now, let's enable the quirk for am335x otg only to fix the suspend and resume issue. As gpmc is not causing hangs based on tests with BeagleBone, let's patch gpmc separately. For gpmc, we also need a hardware reset done before restore according to Dave. To reinit the modules, we decouple system suspend from PM runtime. We replace calls to pm_runtime_force_suspend() and pm_runtime_force_resume() with direct calls to internal functions and rely on the driver internal state. There no point trying to handle complex system suspend and resume quirks via PM runtime. This is issue should have already been noticed with commit 1819ef2e2d12 ("bus: ti-sysc: Use swsup quirks also for am335x musb") when quirk handling was added for am335x otg for swsup. But the issue went unnoticed as having musb driver loaded hides the issue, and suspend and resume works once without the driver loaded. Fixes: 1819ef2e2d12 ("bus: ti-sysc: Use swsup quirks also for am335x musb") Suggested-by: Dave Gerlach <d-gerlach@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'include/linux/platform_data/ti-sysc.h')
-rw-r--r--include/linux/platform_data/ti-sysc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/platform_data/ti-sysc.h b/include/linux/platform_data/ti-sysc.h
index fafc1beea504..9837fb011f2f 100644
--- a/include/linux/platform_data/ti-sysc.h
+++ b/include/linux/platform_data/ti-sysc.h
@@ -50,6 +50,7 @@ struct sysc_regbits {
s8 emufree_shift;
};
+#define SYSC_QUIRK_REINIT_ON_RESUME BIT(27)
#define SYSC_QUIRK_GPMC_DEBUG BIT(26)
#define SYSC_MODULE_QUIRK_ENA_RESETDONE BIT(25)
#define SYSC_MODULE_QUIRK_PRUSS BIT(24)