Skip to content

Commit 0c84bde

Browse files
seanyoungmchehab
authored andcommitted
media: Revert "media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()"
This reverts commit 2052138. This breaks the TeVii s480 dual DVB-S2 S660. The device has a bulk in endpoint but no corresponding out endpoint, so the device does not pass the "has both receive and send bulk endpoint" test. Seemingly this device does not use dvb_usb_generic_rw() so I have tried removing the generic_bulk_ctrl_endpoint entry, but this resulted in different problems. As we have no explanation yet, revert. $ dmesg | grep -i -e dvb -e dw21 -e usb\ 4 [ 0.999122] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 1.023123] usb 4-1: new high-speed USB device number 2 using ehci-pci [ 1.130247] usb 1-1: New USB device found, idVendor=9022, idProduct=d482, +bcdDevice= 0.01 [ 1.130257] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1.152323] usb 4-1: New USB device found, idVendor=9022, idProduct=d481, +bcdDevice= 0.01 [ 1.152329] usb 4-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 6.701033] dvb-usb: found a 'TeVii S480.2 USB' in cold state, will try to +load a firmware [ 6.701178] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 6.701179] dw2102: start downloading DW210X firmware [ 6.703715] dvb-usb: found a 'Microsoft Xbox One Digital TV Tuner' in cold +state, will try to load a firmware [ 6.703974] dvb-usb: downloading firmware from file 'dvb-usb-dib0700-1.20.fw' [ 6.756432] usb 1-1: USB disconnect, device number 2 [ 6.862119] dvb-usb: found a 'TeVii S480.2 USB' in warm state. [ 6.862194] dvb-usb: TeVii S480.2 USB error while loading driver (-22) [ 6.862209] dvb-usb: found a 'TeVii S480.1 USB' in cold state, will try to +load a firmware [ 6.862244] dvb-usb: downloading firmware from file 'dvb-usb-s660.fw' [ 6.862245] dw2102: start downloading DW210X firmware [ 6.914811] usb 4-1: USB disconnect, device number 2 [ 7.014131] dvb-usb: found a 'TeVii S480.1 USB' in warm state. [ 7.014487] dvb-usb: TeVii S480.1 USB error while loading driver (-22) [ 7.014538] usbcore: registered new interface driver dw2102 Closes: https://lore.kernel.org/stable/20240801165146.38991f60@mir/ Fixes: 2052138 ("media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()") Reported-by: Stefan Lippers-Hollmann <[email protected]> Cc: [email protected] Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent e2ed536 commit 0c84bde

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

drivers/media/usb/dvb-usb/dvb-usb-init.c

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,11 @@ static int dvb_usb_force_pid_filter_usage;
2323
module_param_named(force_pid_filter_usage, dvb_usb_force_pid_filter_usage, int, 0444);
2424
MODULE_PARM_DESC(force_pid_filter_usage, "force all dvb-usb-devices to use a PID filter, if any (default: 0).");
2525

26-
static int dvb_usb_check_bulk_endpoint(struct dvb_usb_device *d, u8 endpoint)
27-
{
28-
if (endpoint) {
29-
int ret;
30-
31-
ret = usb_pipe_type_check(d->udev, usb_sndbulkpipe(d->udev, endpoint));
32-
if (ret)
33-
return ret;
34-
ret = usb_pipe_type_check(d->udev, usb_rcvbulkpipe(d->udev, endpoint));
35-
if (ret)
36-
return ret;
37-
}
38-
return 0;
39-
}
40-
41-
static void dvb_usb_clear_halt(struct dvb_usb_device *d, u8 endpoint)
42-
{
43-
if (endpoint) {
44-
usb_clear_halt(d->udev, usb_sndbulkpipe(d->udev, endpoint));
45-
usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, endpoint));
46-
}
47-
}
48-
4926
static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
5027
{
5128
struct dvb_usb_adapter *adap;
5229
int ret, n, o;
5330

54-
ret = dvb_usb_check_bulk_endpoint(d, d->props.generic_bulk_ctrl_endpoint);
55-
if (ret)
56-
return ret;
57-
ret = dvb_usb_check_bulk_endpoint(d, d->props.generic_bulk_ctrl_endpoint_response);
58-
if (ret)
59-
return ret;
6031
for (n = 0; n < d->props.num_adapters; n++) {
6132
adap = &d->adapter[n];
6233
adap->dev = d;
@@ -132,8 +103,10 @@ static int dvb_usb_adapter_init(struct dvb_usb_device *d, short *adapter_nrs)
132103
* when reloading the driver w/o replugging the device
133104
* sometimes a timeout occurs, this helps
134105
*/
135-
dvb_usb_clear_halt(d, d->props.generic_bulk_ctrl_endpoint);
136-
dvb_usb_clear_halt(d, d->props.generic_bulk_ctrl_endpoint_response);
106+
if (d->props.generic_bulk_ctrl_endpoint != 0) {
107+
usb_clear_halt(d->udev, usb_sndbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint));
108+
usb_clear_halt(d->udev, usb_rcvbulkpipe(d->udev, d->props.generic_bulk_ctrl_endpoint));
109+
}
137110

138111
return 0;
139112

0 commit comments

Comments
 (0)