1. 27 8月, 2015 1 次提交
  2. 17 8月, 2015 5 次提交
    • A
      mmc: dw_mmc: add quirk for broken data transfer over scheme · 57e10486
      Addy Ke 提交于
      This patch add a new quirk to add a s/w timer to notify the driver
      to terminate current transfer and report a data timeout to the core,
      if DTO interrupt does NOT come within the given time.
      
      dw_mmc call mmc_request_done func to finish transfer depends on
      DTO interrupt. If DTO interrupt does not come in sending data state,
      the current transfer will be blocked.
      
      We got the reply from synopsys:
      There are two counters but both use the same value of [31:8] bits.
      Data timeout counter doesn't wait for stop clock and you should get
      DRTO even when the clock is not stopped.
      Host Starvation timeout counter is triggered with stop clock condition.
      
      This means that host should get DRTO and DTO interrupt.
      
      But this case really exists, when driver reads tuning data from
      card on RK3288-pink2 board. I measured waveforms by oscilloscope
      and found that card clock was always on and data lines were always
      holded high level in sending data state.
      
      There are two possibility that data over interrupt doesn't come in
      reading data state on RK3X SoCs:
      - get command done interrupt, but doesn't get any data-related interrupt.
      - get data error interrupt, but doesn't get data over interrupt.
      Signed-off-by: NAddy Ke <addy.ke@rock-chips.com>
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com>
      57e10486
    • J
      mmc: dw_mmc: remove the unused blk_setting · 2b708df2
      Jaehoon Chung 提交于
      "blk_setting" doesn't use anywhere.
      Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com>
      2b708df2
    • H
      mmc: dw_mmc: fix pio mode when internal dmac is enabled · 575c319d
      Heiko Stuebner 提交于
      The dw_mci_init_dma() may decide to not use dma, but pio instead, caused
      by things like wrong dma settings in the system.
      
      Till now the code dw_mci_init_slot() always assumed that dma is available
      when CONFIG_MMC_DW_IDMAC was defined, ignoring the host->use_dma var
      set during dma init.
      
      So when now the dma init failed for whatever reason, the transfer sizes
      would still be set for dma transfers, especially including the maximum
      block-count calculated from host->ring_size and resulting in a
      
      [    4.991109] ------------[ cut here ]------------
      [    4.991111] kernel BUG at drivers/mmc/core/core.c:256!
      [    4.991113] Internal error: Oops - BUG: 0 [#1] SMP ARM
      
      because host->ring_size is 0 in this case and the slot init code uses
      the wrong code to calculate the values.
      
      Fix this by selecting the correct calculations using the host->use_dma
      variable instead of the CONFIG_MMC_DW_IDMAC config option.
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com>
      575c319d
    • Y
      mmc: sdio: avoid using NULL sdio_irq_thread pointer · f13e5b9f
      Yangbo Lu 提交于
      For Freescale QorIQ LS1021AQDS board, there is a SDIO interrupt
      in the process of resume without inserting SD adapter because of
      some unknown issue. But the driver doesn't assign sdio_irq_thread
      pointer. This will block the resume of kernel. This patch is used
      to avoid using NULL sdio_irq_thread pointer.
      Signed-off-by: NYangbo Lu <yangbo.lu@freescale.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      f13e5b9f
    • D
      mmc: core: Optimize case for exactly one erase-group budget · 642c28ab
      David Jander 提交于
      In the (not so unlikely) case that the mmc controller timeout budget is
      enough for exactly one erase-group, the simplification of allowing one
      sector has an enormous performance penalty. We optimize this special case
      by introducing a flag that prohibits erase-group boundary crossing, so
      that we can allow trimming more than one sector at a time.
      Signed-off-by: NDavid Jander <david@protonic.nl>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      642c28ab
  3. 18 6月, 2015 1 次提交
  4. 01 6月, 2015 9 次提交
  5. 17 4月, 2015 1 次提交
    • U
      Revert "mmc: core: Convert mmc_driver to device_driver" · 96541bac
      Ulf Hansson 提交于
      This reverts commit 6685ac62 ("mmc: core: Convert mmc_driver to
      device_driver")
      
      The reverted commit went too far in simplifing the device driver parts
      for mmc.
      
      Let's restore the old mmc_driver to enable driver core to sooner
      or later to remove the ->probe(), ->remove() and ->shutdown() callbacks
      from the struct device_driver.
      
      Note that, the old ->suspend|resume() callbacks in the struct
      mmc_driver don't need to be restored, since the mmc block layer has
      converted to the modern system PM ops.
      
      Fixes: 6685ac62 ("mmc: core: Convert mmc_driver to device_driver")
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Acked-by: NJaehoon Chung <jh80.chung@samsung.com>
      96541bac
  6. 09 4月, 2015 1 次提交
  7. 08 4月, 2015 1 次提交
  8. 31 3月, 2015 1 次提交
  9. 27 3月, 2015 1 次提交
  10. 23 3月, 2015 3 次提交
  11. 20 3月, 2015 1 次提交
  12. 13 3月, 2015 1 次提交
  13. 06 3月, 2015 1 次提交
  14. 29 1月, 2015 1 次提交
  15. 28 1月, 2015 1 次提交
    • U
      mmc: core: Initial support for MMC power sequences · 3aa8793f
      Ulf Hansson 提交于
      System on chip designs may specify a specific MMC power sequence. To
      successfully detect an (e)MMC/SD/SDIO card, that power sequence must
      be followed while initializing the card.
      
      To be able to handle these SOC specific power sequences, let's add a
      MMC power sequence interface. It provides the following functions to
      help the mmc core to deal with these power sequences.
      
      mmc_pwrseq_alloc() - Invoked from mmc_of_parse(), to initialize data.
      mmc_pwrseq_pre_power_on()- Invoked in the beginning of mmc_power_up().
      mmc_pwrseq_post_power_on()- Invoked at the end in mmc_power_up().
      mmc_pwrseq_power_off()- Invoked from mmc_power_off().
      mmc_pwrseq_free() - Invoked from mmc_free_host(), to free data.
      
      Each MMC power sequence provider will be responsible to implement a set
      of callbacks. These callbacks mirrors the functions above.
      
      This patch adds the skeleton, following patches will extend the core of
      the MMC power sequence and add support for a specific simple MMC power
      sequence.
      
      Do note, since the mmc_pwrseq_alloc() is invoked from mmc_of_parse(),
      host drivers needs to make use of this API to enable the support for
      MMC power sequences. Moreover the MMC power sequence support depends on
      CONFIG_OF.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reviewed-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      3aa8793f
  16. 20 1月, 2015 3 次提交
  17. 19 1月, 2015 7 次提交
    • N
      mmc: slot-gpio: Allow host driver to provide isr for card-detect interrupts · c7ea834d
      NeilBrown 提交于
      One of the reasons omap_hsmmc doesn't use the slot-gpio library
      is that it has some non-standard functionality in the card-detect
      interrupt service routine.
      
      To make it possible for omap_hsmmc (and maybe others) to be converted
      to use slot-gpio, add 'mmc_gpio_request_cd_isr' which provide an
      alternate isr to be register by the slot-gpio code.
      Signed-off-by: NNeilBrown <neilb@suse.de>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      c7ea834d
    • J
      mmc: core: always check status after reset · 83533ab2
      Johan Rudholm 提交于
      Always check if the card is alive after a successful reset. This allows
      us to remove mmc_hw_reset_check(), leaving mmc_hw_reset() as the only
      card reset interface.
      Signed-off-by: NJohan Rudholm <johanru@axis.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      83533ab2
    • H
      mmc: sdhci: use pipeline mmc requests to improve performance · 348487cb
      Haibo Chen 提交于
      This patch is based on the patches by Per Forlin, Tony Lin and Ryan QIAN.
      
      This patch complete the API 'post_req' and 'pre_req' in sdhci host side,
      
      Test Env:
      1. i.MX6Q-SABREAUTO board, CPU @ 996MHz, use ADMA in uSDHC controller.
      2. Test command:
      		$ echo 1 > /proc/sys/vm/drop_caches
      	write to sd card:
      		$ dd if=/dev/zero of=/dev/mmcblk0 bs=1M count=2000 conv=fsync
      	read the sd card:
      		$ dd if=/dev/mmcblk0 of=/dev/null bs=1M count=2000
      
      3. TOSHIBA 16GB SD3.0 card, running at 4 bit, SDR104 @ 198MHZ
      	Performance with and without this patch:
            -------------------------------------------------
      	  |                    | read speed | write speed |
      	  |------------------------------------------------
      	  | with this patch    | ~76.7 MB/s |  ~23.3 MB/s |
      	  |------------------------------------------------
      	  |without this patch  | ~60.5 MB/s |  ~22.5 MB/s |
      	  -------------------------------------------------
      
      4. SanDisk 8GB SD3.0 card, running at 4 bit, DDR50 @ 50MHZ
      	Performance with and without this patch:
            -------------------------------------------------
      	  |                    | read speed | write speed |
      	  |------------------------------------------------
      	  | with this patch    | ~40.5 MB/s |  ~15.6 MB/s |
      	  |------------------------------------------------
      	  |without this patch  | ~36.1 MB/s |  ~14.1 MB/s |
      	  -------------------------------------------------
      
      5. Kingston 8GB SD2.0 card, running at 4 bit, High-speed @ 50MHZ
      	Performance with and without this patch:
            -------------------------------------------------
      	  |                    | read speed | write speed |
      	  |------------------------------------------------
      	  | with this patch    | ~22.7 MB/s |  ~8.2 MB/s  |
      	  |------------------------------------------------
      	  |without this patch  | ~21.3 MB/s |  ~8.0 MB/s  |
      	  -------------------------------------------------
      
      6. About eMMC, Sandisk 8GB eMMC on i.MX6DL-sabresd board, CPU @ 792MHZ,
         eMMC running at 8 bit, DDR52 @ 52MHZ.
      	Performance with and without this patch:
            -------------------------------------------------
      	  |                    | read speed | write speed |
      	  |------------------------------------------------
      	  | with this patch    | ~37.3 MB/s |  ~10.5 MB/s |
      	  |------------------------------------------------
      	  |without this patch  | ~33.4 MB/s |  ~10.5 MB/s |
      	  -------------------------------------------------
      Signed-off-by: NHaibo Chen <haibo.chen@freescale.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      348487cb
    • U
      mmc: core: Make tuning block patterns static · 04cdbbfa
      Ulf Hansson 提交于
      Since previous patches removed the need for the tuning block patterns
      to be exported, let's move them close to the mmc_send_tuning() API.
      
      Those are now intended to be used only by the mmc core.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NStephen Boyd <sboyd@codeaurora.org>
      Acked-by: NJaehoon Chung <jh80.chung@samsung.com>
      04cdbbfa
    • U
      mmc: slot-gpio: Rework how to handle allocation of slot-gpio data · df8aca16
      Ulf Hansson 提交于
      By moving the allocation of the slot-gpio data into mmc_alloc_host(),
      we can remove the slot-gpio internal calls to mmc_gpio_alloc().
      
      This means mmc_gpio_alloc() has now only one caller left, which
      consequence allow us to simplify and remove some of the slot-gpio code.
      
      Additionally, this makes the slot-gpio mutex redundant, so let's remove
      it.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      df8aca16
    • U
      mmc: slot-gpio: Remove option to explicitly free requested CD/WP GPIOs · eddbc3ab
      Ulf Hansson 提交于
      The slot-gpio uses the devm*_ managed functions. Still it provide APIs
      to explicitly free requested CD/WP GPIOs, but these API isn't being
      used.
      
      Therefore let's simplify slot-gpio by removing these unused APIs. If it
      later turns out we need some of them, we can always consider to restore
      the code.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      eddbc3ab
    • D
      mmc: dw_mmc: Protect read-modify-write of INTMASK with a lock · f8c58c11
      Doug Anderson 提交于
      We're running into cases where our enabling of the SDIO interrupt in
      dw_mmc doesn't actually take effect.  Specifically, adding patch like
      this:
      
       +++ b/drivers/mmc/host/dw_mmc.c
       @@ -1076,6 +1076,9 @@ static void dw_mci_enable_sdio_irq(struct mmc_host *mmc, int enb)
      
            mci_writel(host, INTMASK,
                 (int_mask | SDMMC_INT_SDIO(slot->id)));
       +    int_mask = mci_readl(host, INTMASK);
       +    if (!(int_mask & SDMMC_INT_SDIO(slot->id)))
       +      dev_err(&mmc->class_dev, "failed to enable sdio irq\n");
          } else {
      
      ...actually triggers the error message.  That's because the
      dw_mci_enable_sdio_irq() unsafely does a read-modify-write of the
      INTMASK register.
      
      We can't just use the standard host->lock since that lock is not irq
      safe and mmc_signal_sdio_irq() (called from interrupt context) calls
      dw_mci_enable_sdio_irq().  Add a new irq-safe lock to protect INTMASK.
      
      An alternate solution to this is to punt mmc_signal_sdio_irq() to the
      tasklet and then protect INTMASK modifications by the standard host
      lock.  This seemed like a bit more of a high-latency change.
      Reported-by: NBing Zhao <bzhao@marvell.com>
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Reviewed-by: NJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      f8c58c11
  18. 12 1月, 2015 1 次提交
    • A
      mmc: sdhci: Disable re-tuning for HS400 · b5540ce1
      Adrian Hunter 提交于
      Re-tuning for HS400 mode must be done in HS200
      mode. Currently there is no support for that.
      That needs to be reflected in the code.
      Specifically, if tuning is executed in HS400 mode
      then return an error, and do not start the
      tuning timer if HS200 tuning is being done prior
      to switching to HS400.
      
      Note that periodic re-tuning is not expected
      to be needed for HS400 but re-tuning is still
      needed after the host controller has lost power.
      In the case of suspend/resume that is not necessary
      because the card is fully re-initialised. That
      just leaves runtime suspend/resume with no support
      for HS400 re-tuning.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      b5540ce1