aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-10-19 15:26:05 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-21 12:20:51 -0400
commitc82732a42896364296599b0f73f01c5e3fd781ae (patch)
treed2df3398f34b21420b27cc8a2885f7a2888cf53a /drivers/media
parent9b4a7c8a83899ef7742f63c0e9a8a28cbff2c29a (diff)
V4L/DVB (9300): pvrusb2: Fix deadlock problem
Fix deadlock problem in 2.6.27 caused by new USB core behavior in response to a USB device reset request. With older kernels, the USB device reset was "in line"; the reset simply took place and the driver retained its association with the hardware. However now this reset triggers a disconnect, and worse still the disconnect callback happens in the context of the caller who asked for the device reset. This results in an attempt by the pvrusb2 driver to recursively take a mutex it already has, which deadlocks the driver's worker thread. (Even if the disconnect callback were to happen on a different thread we'd still have problems however - because while the driver should survive and correctly disconnect / reconnect, it will then trigger another device reset during the repeated initialization, which will then cause another disconect, etc, forever.) The fix here is simply to not attempt the device reset (it was of marginal value anyway). Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 94265bd3d926..5b81ba469641 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -60,7 +60,6 @@ static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL};
60static DEFINE_MUTEX(pvr2_unit_mtx); 60static DEFINE_MUTEX(pvr2_unit_mtx);
61 61
62static int ctlchg; 62static int ctlchg;
63static int initusbreset = 1;
64static int procreload; 63static int procreload;
65static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 }; 64static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 };
66static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 }; 65static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 };
@@ -71,8 +70,6 @@ module_param(ctlchg, int, S_IRUGO|S_IWUSR);
71MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value"); 70MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value");
72module_param(init_pause_msec, int, S_IRUGO|S_IWUSR); 71module_param(init_pause_msec, int, S_IRUGO|S_IWUSR);
73MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay"); 72MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay");
74module_param(initusbreset, int, S_IRUGO|S_IWUSR);
75MODULE_PARM_DESC(initusbreset, "Do USB reset device on probe");
76module_param(procreload, int, S_IRUGO|S_IWUSR); 73module_param(procreload, int, S_IRUGO|S_IWUSR);
77MODULE_PARM_DESC(procreload, 74MODULE_PARM_DESC(procreload,
78 "Attempt init failure recovery with firmware reload"); 75 "Attempt init failure recovery with firmware reload");
@@ -1967,9 +1964,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
1967 } 1964 }
1968 hdw->fw1_state = FW1_STATE_OK; 1965 hdw->fw1_state = FW1_STATE_OK;
1969 1966
1970 if (initusbreset) {
1971 pvr2_hdw_device_reset(hdw);
1972 }
1973 if (!pvr2_hdw_dev_ok(hdw)) return; 1967 if (!pvr2_hdw_dev_ok(hdw)) return;
1974 1968
1975 for (idx = 0; idx < hdw->hdw_desc->client_modules.cnt; idx++) { 1969 for (idx = 0; idx < hdw->hdw_desc->client_modules.cnt; idx++) {