Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf926adf authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (13184): gspca: Don't forget to resubmit URB's in case of an error



The gscpa core was not resubmitting URB's when the URB status was an error,
this means we will loose URB's (potentially all stopping the stream) in
case of sporadic USB issues. I've seen this with an Aiptek stv0680 based
PenCam connected through an USB 2.0 hub.

Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 21f1b932
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -138,7 +138,7 @@ static void fill_frame(struct gspca_dev *gspca_dev,
		if (!gspca_dev->frozen)
		if (!gspca_dev->frozen)
#endif
#endif
			PDEBUG(D_ERR|D_PACK, "urb status: %d", urb->status);
			PDEBUG(D_ERR|D_PACK, "urb status: %d", urb->status);
		return;
		goto resubmit;
	}
	}
	pkt_scan = gspca_dev->sd_desc->pkt_scan;
	pkt_scan = gspca_dev->sd_desc->pkt_scan;
	for (i = 0; i < urb->number_of_packets; i++) {
	for (i = 0; i < urb->number_of_packets; i++) {
@@ -174,6 +174,7 @@ static void fill_frame(struct gspca_dev *gspca_dev,
		pkt_scan(gspca_dev, frame, data, len);
		pkt_scan(gspca_dev, frame, data, len);
	}
	}


resubmit:
	/* resubmit the URB */
	/* resubmit the URB */
	st = usb_submit_urb(urb, GFP_ATOMIC);
	st = usb_submit_urb(urb, GFP_ATOMIC);
	if (st < 0)
	if (st < 0)
@@ -220,7 +221,7 @@ static void bulk_irq(struct urb *urb)
		if (!gspca_dev->frozen)
		if (!gspca_dev->frozen)
#endif
#endif
			PDEBUG(D_ERR|D_PACK, "urb status: %d", urb->status);
			PDEBUG(D_ERR|D_PACK, "urb status: %d", urb->status);
		return;
		goto resubmit;
	}
	}


	/* check the availability of the frame buffer */
	/* check the availability of the frame buffer */
@@ -235,6 +236,7 @@ static void bulk_irq(struct urb *urb)
					urb->actual_length);
					urb->actual_length);
	}
	}


resubmit:
	/* resubmit the URB */
	/* resubmit the URB */
	if (gspca_dev->cam.bulk_nurbs != 0) {
	if (gspca_dev->cam.bulk_nurbs != 0) {
		st = usb_submit_urb(urb, GFP_ATOMIC);
		st = usb_submit_urb(urb, GFP_ATOMIC);