summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-a4tech.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-07-29 17:14:15 +0200
committerJiri Kosina <jkosina@suse.cz>2014-08-25 03:28:05 -0500
commit0e0d7520064c9f5668c030afafdbcab242176195 (patch)
tree065b9a6d5e0cd495b315040941cc93df32a7617f /drivers/hid/hid-a4tech.c
parentcee5aa1f81b1e88d8de05df226bfd207041954c2 (diff)
downloadtalos-obmc-linux-0e0d7520064c9f5668c030afafdbcab242176195.tar.gz
talos-obmc-linux-0e0d7520064c9f5668c030afafdbcab242176195.zip
HID: uhid: simplify report-cb shutdown
The report-query is blocking, so when user-space destroys a device we have to wake up any blocking kernel context that is currently in the report-cb. We used some broken correlation between @report_done and @running so far. Replace it by a much more obvious use. We now wake up the report-cb if either @report_done or @running is set. wake_up() and wait_event() serve as implicit barriers (as they always do) so no need to use smp_rmb/wmb directly. Note that @report_done is never reset by anyone but the report-cb, thus it cannot flip twice while we wait for it. And whenever we set @running, we afterwards synchronously remove the HID device. Therefore, we wait for all report-cbs to finish before we return. This way, @running can never flip to true while we wait for it. Signed-off-by: David Herrmann <dh.herrmann@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-a4tech.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud