1. 14 Nov, 2019 5 commits
    • Thierry Reding's avatar
      mmc: mmc_spi: Use proper debounce time for CD GPIO · 62c51725
      Thierry Reding authored
      According to the comment, board files used to specify 1 ms for the
      debounce time. gpiod_set_debounce() needs the debounce time to be
      specified in units of microseconds, so make sure to multiply the value
      by 1000.
      
      Note that, according to the git log, the board files actually did
      specify 1 us for bounce times, but that seems really low. Device tree
      bindings for this type of GPIO typically specify the debounce times in
      milliseconds, so setting this default value to 1 ms seems like it would
      be somewhat safer.
      Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
      Acked-by: default avatarPavel Machek <pavel@denx.de>
      Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      62c51725
    • Peng Fan's avatar
      dt-bindings: mmc: fsl-imx-esdhc: add imx8m compatible string · d5cf1a59
      Peng Fan authored
      Add imx8mq/m/n compatible string
      Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
      Acked-by: default avatarRob Herring <robh@kernel.org>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      d5cf1a59
    • Ulf Hansson's avatar
      mmc: core: Re-work HW reset for SDIO cards · 2ac55d5e
      Ulf Hansson authored
      It have turned out that it's not a good idea to unconditionally do a power
      cycle and then to re-initialize the SDIO card, as currently done through
      mmc_hw_reset() -> mmc_sdio_hw_reset(). This because there may be multiple
      SDIO func drivers probed, who also shares the same SDIO card.
      
      To address these scenarios, one may be tempted to use a notification
      mechanism, as to allow the core to inform each of the probed func drivers,
      about an ongoing HW reset. However, supporting such an operation from the
      func driver point of view, may not be entirely trivial.
      
      Therefore, let's use a more simplistic approach to solve the problem, by
      instead forcing the card to be removed and re-detected, via scheduling a
      rescan-work. In this way, we can rely on existing infrastructure, as the
      func driver's ->remove() and ->probe() callbacks, becomes invoked to deal
      with the cleanup and the re-initialization.
      
      This solution may be considered as rather heavy, especially if a func
      driver doesn't share its card with other func drivers. To address this,
      let's keep the current immediate HW reset option as well, but run it only
      when there is one func driver probed for the card.
      
      Finally, to allow the caller of mmc_hw_reset(), to understand if the reset
      is being asynchronously managed from a scheduled work, it returns 1
      (propagated from mmc_sdio_hw_reset()). If the HW reset is executed
      successfully and synchronously it returns 0, which maintains the existing
      behaviour.
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Tested-by: default avatarDouglas Anderson <dianders@chromium.org>
      Cc: stable@vger.kernel.org # v5.4+
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      2ac55d5e
    • Ulf Hansson's avatar
      mmc: core: Drop check for mmc_card_is_removable() in mmc_rescan() · 99b4ddd8
      Ulf Hansson authored
      Upfront in mmc_rescan() we use the host->rescan_entered flag, to allow
      scanning only once for non-removable cards. Therefore, it's also not
      possible that we can have a corresponding card bus attached (host->bus_ops
      is NULL), when we are scanning non-removable cards.
      
      For this reason, let' drop the check for mmc_card_is_removable() as it's
      redundant.
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Tested-by: default avatarDouglas Anderson <dianders@chromium.org>
      Cc: stable@vger.kernel.org # v5.4+
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      99b4ddd8
    • 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
  2. 13 Nov, 2019 35 commits