mirror of https://gitee.com/openkylin/linux.git
Revert "media: dvbsky: use just one mutex for serializing device R/W ops"
As pointed at:
https://bugzilla.kernel.org/show_bug.cgi?id=199323
This patch causes a bad effect on RPi. I suspect that the root
cause is at the USB out of tree RPi driver, with uses high priority
interrupts instead of normal ones. Anyway, as this patch
is mostly a cleanup, better to revert it.
This reverts commit 7d95fb746c
.
Cc: stable@vger.kernel.org # For Kernel 4.18
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
0929983e49
commit
9afc82194d
|
@ -31,6 +31,7 @@ MODULE_PARM_DESC(disable_rc, "Disable inbuilt IR receiver.");
|
|||
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
|
||||
|
||||
struct dvbsky_state {
|
||||
struct mutex stream_mutex;
|
||||
u8 ibuf[DVBSKY_BUF_LEN];
|
||||
u8 obuf[DVBSKY_BUF_LEN];
|
||||
u8 last_lock;
|
||||
|
@ -67,17 +68,18 @@ static int dvbsky_usb_generic_rw(struct dvb_usb_device *d,
|
|||
|
||||
static int dvbsky_stream_ctrl(struct dvb_usb_device *d, u8 onoff)
|
||||
{
|
||||
struct dvbsky_state *state = d_to_priv(d);
|
||||
int ret;
|
||||
static u8 obuf_pre[3] = { 0x37, 0, 0 };
|
||||
static u8 obuf_post[3] = { 0x36, 3, 0 };
|
||||
u8 obuf_pre[3] = { 0x37, 0, 0 };
|
||||
u8 obuf_post[3] = { 0x36, 3, 0 };
|
||||
|
||||
mutex_lock(&d->usb_mutex);
|
||||
ret = dvb_usbv2_generic_rw_locked(d, obuf_pre, 3, NULL, 0);
|
||||
mutex_lock(&state->stream_mutex);
|
||||
ret = dvbsky_usb_generic_rw(d, obuf_pre, 3, NULL, 0);
|
||||
if (!ret && onoff) {
|
||||
msleep(20);
|
||||
ret = dvb_usbv2_generic_rw_locked(d, obuf_post, 3, NULL, 0);
|
||||
ret = dvbsky_usb_generic_rw(d, obuf_post, 3, NULL, 0);
|
||||
}
|
||||
mutex_unlock(&d->usb_mutex);
|
||||
mutex_unlock(&state->stream_mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -606,6 +608,8 @@ static int dvbsky_init(struct dvb_usb_device *d)
|
|||
if (ret)
|
||||
return ret;
|
||||
*/
|
||||
mutex_init(&state->stream_mutex);
|
||||
|
||||
state->last_lock = 0;
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue