Skip to contentSkip to conversation

Adjustments to xpad handling for unplug

PATCH Applied Mario Limonciello 2 participants 6 messages Jun 9, 2025 – Jun 27, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Adjustments to xpad handling for unplug

From: Mario Limonciello <[email protected]>

When an xpad compatible device is unplugged there are errors in the logs and the correct error code also isn't passed up.

Mario Limonciello (2):
Input: xpad: Adjust error handling for disconnect
Input: xpad: Return errors from xpad_try_sending_next_out_packet() up

 drivers/input/joystick/xpad.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/2 Input: xpad: Adjust error handling for disconnect

From: Mario Limonciello <[email protected]>

When a device supporting xpad is disconnected it's expected that a URB will fail to transmit.

Only show an error message when the error isn't -ENODEV.

Cc Vicki Pfau <[email protected]>
Fixes 7fc595f4c0263 ("Input: xpad - correctly handle concurrent LED and FF requests")
---
 drivers/input/joystick/xpad.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/input/joystick/xpad.c +4 -3
index c066a4da7c140..714a694fc0e5e 100644
@@ -1344,9 +1344,10 @@ static int xpad_try_sending_next_out_packet(struct usb_xpad *xpad)
 		usb_anchor_urb(xpad->irq_out, &xpad->irq_out_anchor);
 		error = usb_submit_urb(xpad->irq_out, GFP_ATOMIC);
 		if (error) {
-			dev_err(&xpad->intf->dev,
-				"%s - usb_submit_urb failed with result %d\n",
-				__func__, error);
+			if (error != -ENODEV)
+				dev_err(&xpad->intf->dev,
+					"%s - usb_submit_urb failed with result %d\n",
+					__func__, error);
 			usb_unanchor_urb(xpad->irq_out);
 			return -EIO;
 		}
Signature · 1 line
2.43.0
maintainer Applied
#2 lore raw

Re: [PATCH 1/2] Input: xpad: Adjust error handling for disconnect

Quoted 10 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

When a device supporting xpad is disconnected it's expected that a URB will fail to transmit.

Only show an error message when the error isn't -ENODEV.

Cc Vicki Pfau <[email protected]>
Fixes 7fc595f4c0263 ("Input: xpad - correctly handle concurrent LED and FF requests")

Applied, thank you.

Signature · 1 line
Dmitry
#3 lore raw

PATCH 2/2 Input: xpad: Return errors from xpad_try_sending_next_out_packet() up

In reply to Mario Limonciello

From: Mario Limonciello <[email protected]>

Not all errors that occur in xpad_try_sending_next_out_packet() are IO errors. Pass up the error code to the caller so that it can decide what to to.

---
 drivers/input/joystick/xpad.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/xpad.c +1 -1
index 714a694fc0e5e..e0374111d0174 100644
@@ -1349,7 +1349,7 @@ static int xpad_try_sending_next_out_packet(struct usb_xpad *xpad)
 					"%s - usb_submit_urb failed with result %d\n",
 					__func__, error);
 			usb_unanchor_urb(xpad->irq_out);
-			return -EIO;
+			return error;
 		}
 
 		xpad->irq_out_active = true;
Signature · 1 line
2.43.0
maintainer Applied
#4 lore raw

Re: [PATCH 2/2] Input: xpad: Return errors from xpad_try_sending_next_out_packet() up

Quoted 8 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

Not all errors that occur in xpad_try_sending_next_out_packet() are IO errors. Pass up the error code to the caller so that it can decide what to to.

Applied, thank you.

Signature · 1 line
Dmitry
#5 lore raw
In reply to Mario Limonciello
Quoted 5 lines · Mario Limonciello

From: Mario Limonciello <[email protected]>

When an xpad compatible device is unplugged there are errors in the logs and the correct error code also isn't passed up.

Quoted 7 lines

Mario Limonciello (2):
Input: xpad: Adjust error handling for disconnect
Input: xpad: Return errors from xpad_try_sending_next_out_packet() up

  drivers/input/joystick/xpad.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)

Gentle ping on this series.