Skip to contentSkip to conversation

patch "usb: dwc3: prevent setting PRTCAP to OTG from debugfs" added to usb-next

PATCH [email protected] 1 participant 1 message Mar 23, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: dwc3: prevent setting PRTCAP to OTG from debugfs

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-next branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will also be merged in the next major kernel release during the merge window.

If you have any questions about this process, please let me know.

Quoted 1 line

From daaecc6541d014dca073473ec8a4120c0babbeb4 Mon Sep 17 00:00:00 2001

From: Roger Quadros <[email protected]>
Date: Tue, 27 Feb 2018 12:54:37 +0200
Subject: usb: dwc3: prevent setting PRTCAP to OTG from debugfs

We don't support PRTCAP == OTG yet, so prevent user from setting it via debugfs.

Fixes 41ce1456e1db ("usb: dwc3: core: make dwc3_set_mode() work properly")
Cc <[email protected]> # v4.12+
---
 drivers/usb/dwc3/core.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/dwc3/core.c +3 -0
index f1d838a4acd6..b014c87a7319 100644
@@ -119,6 +119,9 @@ static void __dwc3_set_mode(struct work_struct *work)
 	if (dwc->dr_mode != USB_DR_MODE_OTG)
 		return;
 
+	if (dwc->desired_dr_role == DWC3_GCTL_PRTCAP_OTG)
+		return;
+
 	switch (dwc->current_dr_role) {
 	case DWC3_GCTL_PRTCAP_HOST:
 		dwc3_host_exit(dwc);
Signature · 1 line
2.16.2