diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2010-06-17 12:02:15 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 22:47:39 +0200 |
commit | d6e679b474c096f1125087e789e7af8886de39d3 (patch) | |
tree | b24235a50fe8c6c7d640999abd02ce6ed5d91cad /include/asm-generic | |
parent | serial: replace open coded mutex with a real mutex in mrst_max3110.c (diff) | |
download | linux-d6e679b474c096f1125087e789e7af8886de39d3.tar.xz linux-d6e679b474c096f1125087e789e7af8886de39d3.zip |
serial: fix wakup races in the mrst_max3110 driver
The mrst_max3110 driver had a set of unsafe wakeup sequences
along the following line:
if (!atomic_read(&foo)) {
atomic_set(&foo, 1);
wake_up(worker_thread);
}
and the worker thread would do
if (atomic_read(&foo)) {
do_work();
atomic_set(&foo, 0);
}
which can result in various missed wakups due to test-then-set races,
as well as due to clear-after-work instead of clear-before-work.
This patch fixes these races by using the proper bit test-and-set operations,
and by doing clear-before-work.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/asm-generic')
0 files changed, 0 insertions, 0 deletions