1. 01 6月, 2015 3 次提交
    • L
      mmc: dw_mmc: Use core to handle absent write protect line · eff8f2f5
      Lars-Peter Clausen 提交于
      Use the new MMC_CAP2_NO_WRITE_PROTECT to let the core handle the case where
      no write protect line is present instead of having custom driver code to
      handle it.
      
      dw_mci_of_get_slot_quirks() is slightly refactored to directly modify the
      mmc_host capabilities instead of returning a quirk mask.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      eff8f2f5
    • L
      mmc: Add support for disabling write-protect detection · 9f6e0bff
      Lars-Peter Clausen 提交于
      It is not uncommon to see systems where there is no physical write-protect
      signal (e.g. when using eMMC or microSD card slots). For some controllers,
      which have a dedicated write-protection detection logic (like SDHCI
      controllers), the get_ro() callback can return bogus data in such a case.
      
      Instead of handling this on a per controller basis this patch adds a new
      capability flag to the MMC core that can be set to specify that the result
      of get_ro() is invalid. When the flag is set the core will not call
      get_ro() and assume that the card is always read-write.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      9f6e0bff
    • A
      mmc: host: Add facility to support re-tuning · dfa13ebb
      Adrian Hunter 提交于
      Currently, there is core support for tuning during
      initialization. There can also be a need to re-tune
      periodically (e.g. sdhci) or to re-tune after the
      host controller is powered off (e.g. after PM
      runtime suspend / resume) or to re-tune in response
      to CRC errors.
      
      The main requirements for re-tuning are:
        - ability to enable / disable re-tuning
        - ability to flag that re-tuning is needed
        - ability to re-tune before any request
        - ability to hold off re-tuning if the card is busy
        - ability to hold off re-tuning if re-tuning is in
        progress
        - ability to run a re-tuning timer
      
      To support those requirements 7 members are added to struct
      mmc_host:
      
        unsigned int		can_retune:1;	/* re-tuning can be used */
        unsigned int		doing_retune:1;	/* re-tuning in progress */
        unsigned int		retune_now:1;   /* do re-tuning at next req */
        int			need_retune;	/* re-tuning is needed */
        int			hold_retune;	/* hold off re-tuning */
        unsigned int		retune_period;  /* re-tuning period in secs */
        struct timer_list	retune_timer;	/* for periodic re-tuning */
      
      need_retune is an integer so it can be set without needing
      synchronization. hold_retune is a integer to allow nesting.
      
      Various simple functions are provided to set / clear those
      variables.
      
      Subsequent patches take those functions into use.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      dfa13ebb
  2. 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
  3. 09 4月, 2015 1 次提交
  4. 08 4月, 2015 1 次提交
  5. 31 3月, 2015 1 次提交
  6. 27 3月, 2015 1 次提交
  7. 23 3月, 2015 3 次提交
  8. 20 3月, 2015 1 次提交
  9. 13 3月, 2015 1 次提交
  10. 06 3月, 2015 1 次提交
  11. 29 1月, 2015 1 次提交
  12. 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
  13. 20 1月, 2015 3 次提交
  14. 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
  15. 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
  16. 07 1月, 2015 1 次提交
  17. 08 12月, 2014 1 次提交
  18. 26 11月, 2014 6 次提交
  19. 10 11月, 2014 5 次提交