From d6e679b474c096f1125087e789e7af8886de39d3 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Thu, 17 Jun 2010 11:02:15 +0100 Subject: [PATCH] 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 Signed-off-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- Reading git-format-patch failed