Arjan van de Ven d6e679b474 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>
2010-08-10 13:47:39 -07:00
..
2009-09-19 13:13:28 -07:00
2009-09-19 13:13:28 -07:00
2009-09-19 13:13:28 -07:00
2010-04-21 14:56:00 +10:00
2010-06-04 13:37:16 -07:00
2010-06-04 13:37:16 -07:00
2009-09-19 13:13:28 -07:00
2010-02-27 18:31:02 +01:00
2009-09-19 13:13:28 -07:00
2010-05-22 17:06:34 +09:00