diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2010-06-17 11:02:15 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-08-10 13:47:39 -0700 |
commit | d6e679b474c096f1125087e789e7af8886de39d3 (patch) | |
tree | b24235a50fe8c6c7d640999abd02ce6ed5d91cad /include/asm-generic | |
parent | 68c16b4117cc746a91897d629b61e5f2af18c225 (diff) |
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