Skip to contentSkip to conversation

USB :core :Prevent USB devices to autosuspend while setting interface

PATCH In review [email protected] 2 participants 2 messages Nov 10, 2017 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB :core :Prevent USB devices to autosuspend while setting interface

From: abhijeet kumar <[email protected]>

Runtime resume USB device in order to ensure that PM framework knows that the we might be using the device in a short time and doesn't autosuspend the device while we updating it's interface.

---
 drivers/usb/core/message.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/usb/core/message.c +4 -0
index 371a07d874a3..658603ed779e 100644
@@ -1305,6 +1305,9 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
 	if (iface->unregistering)
 		return -ENODEV;
 
+	/*Letting runtime PM now that we wish to use the device in a short time
+	 *pm_runtime_get(&iface->dev);
+	 */
+
 	alt = usb_altnum_to_altsetting(iface, alternate);
 	if (!alt) {

dev_warn(&dev->dev, "selecting invalid altsetting %d\n",

Signature · 1 line
1.9.1
#1 lore raw

Hi,

[email protected], [email protected] writes:

these emails don't exist. Fix your email client.

Quoted 1 line

From: abhijeet kumar <[email protected]>

capitalize names

Quoted 3 lines

Runtime resume USB device in order to ensure that PM framework knows that the we might be using the device in a short time and doesn't autosuspend the device while we updating it's interface.

this doesn't tell me about any problem. What, exactly, are you trying to fix?

Quoted 1 line

capitalize names

drivers/usb/core/message.c int usb_set_interface(struct usb_device *dev, int interface, int alternate) · line 1310

Quoted 11 lines
drivers/usb/core/message.c +3 -0
index 371a07d874a3..658603ed779e 100644
@@ -1305,6 +1305,9 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
 	if (iface->unregistering)
 		return -ENODEV;
 
+	/*Letting runtime PM now that we wish to use the device in a short time
+	 *pm_runtime_get(&iface->dev);
+	 */

why is it so that adding commented out code help? Did you *really* test this at all?

Signature · 1 line
balbi