• Ulf Hansson's avatar
    mwifiex: Re-work support for SDIO HW reset · cdb2256f
    Ulf Hansson authored
    The SDIO HW reset procedure in mwifiex_sdio_card_reset_work() is broken,
    when the SDIO card is shared with another SDIO func driver. This is the
    case when the Bluetooth btmrvl driver is being used in combination with
    mwifiex. More precisely, when mwifiex_sdio_card_reset_work() runs to resets
    the SDIO card, the btmrvl driver doesn't get notified about it. Beyond that
    point, the btmrvl driver will fail to communicate with the SDIO card.
    
    This is a generic problem for SDIO func drivers sharing an SDIO card, which
    are about to be addressed in subsequent changes to the mmc core and the
    mmc_hw_reset() interface. In principle, these changes means the
    mmc_hw_reset() interface starts to return 1 if the are multiple drivers for
    the SDIO card, as to indicate to the caller that the reset needed to be
    scheduled asynchronously through a hotplug mechanism of the SDIO card.
    
    Let's prepare the mwifiex driver to support the upcoming new behaviour of
    mmc_hw_reset(), which means extending the mwifiex_sdio_card_reset_work() to
    support the asynchronous SDIO HW reset path. This also means, we need to
    allow the ->remove() callback to run, without waiting for the FW to be
    loaded. Additionally, during system suspend, mwifiex_sdio_suspend() may be
    called when a reset has been scheduled, but waiting to be executed. In this
    scenario let's simply return -EBUSY to abort the suspend process, as to
    allow the reset to be completed first.
    Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
    Tested-by: default avatarDouglas Anderson <dianders@chromium.org>
    Cc: stable@vger.kernel.org # v5.4+
    Acked-by: default avatarKalle Valo <kvalo@codeaurora.org>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    cdb2256f
main.h 50.9 KB