1. 22 4月, 2014 1 次提交
  2. 14 2月, 2014 1 次提交
  3. 14 1月, 2014 1 次提交
  4. 31 10月, 2013 9 次提交
    • U
      mmc: core: Add MMC_CAP_RUNTIME_RESUME to resume at runtime_resume · 4d223782
      Ulf Hansson 提交于
      In some environments it is to prefer to postpone the resume of the card
      device until runtime_resume is being carried out, since it will mean a
      signficant decrease of the total system resume time.
      
      The reason of the decreased resume time is simply because of the actual
      re-initalization of the card, which typically takes hundreds of
      milliseconds, is performed outside the resume sequence and wont thus
      affect it.
      
      For removable card, the detect work tries to re-detect the card to make
      sure it is still present, as a part of that sequence the card will also
      be runtime_resumed and thus also fully resumed.
      
      For a non-removable card, typically a mmc blk request will trigger a
      runtime_resume and thus fully resume the card. This also means the
      first request will likely suffer from an inital latency since the
      re-initialization of the card needs to be performed.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      4d223782
    • U
      mmc: core: Improve runtime PM support during suspend/resume for sd/mmc · 0cb403a2
      Ulf Hansson 提交于
      The card device is considered as in-active after it has been suspended.
      To prevent any further runtime PM requests in suspend state, we then
      disable runtime PM.
      
      After the card device has been resumed, we shall consider it as active,
      like we also do after a probe sequence. When resumed, we can safely
      enable runtime PM again.
      
      This will make sure the PM core can request the card device to go to
      in-active state after a resume has been completed. Previously we had to
      wait for new pm_runtime_get->pm_runtime_put cycle to be executed.
      
      Additionally, once a resume has been carried out, update the last busy
      mark. At the moment this will have no effect but if the PM core will
      respect autosuspend enabled devices, when it directly triggers a
      runtime_suspend from a runtime_idle, it will mean the card device will
      be scheduled for a delayed runtime_suspend instead of done immediately.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      0cb403a2
    • U
      mmc: core: Remove redundant mmc_power_up|off at runtime callbacks · 0cc81a8c
      Ulf Hansson 提交于
      Commit "mmc: core: Push common suspend|resume code into each bus_ops"
      moved the responsibility for doing mmc_power_up|off into each
      suspend/resume bus_ops. When using MMC_CAP_AGGRESSIVE_PM, through the
      runtime callbacks, calls to mmc_power_up|off became redundant.
      
      When removing them, we are also able to remove the calls to
      mmc_claim|release_host, thus simplifing code a bit more.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      0cc81a8c
    • U
      mmc: Don't force card to active state when entering suspend/shutdown · 9ec775f7
      Ulf Hansson 提交于
      By adding a card state that records if it is suspended or resumed, we
      can accept asyncronus suspend/resume requests for the mmc and sd
      bus_ops.
      
      MMC_CAP_AGGRESSIVE_PM, will at request inactivity through the runtime
      bus_ops callbacks, execute a suspend of the the card. In the state were
      this has been done, we can receive a suspend request for the mmc bus,
      which for sd and mmc forced the card to active state by a
      pm_runtime_get_sync. In other words, the card was resumed and then
      immediately suspended again, completely unnecessary.
      
      Since the suspend/resume bus_ops callbacks for sd and mmc are now
      capable of handling asynchronous requests, we no longer need to force
      the card to active state before executing suspend. Evidently preventing
      the above sequence for MMC_CAP_AGGRESSIVE_PM.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      9ec775f7
    • U
      mmc: core: Collect common code for card ocr validation · 726d6f23
      Ulf Hansson 提交于
      Since mmc_select_voltage now only gets called from the attach sequence,
      it makes sense to move the out of spec validations of the card ocr into
      this function.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      726d6f23
    • U
      mmc: core: Prevent violation of specs while initializing cards · ce69d37b
      Ulf Hansson 提交于
      According to eMMC/SD/SDIO specs, the VDD (VCC) voltage level must be
      maintained during the initialization sequence. If we want/need to tune
      the voltage level, a complete power cycle of the card must be executed.
      
      Most host drivers conforms to the specifications by only allowing to
      change VDD voltage level at the MMC_POWER_UP state, but some also cares
      about MMC_POWER_ON state, which they should'nt. This patch will not
      break those drivers, but they could clean up code to better reflect
      what is expected from the protocol layer.
      
      A big re-work of the mmc_select_voltage function is done to only change
      VDD voltage level if the host supports MMC_CAP2_FULL_PWR_CYCLE.
      Otherwise only validation of the host and card ocr mask will be done.
      
      A very nice side-effect of this patch is that we now don't need to
      reset the negotiated ocr mask at the mmc_power_off function, since now
      it will actually reflect the present voltage level, which safely can be
      used at the next power up and re-initialization. Moreover, we then only
      need to execute mmc_select_voltage from the attach sequence.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      ce69d37b
    • U
      mmc: core: Move cached value of the negotiated ocr mask to card struct · 69041150
      Ulf Hansson 提交于
      The negotiated ocr mask is directly related to the card. Once a card
      gets removed, the mask shall be dropped. By moving the cache of the ocr
      mask from the host struct to the card struct we have accomplished this.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      69041150
    • U
      mmc: core: Let mmc_set_signal_voltage take ocr as parameter · 0f791fda
      Ulf Hansson 提交于
      This is yet another step of restructure code to be able to fixup the
      setup of the negotiated ocr mask.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      0f791fda
    • U
      mmc: core: Let mmc_power_up|cycle take ocr as parameter · 4a065193
      Ulf Hansson 提交于
      As a step to fixup the setup of the negotiated ocr mask, we need the
      mmc_power_up|cycle functions to take the ocr as a parameter.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      4a065193
  5. 25 8月, 2013 2 次提交
  6. 28 6月, 2013 2 次提交
  7. 27 5月, 2013 3 次提交
    • U
      mmc: core: Support aggressive power management for (e)MMC/SD · c4d770d7
      Ulf Hansson 提交于
      Aggressive power management is suitable when saving power is
      essential. At request inactivity timeout, aka pm runtime
      autosuspend timeout, the card will be suspended.
      
      Once a new request arrives, the card will be re-initalized and
      thus the first request will suffer from a latency. This latency
      is card-specific, experiments has shown in general that SD-cards
      has quite poor initialization time, around 300ms-1100ms. eMMC is
      not surprisingly far better but still a couple of hundreds of ms
      has been observed.
      
      Except for the request latency, it is important to know that
      suspending the card will also prevent the card from executing
      internal house-keeping operations in idle mode. This could mean
      degradation in performance.
      
      To use this feature make sure the request inactivity timeout is
      chosen carefully. This has not been done as a part of this patch.
      
      Enable this feature by using host cap MMC_CAP_AGGRESSIVE_PM and
      by setting CONFIG_MMC_UNSAFE_RESUME.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      c4d770d7
    • U
      mmc: block: Enable runtime pm for mmc blkdevice · e94cfef6
      Ulf Hansson 提交于
      Once the mmc blkdevice is being probed, runtime pm will be enabled.
      By using runtime autosuspend, the power save operations can be done
      when request inactivity occurs for a certain time. Right now the
      selected timeout value is set to 3 s. Obviously this value will likely
      need to be configurable somehow since it needs to be trimmed depending
      on the power save algorithm.
      
      For SD-combo cards, we are still leaving the enablement of runtime PM
      to the SDIO init sequence since it depends on the capabilities of the
      SDIO func driver.
      
      Moreover, when the blk device is being suspended, we make sure the device
      will be runtime resumed. The reason for doing this is that we want the
      host suspend sequence to be unaware of any runtime power save operations
      done for the card in this phase. Thus it can just handle the suspend as
      the card is fully powered from a runtime perspective.
      
      Finally, this patch prepares to make it possible to move BKOPS handling
      into the runtime callbacks for the mmc bus_ops. Thus IDLE BKOPS can be
      accomplished.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      e94cfef6
    • F
      mmc: core: Only execute tuning for SDR50 and SDR104 · 810e08ee
      Fredrik Soderstedt 提交于
      Only execute tuning for sd and sdio devices that are using
      SDR50 or SDR104.
      
      Make sure clock is hold during tuning for sdio devices.
      Signed-off-by: NFredrik Soderstedt <fredrik.soderstedt@stericsson.com>
      Acked-by: NJohan Rudholm <jrudholm@gmail.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      810e08ee
  8. 25 2月, 2013 4 次提交
    • K
      mmc: sdhci: enhance preset value function · 52983382
      Kevin Liu 提交于
      4d55c5a1 ("mmc: sdhci: enable preset value after uhs initialization")
      added preset value support and enabled it by default during sd card init.
      
      Below are the enhancements introduced by this patch:
      
      1. In current code, preset value is enabled after setting clock finished,
      which means the clock is manually set by driver firstly and then suddenly
      switched to preset value at this point. So the first setting is useless
      and unnecessary. What's more, the first clock setting may differ from the
      preset one.  The better way is enable preset value just after switch to
      UHS mode so the preset value can take effect immediately. So move preset
      value enable from mmc_sd_init_card to sdhci_set_ios which will be called
      during set timing.
      
      2. In current code, preset value is disabled at the beginning of
      mmc_attach_sd.  It's too late since low freq (400khz) should be set in
      mmc_power_up.  So move preset value disable to sdhci_set_ios which will
      be called during power up.
      
      3. host->clock and ios->drv_type should also be updated according to the
      preset value if it's enabled. Current code missed this.
      
      4. This patch also introduce a quirk to disable preset value in case
      preset value doesn't work.
      
      This patch has been verified on sdhci-pxav3 platform with both preset
      enabled and disabled.
      Signed-off-by: NKevin Liu <kliu5@marvell.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      52983382
    • J
      mmc: core: Fixup signal voltage switch · 0797e5f1
      Johan Rudholm 提交于
      When switching SD and SDIO cards from 3.3V to 1.8V signal levels, the
      clock should be gated for 5 ms during the step. After enabling the
      clock, the host should wait for at least 1 ms before checking for
      failure. Failure by the card to switch is indicated by dat[0:3] being
      pulled low. The host should check for this condition and power-cycle
      the card if failure is indicated.
      
      Add a retry mechanism for the SDIO case.
      
      If the voltage switch fails repeatedly, give up and continue the
      initialization using the original voltage.
      
      This patch places a couple of requirements on the host driver:
      
       1) mmc_set_ios with ios.clock = 0 must gate the clock
       2) mmc_power_off must actually cut the power to the card
       3) The card_busy host_ops member must be implemented
      
      if these requirements are not fulfilled, the 1.8V signal voltage switch
      will still be attempted but may not be successful.
      Signed-off-by: NJohan Rudholm <johan.rudholm@stericsson.com>
      Signed-off-by: NKevin Liu <kliu5@marvell.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NWei WANG <wei_wang@realsil.com.cn>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      0797e5f1
    • J
      mmc: core: Break out start_signal_voltage_switch · 567c8903
      Johan Rudholm 提交于
      Allow callers to access the start_signal_voltage_switch host_ops
      member without going through any cmd11 logic. This is mostly a
      preparation for the following signal voltage switch patch.
      
      Also, reset ios.signal_voltage to its original value if
      start_signal_voltage_switch fails.
      Signed-off-by: NJohan Rudholm <johan.rudholm@stericsson.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NWei WANG <wei_wang@realsil.com.cn>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      567c8903
    • J
      3f8a7fab
  9. 23 7月, 2012 3 次提交
    • A
      mmc: core: reset signal voltage on power up · 108ecc4c
      Aaron Lu 提交于
      Add a call to mmc_set_signal_voltage() to set signal voltage to 3.3v in
      mmc_power_up so that we do not need to touch signal voltage setting in
      mmc/sd/sdio init functions and rescan function.
      
      For mmc/sd cards, when doing a suspend/resume cycle, consider the unsafe
      resume case, the card will lose its power and when powered on again, we
      will set signal voltage to 3.3v in mmc_power_up before its resume function
      gets called, which will re-init the card.
      
      And for sdio cards, when doing a suspend/resume cycle, consider the unsafe
      resume case, the card will either lose its power or not depending on if it
      wants to wakeup the host. If power is not maintained, it is the same case as
      mmc/sd cards. If power is maintained, mmc_power_up will not be called and
      the card's signal voltage will remain at the last setting.
      Signed-off-by: NAaron Lu <aaron.lu@amd.com>
      Tested-by: NVenkatraman S <svenkatr@ti.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      108ecc4c
    • A
      mmc: sd: Fix sd current limit setting · 55c4665e
      Aaron Lu 提交于
      Host has different current capabilities at different voltages, we need
      to record these settings seperately. The defined voltages are 1.8/3.0/3.3.
      For other voltages, we do not touch current limit setting.
      
      Before we set the current limit for the sd card, find out the host's
      operating voltage first and then find out the current capabilities of
      the host at that voltage to set the current limit.
      Signed-off-by: NAaron Lu <aaron.lu@amd.com>
      Reviewed-by: NPhilip Rakity <prakity@marvell.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      55c4665e
    • A
      mmc: core: Simplify and fix for SD switch processing · a39ca6ae
      Aaron Lu 提交于
      In mmc_read_switch, just do a one time mode 0 switch command to get the
      support bits information, no need to do multiple times as the support
      bits do not change with different arguments.
      
      And no need to check current limit support bits, as these bits are
      fixed according to the signal voltage. If the signal voltage is 1.8V,
      the support bits would be 0xf and if the signal voltage is 3.3V, the
      support bits would be 0x01. We will check host's ability to set the
      current limit.
      Signed-off-by: NAaron Lu <aaron.lu@amd.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      a39ca6ae
  10. 21 7月, 2012 2 次提交
  11. 06 6月, 2012 1 次提交
  12. 05 3月, 2012 1 次提交
  13. 14 2月, 2012 1 次提交
  14. 13 1月, 2012 1 次提交
  15. 12 1月, 2012 3 次提交
  16. 01 11月, 2011 1 次提交
  17. 27 10月, 2011 4 次提交