diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2009-07-01 12:36:16 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-13 00:16:37 +0200 |
commit | 89368d3d11a5b2eff83ad8e752be67f77a372bad (patch) | |
tree | 4bf287c9446ba4dfff7881249d4f7314ed01eb96 /drivers/usb/musb/musb_host.c | |
parent | USB: gadget: pxa25x compiler warning fix (diff) | |
download | linux-89368d3d11a5b2eff83ad8e752be67f77a372bad.tar.xz linux-89368d3d11a5b2eff83ad8e752be67f77a372bad.zip |
USB: musb: silence "suspend as a_wait_vrise is_active" msgs
Get rid of some obnoxious and inappropriate messaging, mostly on
DaVinci, when usbcore tries to autosuspend a root hub if just a
mini/micro-A connector is connected. Symptom: endless stream of
messages reading like:
musb_bus_suspend 2221: trying to suspend as a_wait_vrise is_active=1
Improve that musb bus suspend primitive a bit. Take advantage of
this call to update the OTG state machine if appropriate, moving
the device out of the A_WAIT_VRISE state. There's basically no
timer for that state transition just now, except with tusb6010;
that can make trouble.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb/musb_host.c')
-rw-r--r-- | drivers/usb/musb/musb_host.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 94a2a350a414..d6ed560e8826 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -2235,13 +2235,30 @@ static void musb_h_stop(struct usb_hcd *hcd) static int musb_bus_suspend(struct usb_hcd *hcd) { struct musb *musb = hcd_to_musb(hcd); + u8 devctl; - if (musb->xceiv->state == OTG_STATE_A_SUSPEND) + if (!is_host_active(musb)) return 0; - if (is_host_active(musb) && musb->is_active) { - WARNING("trying to suspend as %s is_active=%i\n", - otg_state_string(musb), musb->is_active); + switch (musb->xceiv->state) { + case OTG_STATE_A_SUSPEND: + return 0; + case OTG_STATE_A_WAIT_VRISE: + /* ID could be grounded even if there's no device + * on the other end of the cable. NOTE that the + * A_WAIT_VRISE timers are messy with MUSB... + */ + devctl = musb_readb(musb->mregs, MUSB_DEVCTL); + if ((devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) + musb->xceiv->state = OTG_STATE_A_WAIT_BCON; + break; + default: + break; + } + + if (musb->is_active) { + WARNING("trying to suspend as %s while active\n", + otg_state_string(musb)); return -EBUSY; } else return 0; |