]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
musb_hdrc: Make HNP more reliable
authorTony Lindgren <tony@atomide.com>
Fri, 28 Sep 2007 22:07:05 +0000 (15:07 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 11 Oct 2007 21:31:34 +0000 (14:31 -0700)
Sometimes we get both SUSPEND and DISCONNECT the same time.
In that case DISCONNECT must be ignored or else the HNP connection
will break right away.

Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/usb/musb/musb_core.c

index efaa4fb277a24970af045bc78dbb95b33757512d..3d35a4edea4b8cd92fa6d91d9bcec063ba57d648 100644 (file)
@@ -321,6 +321,7 @@ void musb_otg_timer_func(unsigned long data)
                musb_hnp_stop(musb);
                break;
        }
+       musb->ignore_disconnect = 0;
        spin_unlock_irqrestore(&musb->lock, flags);
 }
 
@@ -656,8 +657,13 @@ static irqreturn_t musb_stage0_irq(struct musb * musb, u8 int_usb,
                        DBG(1, "BUS RESET as %s\n", otg_state_string(musb));
                        switch (musb->xceiv.state) {
 #ifdef CONFIG_USB_OTG
+                       case OTG_STATE_A_SUSPEND:
+                               musb->ignore_disconnect = 1;
+                               musb_g_reset(musb);
+                               /* FALLTHROUGH */
                        case OTG_STATE_A_WAIT_BCON:     /* OPT TD.4.7-900ms */
-                               DBG(1, "HNP: Setting timer as a_wait_bcon\n");
+                               DBG(1, "HNP: Setting timer as %s\n",
+                                               otg_state_string(musb));
                                musb_otg_timer.data = (unsigned long)musb;
                                mod_timer(&musb_otg_timer, jiffies
                                        + msecs_to_jiffies(100));