usb: musb: core: move babble recovery inside babble check
authorFelipe Balbi <balbi@ti.com>
Wed, 25 Feb 2015 20:07:52 +0000 (14:07 -0600)
committerFelipe Balbi <balbi@ti.com>
Tue, 10 Mar 2015 20:33:25 +0000 (15:33 -0500)
There was already a proper place where we were
checking for babble interrupts, move babble
recovery there.

Tested-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/musb_core.c

index cf7b10e5963ee09bbc16a73194d7ea9777908551..9ea02d4cc2c221e464f3ac7c0ee7340903fd2571 100644 (file)
@@ -899,6 +899,12 @@ b_host:
                        if (power & MUSB_POWER_HSMODE) {
                                ERR("Stopping host session -- babble\n");
                                musb_writeb(musb->mregs, MUSB_DEVCTL, 0);
+
+                               if (is_host_active(musb)) {
+                                       musb_generic_disable(musb);
+                                       schedule_delayed_work(&musb->recover_work,
+                                                       msecs_to_jiffies(100));
+                               }
                        }
                } else {
                        dev_dbg(musb->controller, "BUS RESET as %s\n",
@@ -938,13 +944,6 @@ b_host:
                }
        }
 
-       /* handle babble condition */
-       if (int_usb & MUSB_INTR_BABBLE && is_host_active(musb)) {
-               musb_generic_disable(musb);
-               schedule_delayed_work(&musb->recover_work,
-                                     msecs_to_jiffies(100));
-       }
-
 #if 0
 /* REVISIT ... this would be for multiplexing periodic endpoints, or
  * supporting transfer phasing to prevent exceeding ISO bandwidth