diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2016-02-07 23:35:30 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-07 14:47:20 -0800 |
commit | a1f9ae2bd264e3aed95aacd0102bd22a0422b8d1 (patch) | |
tree | 9d089dc38c60b17344042bfc16bbc4eccd9a67f4 /drivers/misc/mei/bus.c | |
parent | b74d883138911b110cf8f5b7b94790e16bb56795 (diff) | |
download | blackbird-op-linux-a1f9ae2bd264e3aed95aacd0102bd22a0422b8d1.tar.gz blackbird-op-linux-a1f9ae2bd264e3aed95aacd0102bd22a0422b8d1.zip |
mei: bus: fix RX event scheduling
In this particular case this more correct and safer to check if the RX
event is set in the event mask rather than query waitqueue_active
Since the check is already performed in the mei_cl_bus_rx_event
function, it is just required to check for its return value.
Second, since we don't have exclusive waiter wake_up_interruptible_all
is not used correctly here.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/bus.c')
-rw-r--r-- | drivers/misc/mei/bus.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 0b05aa938799..a40d8e24ecda 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -252,23 +252,28 @@ void mei_cl_bus_notify_event(struct mei_cl *cl) } /** - * mei_cl_bus_rx_event - schedule rx evenet + * mei_cl_bus_rx_event - schedule rx event * * @cl: host client + * + * Return: true if event was scheduled + * false if the client is not waiting for event */ -void mei_cl_bus_rx_event(struct mei_cl *cl) +bool mei_cl_bus_rx_event(struct mei_cl *cl) { struct mei_cl_device *cldev = cl->cldev; if (!cldev || !cldev->event_cb) - return; + return false; if (!(cldev->events_mask & BIT(MEI_CL_EVENT_RX))) - return; + return false; set_bit(MEI_CL_EVENT_RX, &cldev->events); schedule_work(&cldev->event_work); + + return true; } /** |