• Brian Norris's avatar
    mwifiex: reset timeout flag when resetting device · 9ae3fbd1
    Brian Norris authored
    If we reset because of a command timeout, we should reset this flag.
    Otherwise, we might erroneously think the next command after reset is
    timing out, and trigger another reset.
    
    The above behavior effectively neuters the automatic card_reset()
    behavior, as it means we will never recover from a command timeout
    properly (and in fact, we might enter an infinite loop:
    
      timeout -> reset -> (fake) timeout -> reset -> ...
    
    This fixes a bug introduced with introduction of PCIe function level
    reset support, but it was carried into the SDIO driver when it was
    converted to use the same codepaths. And this is currently mostly a
    problem only in the SDIO driver, because it's the only one with
    automatic card_reset() support (e.g., on command timeout). But it will
    be a problem for PCIe too, as I'm working on supporting automatic
    card_reset() for PCIe.
    
    Fixes: c742e623 ("mwifiex: sdio card reset enhancement")
    Fixes: 4c5dae59 ("mwifiex: add PCIe function level reset support")
    Signed-off-by: default avatarBrian Norris <briannorris@chromium.org>
    Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
    9ae3fbd1
main.c 48.8 KB