From 032fe8a0d02beda8742f884a0faee4144406ff0b Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 18 Dec 2017 16:18:08 +0100 Subject: [PATCH] 4.9-stable patches added patches: usb-musb-da8xx-fix-babble-condition-handling.patch --- queue-4.9/series | 1 + ...-da8xx-fix-babble-condition-handling.patch | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 queue-4.9/usb-musb-da8xx-fix-babble-condition-handling.patch diff --git a/queue-4.9/series b/queue-4.9/series index 0a1e289aa48..ddb7a33cf90 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -158,6 +158,7 @@ scsi-hpsa-destroy-sas-transport-properties-before-scsi_host.patch powerpc-perf-hv-24x7-fix-incorrect-comparison-in-memord.patch soc-mediatek-pwrap-fix-compiler-errors.patch tty-fix-oops-when-rmmod-8250.patch +usb-musb-da8xx-fix-babble-condition-handling.patch pinctrl-adi2-fix-kconfig-build-problem.patch raid5-set-r5_expanded-on-parity-devices-as-well-as-data.patch scsi-scsi_devinfo-add-reportlun2-to-emc-symmetrix-blacklist-entry.patch diff --git a/queue-4.9/usb-musb-da8xx-fix-babble-condition-handling.patch b/queue-4.9/usb-musb-da8xx-fix-babble-condition-handling.patch new file mode 100644 index 00000000000..c831cbe1293 --- /dev/null +++ b/queue-4.9/usb-musb-da8xx-fix-babble-condition-handling.patch @@ -0,0 +1,46 @@ +From bd3486ded7a0c313a6575343e6c2b21d14476645 Mon Sep 17 00:00:00 2001 +From: Bin Liu +Date: Tue, 5 Dec 2017 08:45:30 -0600 +Subject: usb: musb: da8xx: fix babble condition handling + +From: Bin Liu + +commit bd3486ded7a0c313a6575343e6c2b21d14476645 upstream. + +When babble condition happens, the musb controller might automatically +turns off VBUS. On DA8xx platform, the controller generates drvvbus +interrupt for turning off VBUS along with the babble interrupt. + +In this case, we should handle the babble interrupt first and recover +from the babble condition. + +This change ignores the drvvbus interrupt if babble interrupt is also +generated at the same time, so the babble recovery routine works +properly. + +Signed-off-by: Bin Liu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/musb/da8xx.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/usb/musb/da8xx.c ++++ b/drivers/usb/musb/da8xx.c +@@ -302,7 +302,15 @@ static irqreturn_t da8xx_musb_interrupt( + musb->xceiv->otg->state = OTG_STATE_A_WAIT_VRISE; + portstate(musb->port1_status |= USB_PORT_STAT_POWER); + del_timer(&otg_workaround); +- } else { ++ } else if (!(musb->int_usb & MUSB_INTR_BABBLE)){ ++ /* ++ * When babble condition happens, drvvbus interrupt ++ * is also generated. Ignore this drvvbus interrupt ++ * and let babble interrupt handler recovers the ++ * controller; otherwise, the host-mode flag is lost ++ * due to the MUSB_DEV_MODE() call below and babble ++ * recovery logic will not called. ++ */ + musb->is_active = 0; + MUSB_DEV_MODE(musb); + otg->default_a = 0; -- 2.47.3