From: Arjan van de Ven Date: Thu, 17 Jun 2010 10:02:15 +0000 (+0100) Subject: serial: fix wakup races in the mrst_max3110 driver X-Git-Tag: v2.6.36-rc1~294^2~60 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6e679b474c096f1125087e789e7af8886de39d3;p=pandora-kernel.git 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-diff-tree failed