From: Sebastian Andrzej Siewior Date: Mon, 27 Oct 2014 18:06:18 +0000 (+0100) Subject: usb: musb: core: check link status on resume X-Git-Tag: omap-for-v3.19/fixes-rc1~87^2~32^2~96 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b87fd2f7aa490a7f4bab44c41937aca0bc62fdc5;p=pandora-kernel.git usb: musb: core: check link status on resume The am335x-evmsk support two kinds of suspend: - standby the USB device remains powered while the system goes into suspend - mem the USB device becomes powerless while the system goes into suspend. In the "standby" case the device resumes quickly. In the "mem" case the system hangs for a few seconds. It seems to me that the USB-device has no address (it was disconnected) and the USB stack thinks that it is fully operational and GetPortStatus returns the status from before the suspend so it is not a big help here. This adds a check in the resume path to see if the device mode (A or B) and the speed is the same. If the device went missing between suspend/resume (VBUS went down) then MUSB seems to go into B mode and HS/FS bits are cleared. In that case we clear the port1_status bits and assume a disconnect. Once the stack learns this it does a "logical disconnect" and removes the USB-device quickly. Should the device remain connected during the suspend then MUSB will receives a "CONNECT" interrupt. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Felipe Balbi --- Reading git-diff-tree failed