diff options
author | Alexander Usyskin <alexander.usyskin@intel.com> | 2020-08-18 14:51:40 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-08-18 16:44:43 +0300 |
commit | d1376f3d89d5177dae7cae40f3f9fdf73e9bfec9 (patch) | |
tree | 045c2bcecb3c06c27ac7793af635da0de5ce5d2a /drivers/misc/mei/main.c | |
parent | 74a9c967aaf6cd1314ef371678f889ad9fcedb2c (diff) | |
download | linux-d1376f3d89d5177dae7cae40f3f9fdf73e9bfec9.tar.xz |
mei: add a spin lock to protect rd_completed queue
In order to support vtags we need to access read completed
queue out of driver big lock.
Add a spin lock to protect rd_completed queue.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Link: https://lore.kernel.org/r/20200818115147.2567012-7-tomas.winkler@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r-- | drivers/misc/mei/main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 86ef5c1a7928..441bdea4d4c1 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -178,7 +178,7 @@ static ssize_t mei_read(struct file *file, char __user *ubuf, mutex_unlock(&dev->device_lock); if (wait_event_interruptible(cl->rx_wait, - !list_empty(&cl->rd_completed) || + mei_cl_read_cb(cl, file) || !mei_cl_is_connected(cl))) { if (signal_pending(current)) return -EINTR; @@ -229,7 +229,7 @@ copy_buffer: goto out; free: - mei_io_cb_free(cb); + mei_cl_del_rd_completed(cl, cb); *offset = 0; out: @@ -572,7 +572,7 @@ static __poll_t mei_poll(struct file *file, poll_table *wait) if (req_events & (EPOLLIN | EPOLLRDNORM)) { poll_wait(file, &cl->rx_wait, wait); - if (!list_empty(&cl->rd_completed)) + if (mei_cl_read_cb(cl, file)) mask |= EPOLLIN | EPOLLRDNORM; else mei_cl_read_start(cl, mei_cl_mtu(cl), file); |