Skip to contentSkip to conversation

USB: serial: mos7720: fix remote wakeup

PATCH In review Johan Hovold 2 participants 4 messages Nov 7, 2019 – Nov 11, 2019

Subsystems (3)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/2 USB: serial: mos7720: fix remote wakeup

The driver was setting the device remote-wakeup feature during probe in violation of the USB specification (which says it should only be set just prior to suspending the device). This could potentially waste power during suspend as well as lead to spurious wakeups.

Note that USB core would clear the remote-wakeup feature at first resume.

Fixes 0f64478cbc7a ("USB: add USB serial mos7720 driver")
Cc stable <[email protected]> # 2.6.19
---
 drivers/usb/serial/mos7720.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/usb/serial/mos7720.c +0 -4
index 18110225d506..2ec4eeacebc7 100644
@@ -1833,10 +1833,6 @@ static int mos7720_startup(struct usb_serial *serial)
 	product = le16_to_cpu(serial->dev->descriptor.idProduct);
 	dev = serial->dev;
 
-	/* setting configuration feature to one */
-	usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
-			(__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5000);
-
 	if (product == MOSCHIP_DEVICE_ID_7715) {
 		struct urb *urb = serial->port[0]->interrupt_in_urb;
 
Signature · 1 line
2.23.0
author maintainer
#1 lore raw

PATCH 2/2 USB: serial: mos7840: fix remote wakeup

The driver was setting the device remote-wakeup feature during probe in violation of the USB specification (which says it should only be set just prior to suspending the device). This could potentially waste power during suspend as well as lead to spurious wakeups.

Note that USB core would clear the remote-wakeup feature at first resume.

Fixes 3f5429746d91 ("USB: Moschip 7840 USB-Serial Driver")
Cc stable <[email protected]> # 2.6.19
---
 drivers/usb/serial/mos7840.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/usb/serial/mos7840.c +0 -5
index 3eeeee38debc..ab4bf8d6d7df 100644
@@ -2290,11 +2290,6 @@ static int mos7840_port_probe(struct usb_serial_port *port)
 			goto error;
 		} else
 			dev_dbg(&port->dev, "ZLP_REG5 Writing success status%d\n", status);
-
-		/* setting configuration feature to one */
-		usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
-				0x03, 0x00, 0x01, 0x00, NULL, 0x00,
-				MOS_WDR_TIMEOUT);
 	}
 	return 0;
 error:
Signature · 1 line
2.23.0
Reviewed-by Greg Kroah-Hartman on v1 2/2
#2 lore raw

Re: [PATCH 2/2] USB: serial: mos7840: fix remote wakeup

Quoted 33 lines · Johan Hovold

The driver was setting the device remote-wakeup feature during probe in violation of the USB specification (which says it should only be set just prior to suspending the device). This could potentially waste power during suspend as well as lead to spurious wakeups.

Note that USB core would clear the remote-wakeup feature at first resume.

Fixes 3f5429746d91 ("USB: Moschip 7840 USB-Serial Driver")
Cc stable <[email protected]> # 2.6.19
---
 drivers/usb/serial/mos7840.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/usb/serial/mos7840.c +0 -5
index 3eeeee38debc..ab4bf8d6d7df 100644
@@ -2290,11 +2290,6 @@ static int mos7840_port_probe(struct usb_serial_port *port)
 			goto error;
 		} else
 			dev_dbg(&port->dev, "ZLP_REG5 Writing success status%d\n", status);
-
-		/* setting configuration feature to one */
-		usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
-				0x03, 0x00, 0x01, 0x00, NULL, 0x00,
-				MOS_WDR_TIMEOUT);
 	}
 	return 0;
 error:
Signature · 1 line
2.23.0
Reviewed-by Greg Kroah-Hartman on v1 1/2
#3 lore raw
In reply to Johan Hovold
Quoted 20 lines · Johan Hovold

The driver was setting the device remote-wakeup feature during probe in violation of the USB specification (which says it should only be set just prior to suspending the device). This could potentially waste power during suspend as well as lead to spurious wakeups.

Note that USB core would clear the remote-wakeup feature at first resume.

Fixes 0f64478cbc7a ("USB: add USB serial mos7720 driver")
Cc stable <[email protected]> # 2.6.19
---
 drivers/usb/serial/mos7720.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/usb/serial/mos7720.c +0 -0
index 18110225d506..2ec4eeacebc7 100644

drivers/usb/serial/mos7720.c static int mos7720_startup(struct usb_serial *serial) · line 1838

Quoted 10 lines
drivers/usb/serial/mos7720.c +0 -4
@@ -1833,10 +1833,6 @@ static int mos7720_startup(struct usb_serial *serial)
 	product = le16_to_cpu(serial->dev->descriptor.idProduct);
 	dev = serial->dev;
 
-	/* setting configuration feature to one */
-	usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
-			(__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5000);
-
 	if (product == MOSCHIP_DEVICE_ID_7715) {
 		struct urb *urb = serial->port[0]->interrupt_in_urb;