1. 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
  2. 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
  3. 28 12月, 2015 2 次提交
    • A
      mmc: It is not an error for the card to be removed while suspended · 520322d9
      Adrian Hunter 提交于
      A card can be removed while it is runtime suspended.
      Do not print an error message.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      520322d9
    • U
      mmc: core: Optimize boot time by detecting cards simultaneously · 520bd7a8
      Ulf Hansson 提交于
      The mmc workqueue is an ordered workqueue, allowing only one work to
      execute per given time. As this workqueue is used for card detection, the
      conseqeunce is that cards will be detected one by one waiting for each
      other.
      
      Moreover, most of the time spent during card initialization is waiting for
      the card's internal firmware to be ready. From a CPU perspective this
      typically means waiting for a completion variable to be kicked via an
      IRQ-handler or waiting for a sleep timer to finish.
      
      This behaviour of detecting/initializing cards is sub-optimal, especially
      for SOCs having several controllers/cards.
      
      Let's convert to use the system_freezable_wq for the mmc detect works.
      This enables several works to be executed simultaneously and thus also
      cards to be detected like so.
      
      Tests on UX500, which holds two eMMC cards and an SD-card (actually also
      an SDIO card, currently not detected), shows a significant improved
      behaviour due to this change.
      
      Before this change, both the eMMC cards waited for the SD card to be
      initialized as its detect work entered the workqueue first. In some cases,
      depending on the characteristic of the SD-card, they got delayed 1-1.5 s.
      
      Additionally for the second eMMC, it needed to wait for the first eMMC to
      be initialized which added another 120-190 ms.
      
      Converting to the system_freezable_wq, removed these delays and made both
      the eMMC cards available far earlier in the boot sequence.
      
      Selecting the system_freezable_wq, in favour of for example the system_wq,
      is because we need card detection mechanism to be disabled once userspace
      are frozen during system PM. Currently the mmc core deal with this via PM
      notifiers, but following patches may utilize the behaviour of the
      system_freezable_wq, to simplify the use of the PM notifiers.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NAlan Cooper <alcooperx@gmail.com>
      Tested-by: NShawn Lin <shawn.lin@rock-chips.com>
      520bd7a8
  4. 22 12月, 2015 14 次提交
  5. 09 11月, 2015 4 次提交
    • A
      mmc: mmc: Improve reliability of mmc_select_hs400() · d2302933
      Adrian Hunter 提交于
      mmc_select_hs400() calls __mmc_switch() which checks the switch is
      successful using CMD13 (SEND_STATUS).  The problem is that it does that
      using the timing settings of the previous mode.  That is prone to error,
      especially when switching from HS to HS400 because the timing parameters
      for HS mode are tighter than the timing parameters for HS400 mode.
      
      In the case when CMD13 polling is used (i.e. not MMC_CAP_WAIT_WHILE_BUSY)
      with the switch command, it must be assumed that using different modes on
      the card and host must work.
      
      However in the case when CMD13 polling is not used
      (i.e. MMC_CAP_WAIT_WHILE_BUSY) mmc_select_hs400() can be made more
      reliable by setting the host to the correct timing before sending CMD13.
      
      This patch does that.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: <stable@vger.kernel.org> # 4.2+
      Tested-by: NAlim Akhtar <alim.akhtar@samsung.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      d2302933
    • A
      mmc: mmc: Move mmc_switch_status() · 974007aa
      Adrian Hunter 提交于
      Move the mmc_switch_status() function in preparation for calling it
      in mmc_select_hs400().
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: <stable@vger.kernel.org> # 4.2+
      Tested-by: NAlim Akhtar <alim.akhtar@samsung.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      974007aa
    • A
      mmc: mmc: Fix HS setting in mmc_select_hs400() · 51b12f77
      Adrian Hunter 提交于
      mmc_select_hs400() begins with the card and host in HS200 mode.
      Therefore, any commands sent to the card should use HS200 timing.
      It is incorrect to set the host to High Speed (HS) timing before
      sending the switch command.  Doing so is unreliable because
      the timing parameters for HS mode are tighter than the timing
      parameters for HS200 mode.  Thus the HS timings should be set
      only after the card has switched mode.
      
      However, it is not unreasonable first to reduce the frequency to
      the HS mode frequency, which should make the switch command and
      subsequent CMD13 commands more reliable.
      
      This patch does that.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: <stable@vger.kernel.org> # 4.2+
      Tested-by: NAlim Akhtar <alim.akhtar@samsung.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      51b12f77
    • A
      mmc: mmc: Improve reliability of mmc_select_hs200() · 1815e61b
      Adrian Hunter 提交于
      Currently mmc_select_hs200() uses __mmc_switch() which checks the
      success of the switch to HS200 mode using CMD13 (SEND_STATUS).
      The problem is that it does that using the timing settings of legacy
      mode.  That is prone to error, not least because the timing parameters
      for legacy mode are tighter than the timing parameters for HS200 mode.
      
      In the case when CMD13 polling is used (i.e. not MMC_CAP_WAIT_WHILE_BUSY)
      with the switch command, it must be assumed that using different modes on
      the card and host must work.
      
      However in the case when CMD13 polling is not used
      (i.e. MMC_CAP_WAIT_WHILE_BUSY) mmc_select_hs200() can be made more
      reliable by setting the host to the correct timing before sending CMD13.
      
      This patch does that.
      
      A complication is that the caller, mmc_select_timing(), will ignore a
      switch error (indicated by -EBADMSG), assume the old mode is valid
      and continue, so the old timing must be restored in that case.
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: <stable@vger.kernel.org> # 4.2+
      Tested-by: NAlim Akhtar <alim.akhtar@samsung.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      1815e61b
  6. 27 10月, 2015 3 次提交
  7. 26 10月, 2015 14 次提交
  8. 21 10月, 2015 1 次提交