Skip to contentSkip to conversation

ttusbir: NOIO during resume

PATCH New Oliver Neukum 1 participant 2 messages May 12, 2022

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

PATCH v2 1/2 ttusbir: NOIO during resume

During resume we must assume tat devices are
not ready for block IO. Use GFP_NOIO.

v2: Resending due to typo in CC

---
 drivers/media/rc/ttusbir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/rc/ttusbir.c +1 -1
index 629787d53ee1..a8009dc958be 100644
@@ -402,7 +402,7 @@ static int ttusbir_resume(struct usb_interface *intf)
 	led_classdev_resume(&tt->led);
 
 	for (i = 0; i < NUM_URBS; i++) {
-		rc = usb_submit_urb(tt->urb[i], GFP_KERNEL);
+		rc = usb_submit_urb(tt->urb[i], GFP_NOIO);
 		if (rc) {
 			dev_warn(tt->dev, "failed to submit urb: %d\n", rc);
 			break;
Signature · 1 line
2.35.3
#1 lore raw

PATCH v2 2/2 ttusbir: avoid unnecessary usb_unlink_urb()

While the completion handler is running,
usb_unlink_urb(9 on yourself is a NOP. Remove it.

v2: Resending due to typo in CC

---
 drivers/media/rc/ttusbir.c | 2 --
 1 file changed, 2 deletions(-)
drivers/media/rc/ttusbir.c +0 -2
index a8009dc958be..560a26f3965c 100644
@@ -90,7 +90,6 @@ static void ttusbir_bulk_complete(struct urb *urb)
 	case -ECONNRESET:
 	case -ENOENT:
 	case -ESHUTDOWN:
-		usb_unlink_urb(urb);
 		return;
 	case -EPIPE:
 	default:
@@ -166,7 +165,6 @@ static void ttusbir_urb_complete(struct urb *urb)
 	case -ECONNRESET:
 	case -ENOENT:
 	case -ESHUTDOWN:
-		usb_unlink_urb(urb);
 		return;
 	case -EPIPE:
 	default:
Signature · 1 line
2.35.3