diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2012-02-12 05:29:38 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-08 06:52:25 -0500 |
commit | 46f3da990b8087c95613744a772cab7557b9b180 (patch) | |
tree | 0ebf8d906cd6b3f675db945e6bda3c41466f7a15 /drivers/media/dvb | |
parent | c6e8d86fffd8edf1bfccbd441b1812ee919fe3d5 (diff) |
[media] it913x ver 1.26 change to remove interruptible mutex locks
Some virtual I2C commands are missed along some PID filtering
commands resulting complete stall of driver.
Since dvb-usb cannot handle the -EAGAIN error and commands
generally should not be missed mutex_lock is used instead.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/it913x.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/media/dvb/dvb-usb/it913x.c b/drivers/media/dvb/dvb-usb/it913x.c index 2560652763c..bfadf12986c 100644 --- a/drivers/media/dvb/dvb-usb/it913x.c +++ b/drivers/media/dvb/dvb-usb/it913x.c | |||
@@ -263,8 +263,8 @@ static int it913x_pid_filter_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
263 | int ret; | 263 | int ret; |
264 | u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; | 264 | u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; |
265 | 265 | ||
266 | if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) | 266 | mutex_lock(&adap->dev->i2c_mutex); |
267 | return -EAGAIN; | 267 | |
268 | deb_info(1, "PID_C (%02x)", onoff); | 268 | deb_info(1, "PID_C (%02x)", onoff); |
269 | 269 | ||
270 | ret = it913x_wr_reg(udev, pro, PID_EN, onoff); | 270 | ret = it913x_wr_reg(udev, pro, PID_EN, onoff); |
@@ -280,8 +280,8 @@ static int it913x_pid_filter(struct dvb_usb_adapter *adap, | |||
280 | int ret; | 280 | int ret; |
281 | u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; | 281 | u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; |
282 | 282 | ||
283 | if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) | 283 | mutex_lock(&adap->dev->i2c_mutex); |
284 | return -EAGAIN; | 284 | |
285 | deb_info(1, "PID_F (%02x)", onoff); | 285 | deb_info(1, "PID_F (%02x)", onoff); |
286 | 286 | ||
287 | ret = it913x_wr_reg(udev, pro, PID_LSB, (u8)(pid & 0xff)); | 287 | ret = it913x_wr_reg(udev, pro, PID_LSB, (u8)(pid & 0xff)); |
@@ -316,8 +316,8 @@ static int it913x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], | |||
316 | int ret; | 316 | int ret; |
317 | u32 reg; | 317 | u32 reg; |
318 | u8 pro; | 318 | u8 pro; |
319 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) | 319 | |
320 | return -EAGAIN; | 320 | mutex_lock(&d->i2c_mutex); |
321 | 321 | ||
322 | debug_data_snipet(1, "Message out", msg[0].buf); | 322 | debug_data_snipet(1, "Message out", msg[0].buf); |
323 | deb_info(2, "num of messages %d address %02x", num, msg[0].addr); | 323 | deb_info(2, "num of messages %d address %02x", num, msg[0].addr); |
@@ -358,8 +358,7 @@ static int it913x_rc_query(struct dvb_usb_device *d) | |||
358 | int ret; | 358 | int ret; |
359 | u32 key; | 359 | u32 key; |
360 | /* Avoid conflict with frontends*/ | 360 | /* Avoid conflict with frontends*/ |
361 | if (mutex_lock_interruptible(&d->i2c_mutex) < 0) | 361 | mutex_lock(&d->i2c_mutex); |
362 | return -EAGAIN; | ||
363 | 362 | ||
364 | ret = it913x_io(d->udev, READ_LONG, PRO_LINK, CMD_IR_GET, | 363 | ret = it913x_io(d->udev, READ_LONG, PRO_LINK, CMD_IR_GET, |
365 | 0, 0, &ibuf[0], sizeof(ibuf)); | 364 | 0, 0, &ibuf[0], sizeof(ibuf)); |
@@ -603,15 +602,15 @@ static int it913x_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff) | |||
603 | int ret = 0; | 602 | int ret = 0; |
604 | u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; | 603 | u8 pro = (adap->id == 0) ? DEV_0_DMOD : DEV_1_DMOD; |
605 | 604 | ||
606 | if (mutex_lock_interruptible(&adap->dev->i2c_mutex) < 0) | ||
607 | return -EAGAIN; | ||
608 | deb_info(1, "STM (%02x)", onoff); | 605 | deb_info(1, "STM (%02x)", onoff); |
609 | 606 | ||
610 | if (!onoff) | 607 | if (!onoff) { |
611 | ret = it913x_wr_reg(adap->dev->udev, pro, PID_RST, 0x1); | 608 | mutex_lock(&adap->dev->i2c_mutex); |
612 | 609 | ||
610 | ret = it913x_wr_reg(adap->dev->udev, pro, PID_RST, 0x1); | ||
613 | 611 | ||
614 | mutex_unlock(&adap->dev->i2c_mutex); | 612 | mutex_unlock(&adap->dev->i2c_mutex); |
613 | } | ||
615 | 614 | ||
616 | return ret; | 615 | return ret; |
617 | } | 616 | } |
@@ -885,5 +884,5 @@ module_usb_driver(it913x_driver); | |||
885 | 884 | ||
886 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); | 885 | MODULE_AUTHOR("Malcolm Priestley <tvboxspy@gmail.com>"); |
887 | MODULE_DESCRIPTION("it913x USB 2 Driver"); | 886 | MODULE_DESCRIPTION("it913x USB 2 Driver"); |
888 | MODULE_VERSION("1.25"); | 887 | MODULE_VERSION("1.26"); |
889 | MODULE_LICENSE("GPL"); | 888 | MODULE_LICENSE("GPL"); |