Skip to contentSkip to conversation

flexcop: unneeded ATOMIC

PATCH In review Oliver Neukum 2 participants 4 messages May 17, 2022 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 flexcop: unneeded ATOMIC

No need for GFP_ATOMIC during probe()

---
 drivers/media/usb/b2c2/flexcop-usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/b2c2/flexcop-usb.c +2 -2
index 7835bb0f32fc..98d9912a4efb 100644
@@ -446,7 +446,7 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
 	/* creating iso urbs */
 	for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) {
 		fc_usb->iso_urb[i] = usb_alloc_urb(B2C2_USB_FRAMES_PER_ISO,
-			GFP_ATOMIC);
+			GFP_KERNEL);
 		if (fc_usb->iso_urb[i] == NULL) {
 			ret = -ENOMEM;
 			goto urb_error;
@@ -479,7 +479,7 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
 			frame_offset += frame_size;
 		}
 
-		if ((ret = usb_submit_urb(fc_usb->iso_urb[i],GFP_ATOMIC))) {
+		if ((ret = usb_submit_urb(fc_usb->iso_urb[i],GFP_KERNEL))) {
 			err("submitting urb %d failed with %d.", i, ret);
 			goto urb_error;
 		}
Signature · 1 line
2.35.3
#1 lore raw

PATCH 2/2 flexcop: allow for modern speeds

High speed is no longer the ultimate in speed.

---
 drivers/media/usb/b2c2/flexcop-usb.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/media/usb/b2c2/flexcop-usb.c +6 -0
index 98d9912a4efb..52e9964c2e59 100644
@@ -525,6 +525,12 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb)
 	case USB_SPEED_HIGH:
 		info("running at HIGH speed.");
 		break;
+	case USB_SPEED_SUPER:
+		info("running at SUPER speed.");
+		break;
+	case USB_SPEED_SUPER_PLUS:
+		info("running at SUPER+ speed.");
+		break;
 	case USB_SPEED_UNKNOWN:
 	default:
 		err("cannot handle USB speed because it is unknown.");
Signature · 1 line
2.35.3
#2 lore raw

Re: [PATCH 2/2] flexcop: allow for modern speeds

Quoted 12 lines · Oliver Neukum

High speed is no longer the ultimate in speed.

---
 drivers/media/usb/b2c2/flexcop-usb.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/media/usb/b2c2/flexcop-usb.c +0 -0
index 98d9912a4efb..52e9964c2e59 100644

drivers/media/usb/b2c2/flexcop-usb.c static int flexcop_usb_init(struct flexcop_usb *fc_usb) · line 533

Quoted 9 lines
drivers/media/usb/b2c2/flexcop-usb.c +6 -0
@@ -525,6 +525,12 @@ static int flexcop_usb_init(struct flexcop_usb *fc_usb)
 	case USB_SPEED_HIGH:
 		info("running at HIGH speed.");
 		break;
+	case USB_SPEED_SUPER:
+		info("running at SUPER speed.");
+		break;
+	case USB_SPEED_SUPER_PLUS:
+		info("running at SUPER+ speed.");
+		break;

Not sure this change is warranted, though. These devices aren't going to start supporting SuperSpeed.

drivers/media/usb/b2c2/flexcop-usb.c static int flexcop_usb_init(struct flexcop_usb *fc_usb) · line 536

Quoted 3 lines
drivers/media/usb/b2c2/flexcop-usb.c +0 -0
 	case USB_SPEED_UNKNOWN:
 	default:
 		err("cannot handle USB speed because it is unknown.");

Johan

Reviewed-by on v1 1/2
#3 lore raw
In reply to Oliver Neukum
Quoted 1 line · Oliver Neukum

No need for GFP_ATOMIC during probe()

Please add a "media: " prefix and use a verb (e.g. "replace") in Subject.

Quoted 19 lines
---
 drivers/media/usb/b2c2/flexcop-usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/b2c2/flexcop-usb.c +1 -1
index 7835bb0f32fc..98d9912a4efb 100644
@@ -446,7 +446,7 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
 	/* creating iso urbs */
 	for (i = 0; i < B2C2_USB_NUM_ISO_URB; i++) {
 		fc_usb->iso_urb[i] = usb_alloc_urb(B2C2_USB_FRAMES_PER_ISO,
-			GFP_ATOMIC);
+			GFP_KERNEL);
 		if (fc_usb->iso_urb[i] == NULL) {
 			ret = -ENOMEM;
 			goto urb_error;

drivers/media/usb/b2c2/flexcop-usb.c static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb) · line 482

Quoted 5 lines
drivers/media/usb/b2c2/flexcop-usb.c +1 -1
@@ -479,7 +479,7 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb)
 			frame_offset += frame_size;
 		}
 
-		if ((ret = usb_submit_urb(fc_usb->iso_urb[i],GFP_ATOMIC))) {
+		if ((ret = usb_submit_urb(fc_usb->iso_urb[i],GFP_KERNEL))) {

And add the missing space after the comma here.

drivers/media/usb/b2c2/flexcop-usb.c static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb) · line 485

Quoted 3 lines
drivers/media/usb/b2c2/flexcop-usb.c +0 -0
 			err("submitting urb %d failed with %d.", i, ret);
 			goto urb_error;
 		}

Change itself looks good otherwise.

Johan