linux-stable/drivers/usb/musb
Sebastian Andrzej Siewior baadd52f0a usb: musb: try a race-free wakeup
Attaching a keyboard, using it as a wakeup via
|for f in $(find /sys/devices/ocp.3/47400000.usb -name wakeup)
|do
|	echo enabled > $f
|done

going into standby
|  echo standby >  /sys/power/state

and now a wake up by a pressing a key.
What happens is that the system wakes up but the USB device is dead. The
USB stack tries to send a few control URBs but nothing comes back.
Eventually it gaves up and the device remains dead:
|[  632.559678] PM: Wakeup source USB1_PHY
|[  632.581074] PM: noirq resume of devices complete after 21.261 msecs
|[  632.607521] PM: early resume of devices complete after 10.360 msecs
|[  632.616854] net eth2: initializing cpsw version 1.12 (0)
|[  632.704126] net eth2: phy found : id is : 0x4dd074
|[  636.704048] libphy: 4a101000.mdio:00 - Link is Up - 1000/Full
|[  638.444620] usb 1-1: reset low-speed USB device number 2 using musb-hdrc
|[  653.713435] usb 1-1: device descriptor read/64, error -110
|[  669.093435] usb 1-1: device descriptor read/64, error -110
|[  669.473424] usb 1-1: reset low-speed USB device number 2 using musb-hdrc
|[  684.743436] usb 1-1: device descriptor read/64, error -110
|[  690.065097] PM: resume of devices complete after 57450.744 msecs
|[  690.076601] PM: Finishing wakeup.
|[  690.076627] Restarting tasks ...

It seems that since we got woken up via MUSB_INTR_RESUME the
musb_host_finish_resume() callback is executed before the
resume-callbacks of the PHY and glue layer are invoked. If I delay it
until the glue layer resumed then I don't see this problem.

I also move musb_host_resume_root_hub() into that callback since I don't
see any reason in doing anything resume-link if there are still pieces
not restored.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2014-11-05 13:26:41 -06:00
..
am35x.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
blackfin.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
blackfin.h
cppi_dma.c usb: musb: dma: merge ->start/stop into create/destroy 2013-07-29 13:53:18 +03:00
cppi_dma.h
da8xx.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
davinci.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
davinci.h
jz4740.c usb: musb: register nop transceiver driver for jz4740 2014-07-10 08:36:50 -05:00
Kconfig usb: musb: omap2plus bus glue needs USB host support 2014-05-14 09:23:32 -05:00
Makefile usb: musb: add support for JZ4740 usb device controller 2013-12-20 09:53:24 -06: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: try a race-free wakeup 2014-11-05 13:26:41 -06:00
musb_core.h usb: musb: try a race-free wakeup 2014-11-05 13:26:41 -06:00
musb_cppi41.c usb: musb: cppi41: restart hrtimer only if not yet done 2014-10-23 09:55:41 -05:00
musb_debug.h
musb_debugfs.c
musb_dma.h usb: musb: introduce dma_channel.rx_packet_done 2014-06-30 14:26:24 -05:00
musb_dsps.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
musb_gadget.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06: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: gadget: read ep0 fifo only if rxcount is non zero 2013-04-02 11:42:50 +03:00
musb_host.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
musb_host.h usb: musb: fix prototype for musb_port_reset 2013-12-20 15:05:43 -06:00
musb_io.h
musb_regs.h usb: Fixed a few typos 2014-09-23 22:15:18 -07:00
musb_virthub.c usb: musb: try a race-free wakeup 2014-11-05 13:26:41 -06:00
musbhsdma.c usb: musb: dma: merge ->start/stop into create/destroy 2013-07-29 13:53:18 +03:00
musbhsdma.h
omap2430.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
omap2430.h
tusb6010.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
tusb6010.h usb: musb: tusb6010: Use musb->tusb_revision instead of tusb_get_revision call. 2014-05-16 12:16:31 -05:00
tusb6010_omap.c usb: musb: tusb6010: Use musb->tusb_revision instead of tusb_get_revision call. 2014-05-16 12:16:31 -05:00
ux500.c usb: move the OTG state from the USB PHY to the OTG structure 2014-11-03 10:01:25 -06:00
ux500_dma.c usb: musb: ux500_dma: use dmaengine_xxx() APIs 2014-11-03 10:01:07 -06:00