1. 18 12月, 2019 3 次提交
  2. 18 11月, 2019 1 次提交
  3. 15 11月, 2019 1 次提交
  4. 14 11月, 2019 2 次提交
    • U
      mmc: core: Re-work HW reset for SDIO cards · 2ac55d5e
      Ulf Hansson 提交于
      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: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NDouglas Anderson <dianders@chromium.org>
      Cc: stable@vger.kernel.org # v5.4+
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      2ac55d5e
    • U
      mmc: core: Drop check for mmc_card_is_removable() in mmc_rescan() · 99b4ddd8
      Ulf Hansson 提交于
      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: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NDouglas Anderson <dianders@chromium.org>
      Cc: stable@vger.kernel.org # v5.4+
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      99b4ddd8
  5. 13 11月, 2019 2 次提交
  6. 12 9月, 2019 1 次提交
  7. 11 9月, 2019 5 次提交
  8. 03 9月, 2019 2 次提交
  9. 30 8月, 2019 1 次提交
  10. 22 7月, 2019 1 次提交
    • A
      mmc: mmc_spi: Enable stable writes · 3a6ffb3c
      Andreas Koop 提交于
      While using the mmc_spi driver occasionally errors like this popped up:
      
      mmcblk0: error -84 transferring data end_request: I/O error, dev mmcblk0, sector 581756
      
      I looked on the Internet for occurrences of the same problem and came
      across a helpful post [1]. It includes source code to reproduce the bug.
      There is also an analysis about the cause. During transmission data in the
      supplied buffer is being modified. Thus the previously calculated checksum
      is not correct anymore.
      
      After some digging I found out that device drivers are supposed to report
      they need stable writes. To fix this I set the appropriate flag at queue
      initialization if CRC checksumming is enabled for that SPI host.
      
      [1]
      https://groups.google.com/forum/#!msg/sim1/gLlzWeXGFr8/KevXinUXfc8JSigned-off-by: NAndreas Koop <andreas.koop@zf.com>
      [shihpo: Rebase on top of v5.3-rc1]
      Signed-off-by: NShihPo Hung <shihpo.hung@sifive.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      CC: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      3a6ffb3c
  11. 10 7月, 2019 7 次提交
  12. 20 6月, 2019 1 次提交
  13. 19 6月, 2019 1 次提交
  14. 18 6月, 2019 3 次提交
    • U
      mmc: core: Prevent processing SDIO IRQs when the card is suspended · 83293386
      Ulf Hansson 提交于
      Processing of SDIO IRQs must obviously be prevented while the card is
      system suspended, otherwise we may end up trying to communicate with an
      uninitialized SDIO card.
      
      Reports throughout the years shows that this is not only a theoretical
      problem, but a real issue. So, let's finally fix this problem, by keeping
      track of the state for the card and bail out before processing the SDIO
      IRQ, in case the card is suspended.
      
      Cc: stable@vger.kernel.org
      Reported-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      83293386
    • D
      mmc: core: Add sdio_retune_hold_now() and sdio_retune_release() · b4c9f938
      Douglas Anderson 提交于
      We want SDIO drivers to be able to temporarily stop retuning when the
      driver knows that the SDIO card is not in a state where retuning will
      work (maybe because the card is asleep).  We'll move the relevant
      functions to a place where drivers can call them.
      
      Cc: stable@vger.kernel.org #v4.18+
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b4c9f938
    • D
      mmc: core: API to temporarily disable retuning for SDIO CRC errors · 0a55f4ab
      Douglas Anderson 提交于
      Normally when the MMC core sees an "-EILSEQ" error returned by a host
      controller then it will trigger a retuning of the card.  This is
      generally a good idea.
      
      However, if a command is expected to sometimes cause transfer errors
      then these transfer errors shouldn't cause a re-tuning.  This
      re-tuning will be a needless waste of time.  One example case where a
      transfer is expected to cause errors is when transitioning between
      idle (sometimes referred to as "sleep" in Broadcom code) and active
      state on certain Broadcom WiFi SDIO cards.  Specifically if the card
      was already transitioning between states when the command was sent it
      could cause an error on the SDIO bus.
      
      Let's add an API that the SDIO function drivers can call that will
      temporarily disable the auto-tuning functionality.  Then we can add a
      call to this in the Broadcom WiFi driver and any other driver that
      might have similar needs.
      
      NOTE: this makes the assumption that the card is already tuned well
      enough that it's OK to disable the auto-retuning during one of these
      error-prone situations.  Presumably the driver code performing the
      error-prone transfer knows how to recover / retry from errors.  ...and
      after we can get back to a state where transfers are no longer
      error-prone then we can enable the auto-retuning again.  If we truly
      find ourselves in a case where the card needs to be retuned sometimes
      to handle one of these error-prone transfers then we can always try a
      few transfers first without auto-retuning and then re-try with
      auto-retuning if the first few fail.
      
      Without this change on rk3288-veyron-minnie I periodically see this in
      the logs of a machine just sitting there idle:
        dwmmc_rockchip ff0d0000.dwmmc: Successfully tuned phase to XYZ
      
      Cc: stable@vger.kernel.org #v4.18+
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      0a55f4ab
  15. 17 6月, 2019 2 次提交
  16. 06 6月, 2019 1 次提交
  17. 31 5月, 2019 3 次提交
  18. 21 5月, 2019 1 次提交
  19. 06 5月, 2019 2 次提交
    • R
      mmc: core: Fix tag set memory leak · 43d8dabb
      Raul E Rangel 提交于
      The tag set is allocated in mmc_init_queue but never freed. This results
      in a memory leak. This change makes sure we free the tag set when the
      queue is also freed.
      Signed-off-by: NRaul E Rangel <rrangel@chromium.org>
      Reviewed-by: NJens Axboe <axboe@kernel.dk>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Fixes: 81196976 ("mmc: block: Add blk-mq support")
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      43d8dabb
    • R
      mmc: core: Verify SD bus width · 9e4be8d0
      Raul E Rangel 提交于
      The SD Physical Layer Spec says the following: Since the SD Memory Card
      shall support at least the two bus modes 1-bit or 4-bit width, then any SD
      Card shall set at least bits 0 and 2 (SD_BUS_WIDTH="0101").
      
      This change verifies the card has specified a bus width.
      
      AMD SDHC Device 7806 can get into a bad state after a card disconnect
      where anything transferred via the DATA lines will always result in a
      zero filled buffer. Currently the driver will continue without error if
      the HC is in this condition. A block device will be created, but reading
      from it will result in a zero buffer. This makes it seem like the SD
      device has been erased, when in actuality the data is never getting
      copied from the DATA lines to the data buffer.
      
      SCR is the first command in the SD initialization sequence that uses the
      DATA lines. By checking that the response was invalid, we can abort
      mounting the card.
      Reviewed-by: NAvri Altman <avri.altman@wdc.com>
      Signed-off-by: NRaul E Rangel <rrangel@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      9e4be8d0