From e896898e433ed20cbb18479142b64c92d5873c8b Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 3 Feb 2020 08:42:05 -0500 Subject: [PATCH] fixes for 4.9 Signed-off-by: Sasha Levin --- queue-4.9/series | 1 + ...turn-off-vbus-when-leaving-host-mode.patch | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 queue-4.9/usb-dwc3-turn-off-vbus-when-leaving-host-mode.patch diff --git a/queue-4.9/series b/queue-4.9/series index 18d5304621f..3c798b77041 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -37,3 +37,4 @@ media-gspca-zero-usb_buf.patch media-dvb-usb-dvb-usb-urb.c-initialize-actlen-to-0.patch ttyprintk-fix-a-potential-deadlock-in-interrupt-context-issue.patch bluetooth-fix-race-condition-in-hci_release_sock.patch +usb-dwc3-turn-off-vbus-when-leaving-host-mode.patch diff --git a/queue-4.9/usb-dwc3-turn-off-vbus-when-leaving-host-mode.patch b/queue-4.9/usb-dwc3-turn-off-vbus-when-leaving-host-mode.patch new file mode 100644 index 00000000000..cd368a624d2 --- /dev/null +++ b/queue-4.9/usb-dwc3-turn-off-vbus-when-leaving-host-mode.patch @@ -0,0 +1,40 @@ +From 5e1e5de77006905696800b8ea5bd124b627d1017 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 11 Dec 2019 10:10:03 -0600 +Subject: usb: dwc3: turn off VBUS when leaving host mode + +From: Bin Liu + +[ Upstream commit 09ed259fac621634d51cd986aa8d65f035662658 ] + +VBUS should be turned off when leaving the host mode. +Set GCTL_PRTCAP to device mode in teardown to de-assert DRVVBUS pin to +turn off VBUS power. + +Fixes: 5f94adfeed97 ("usb: dwc3: core: refactor mode initialization to its own function") +Cc: stable@vger.kernel.org +Signed-off-by: Bin Liu +Signed-off-by: Felipe Balbi +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/dwc3/core.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c +index 30bc5996a2f23..a89072f3bd3fb 100644 +--- a/drivers/usb/dwc3/core.c ++++ b/drivers/usb/dwc3/core.c +@@ -936,6 +936,9 @@ static void dwc3_core_exit_mode(struct dwc3 *dwc) + /* do nothing */ + break; + } ++ ++ /* de-assert DRVVBUS for HOST and OTG mode */ ++ dwc3_set_mode(dwc, DWC3_GCTL_PRTCAP_DEVICE); + } + + #define DWC3_ALIGN_MASK (16 - 1) +-- +2.20.1 + -- 2.47.3