From: James Hogan Date: Fri, 24 Jun 2011 12:55:10 +0000 (+0100) Subject: mmc: dw_mmc: fix race with request and removal X-Git-Tag: v3.1-rc1~321^2~56 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7456caae37396fc1bc6f8e9461d07664b8c2f280;p=pandora-kernel.git mmc: dw_mmc: fix race with request and removal When a request is made, the card presence is checked and the request is queued. These two parts must be atomic with respect to card removal, or a card removal could be handled in between, and the new request wouldn't get cancelled until another card was inserted. Therefore move the spinlock protection from dw_mci_queue_request() up into dw_mci_request() to cover the presence check. Note that the test_bit() used for the presence check isn't atomic itself, so should have been protected by a spinlock anyway. Signed-off-by: James Hogan Acked-by: Will Newton Signed-off-by: Chris Ball --- Reading git-diff-tree failed