• James Hogan's avatar
    mmc: dw_mmc: fix race with request and removal · 7456caae
    James Hogan authored
    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: default avatarJames Hogan <james.hogan@imgtec.com>
    Acked-by: default avatarWill Newton <will.newton@imgtec.com>
    Signed-off-by: default avatarChris Ball <cjb@laptop.org>
    7456caae
dw_mmc.c 43.8 KB