Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: musb: da8xx: Implement BABBLE recovery

There is no specific behaviour implemented to recover from a babble
error. When a BABBLE error happens, recovery fails as connected sticks
are no longer detected by the USB controller.

Implement the recover callback of the MUSB operation to reset the USB
controller when a BABBLE happens.

Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Link: https://lore.kernel.org/r/20240528102026.40136-5-bastien.curutchet@bootlin.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Bastien Curutchet and committed by
Greg Kroah-Hartman
4cb9f2c5 608662dd

+8
+8
drivers/usb/musb/da8xx.c
··· 220 220 mod_timer(&musb->dev_timer, timeout); 221 221 } 222 222 223 + static int da8xx_babble_recover(struct musb *musb) 224 + { 225 + dev_dbg(musb->controller, "resetting controller to recover from babble\n"); 226 + musb_writel(musb->ctrl_base, DA8XX_USB_CTRL_REG, DA8XX_SOFT_RESET_MASK); 227 + return 0; 228 + } 229 + 223 230 static irqreturn_t da8xx_musb_interrupt(int irq, void *hci) 224 231 { 225 232 struct musb *musb = hci; ··· 487 480 #ifndef CONFIG_USB_MUSB_HOST 488 481 .try_idle = da8xx_musb_try_idle, 489 482 #endif 483 + .recover = da8xx_babble_recover, 490 484 491 485 .set_vbus = da8xx_musb_set_vbus, 492 486 };