• Guennadi Liakhovetski's avatar
    mmc: prohibit card detection when host is not ready · d9adcc12
    Guennadi Liakhovetski authored
    Currently mmc host drivers have to decide whether to enable card
    detection before calling mmc_add_host() -- in which case a card
    insertion event can arrive before the host has been completely
    initialised -- or after mmc_add_host(), in which case the initial
    card detection can be problematic.
    
    This patch adds an explicit indication of when card detection should
    not be carried out. With it in place enabling card detection before
    calling mmc_add_host() should be safe. Similarly, disabling it again
    after calling mmc_remove_host() will avoid any races.
    Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
    Signed-off-by: default avatarChris Ball <cjb@laptop.org>
    d9adcc12
host.c 11.1 KB