1
0
Fork 0
alistair23-linux/drivers/usb/musb
Johan Hovold 082df8be45 USB: musb: fix external abort on suspend
Make sure that the controller is runtime resumed when system suspending
to avoid an external abort when accessing the interrupt registers:

  Unhandled fault: external abort on non-linefetch (0x1008) at 0xd025840a
  ...
  [<c05481a4>] (musb_default_readb) from [<c0545abc>] (musb_disable_interrupts+0x84/0xa8)
  [<c0545abc>] (musb_disable_interrupts) from [<c0546b08>] (musb_suspend+0x38/0xb8)
  [<c0546b08>] (musb_suspend) from [<c04a57f8>] (platform_pm_suspend+0x3c/0x64)

This is easily reproduced on a BBB by enabling the peripheral port only
(as the host port may enable the shared clock) and keeping it
disconnected so that the controller is runtime suspended. (Well, you
would also need to the not-yet-merged am33xx-suspend patches by Dave
Gerlach to be able to suspend the BBB.)

This is a regression that was introduced by commit 1c4d0b4e18 ("usb:
musb: Remove pm_runtime_set_irq_safe") which allowed the parent glue
device to runtime suspend and thereby exposed a couple of older issues:

Register accesses without explicitly making sure the controller is
runtime resumed during suspend was first introduced by commit c338412b5d
("usb: musb: unconditionally save and restore the context on suspend")
in 3.14.

Commit a1fc1920aa ("usb: musb: core: make sure musb is in RPM_ACTIVE on
resume") later started setting the RPM status to active during resume,
and this was also implicitly relying on the parent always being active.
Since commit 71723f9546 ("PM / runtime: print error when activating a
child to unactive parent") this now also results in the following
warning:

  musb-hdrc musb-hdrc.0: runtime PM trying to activate child device
    musb-hdrc.0 but parent (47401400.usb) is not active

This patch has been verified on 4.13-rc2, 4.12 and 4.9 using a BBB
(the dsps glue would always be active also in 4.8).

Fixes: c338412b5d ("usb: musb: unconditionally save and restore the context on suspend")
Fixes: a1fc1920aa ("usb: musb: core: make sure musb is in RPM_ACTIVE on resume")
Fixes: 1c4d0b4e18 ("usb: musb: Remove pm_runtime_set_irq_safe")
Cc: stable <stable@vger.kernel.org>	# 4.8+
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Daniel Mack <zonque@gmail.com>
Cc: Dave Gerlach <d-gerlach@ti.com>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-28 10:51:55 +02:00
..
Kconfig usb: musb: Add support of CPPI 4.1 DMA controller to DA8xx 2017-04-18 16:48:26 +02:00
Makefile usb: musb: add tracepoints support for debugging 2016-07-17 08:23:57 +09:00
am35x.c usb: musb: am35x: remove redundant code 2017-02-03 10:05:10 +01:00
blackfin.c usb: musb: blackfin: fix unused warnings on suspend/resume 2017-02-03 10:05:11 +01:00
blackfin.h
cppi_dma.c usb: musb: cppi_dma.c: use DIV_ROUND_UP macro in cppi_next_(r|t)x_segment() 2017-04-18 16:48:26 +02:00
cppi_dma.h usb: musb: cppi_dma: Clean up cppi structure 2017-02-09 13:35:05 +01:00
da8xx.c usb: musb: don't mark of_dev_auxdata as initdata 2017-04-26 11:30:02 +02:00
davinci.c usb: musb: davinci: remove redundant code 2017-02-03 10:05:10 +01:00
davinci.h usb: musb: davinci: Fix build breakage 2012-06-04 18:29:42 +03:00
jz4740.c usb: musb: constify musb_hdrc_config structures 2017-01-25 10:52:43 +01:00
musb_am335x.c usb: musb: Fix panic upon musb_am335x module removal 2014-06-27 10:53:06 -05:00
musb_core.c USB: musb: fix external abort on suspend 2017-08-28 10:51:55 +02:00
musb_core.h usb: musb: add helper function musb_ep_xfertype_string 2017-08-28 10:51:55 +02:00
musb_cppi41.c usb: musb: musb_cppi41: Defer probe only if DMA is not ready 2017-06-20 11:45:01 +08:00
musb_debug.h usb: musb: add tracepoints support for debugging 2016-07-17 08:23:57 +09:00
musb_debugfs.c usb: musb: debugfs: allow forcing host mode together with speed in testmode 2017-02-03 10:05:11 +01:00
musb_dma.h usb: musb: dma: Add a DMA completion platform callback 2017-02-09 13:35:05 +01:00
musb_dsps.c usb: musb: dsps: keep VBUS on for host-only mode 2017-05-27 11:54:46 +02:00
musb_gadget.c usb: musb: add helper function musb_ep_xfertype_string 2017-08-28 10:51:55 +02:00
musb_gadget.h usb: musb: add Kconfig options for HOST, GAGDET or DUAL_ROLE modes 2013-05-28 19:22:23 +03:00
musb_gadget_ep0.c usb: musb: switch dev_dbg to tracepoints 2016-07-17 08:23:57 +09:00
musb_host.c usb: musb: print an error message when high bandwidth is unsupported 2017-08-28 10:51:55 +02:00
musb_host.h usb: musb: fix prototype for musb_port_reset 2013-12-20 15:05:43 -06:00
musb_io.h usb: musb: Make busctl_offset an io-op rather then a define 2015-05-26 10:46:54 -05:00
musb_regs.h usb: musb: Make busctl_offset an io-op rather then a define 2015-05-26 10:46:54 -05:00
musb_trace.c usb: musb: add tracepoints support for debugging 2016-07-17 08:23:57 +09:00
musb_trace.h usb: musb: cppi41: add dma channel tracepoints 2016-07-17 08:23:57 +09:00
musb_virthub.c USB: musb: remove obsolete resume-signalling comments 2016-11-21 17:35:36 +01:00
musbhsdma.c usb: musb: switch dev_dbg to tracepoints 2016-07-17 08:23:57 +09:00
musbhsdma.h usb: musb: Fix trying to free already-free IRQ 4 2017-01-05 19:18:05 +01:00
omap2430.c usb: musb: omap2430: constify dev_pm_ops structures 2017-02-03 10:05:11 +01:00
omap2430.h usb: start using the control module driver 2013-01-25 12:27:24 +02:00
sunxi.c usb: musb: sunxi: add support for the variant in H3/V3s SoC 2017-02-03 10:05:11 +01:00
tusb6010.c usb: musb: tusb6010: Handle DMA TX completion in DMA callback as well 2017-06-20 11:45:01 +08:00
tusb6010.h usb: musb: Fix up DMA related macros 2015-05-07 13:35:46 -05:00
tusb6010_omap.c usb: musb: tusb6010_omap: Convert to DMAengine API 2017-06-20 11:45:01 +08:00
ux500.c usb: musb: constify musb_hdrc_config structures 2017-01-25 10:52:43 +01:00
ux500_dma.c usb: musb/ux500: remove duplicate check for dma_is_compatible 2016-03-04 15:14:30 +02:00