1. 13 2月, 2017 2 次提交
  2. 21 12月, 2016 1 次提交
    • P
      mmc: sd: Meet alignment requirements for raw_ssr DMA · e85baa88
      Paul Burton 提交于
      The mmc_read_ssr() function results in DMA to the raw_ssr member of
      struct mmc_card, which is not guaranteed to be cache line aligned & thus
      might not meet the requirements set out in Documentation/DMA-API.txt:
      
        Warnings:  Memory coherency operates at a granularity called the cache
        line width.  In order for memory mapped by this API to operate
        correctly, the mapped region must begin exactly on a cache line
        boundary and end exactly on one (to prevent two separately mapped
        regions from sharing a single cache line).  Since the cache line size
        may not be known at compile time, the API will not enforce this
        requirement.  Therefore, it is recommended that driver writers who
        don't take special care to determine the cache line size at run time
        only map virtual regions that begin and end on page boundaries (which
        are guaranteed also to be cache line boundaries).
      
      On some systems where DMA is non-coherent this can lead to us losing
      data that shares cache lines with the raw_ssr array.
      
      Fix this by kmalloc'ing a temporary buffer to perform DMA into. kmalloc
      will ensure the buffer is suitably aligned, allowing the DMA to be
      performed without any loss of data.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      Fixes: 5275a652 ("mmc: sd: Export SD Status via “ssr” device attribute")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      e85baa88
  3. 05 12月, 2016 1 次提交
  4. 27 9月, 2016 1 次提交
  5. 25 7月, 2016 2 次提交
  6. 17 3月, 2016 1 次提交
  7. 14 1月, 2016 1 次提交
    • C
      mmc: core: Enable tuning according to the actual timing · e10c3219
      Carlo Caione 提交于
      While in sdhci_execute_tuning() the choice whether or not to enable the
      tuning is done on the actual timing, in the mmc_sdio_init_uhs_card() the
      check is done on the capability of the card.
      
      This difference is causing some issues with some SDIO cards in DDR50
      mode where the CDM19 is wrongly issued.
      
      With this patch we modify the check in both
      mmc_(sd|sdio)_init_uhs_card() functions to take the proper decision
      only according to the actual timing specification.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NCarlo Caione <carlo@endlessm.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      e10c3219
  8. 13 1月, 2016 1 次提交
    • R
      mmc: sd: limit SD card power limit according to cards capabilities · d9812780
      Russell King 提交于
      The SD card specification allows cards to error out a SWITCH command
      where the requested function in a group is not supported.  The spec
      provides for a set of capabilities which indicate which functions are
      supported.
      
      In the case of the power limit, requesting an unsupported power level
      via the SWITCH command fails, resulting in the power level remaining at
      the power-on default of 0.72W, even though the host and card may support
      higher powers levels.
      
      This has been seen with SanDisk 8GB cards, which support the default
      0.72W and 1.44W (200mA and 400mA) in combination with an iMX6 host,
      supporting up to 2.88W (800mA).  This currently causes us to try to set
      a power limit function value of '3' (2.88W) which the card errors out
      on, and thereby causes the power level to remain at 0.72W rather than
      the desired 1.44W.
      
      Arrange to limit the selected current limit by the capabilities reported
      by the card to avoid the SWITCH command failing.  Select the highest
      current limit that the host and card combination support.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Fixes: a39ca6ae ("mmc: core: Simplify and fix for SD switch processing")
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      d9812780
  9. 28 12月, 2015 1 次提交
  10. 22 12月, 2015 1 次提交
  11. 26 10月, 2015 4 次提交
  12. 04 6月, 2015 1 次提交
  13. 01 6月, 2015 6 次提交
  14. 07 3月, 2015 1 次提交
  15. 19 1月, 2015 3 次提交
  16. 24 9月, 2014 1 次提交
  17. 09 9月, 2014 1 次提交
  18. 13 5月, 2014 1 次提交
  19. 22 4月, 2014 1 次提交
  20. 14 2月, 2014 1 次提交
  21. 14 1月, 2014 1 次提交
  22. 31 10月, 2013 7 次提交
    • 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