1. 05 12月, 2014 1 次提交
  2. 04 12月, 2014 1 次提交
  3. 05 11月, 2014 1 次提交
    • K
      mmc: core: fix card detection regression · a31b0c6c
      Kristina Martsenko 提交于
      Since commit 89168b48 ("mmc: core: restore detect line inversion
      semantics"), the SD card on i.MX28 (and possibly other) devices isn't
      detected and booting stops at:
      
      [    4.120617] Waiting for root device /dev/mmcblk0p3...
      
      This is caused by the MMC_CAP2_CD_ACTIVE_HIGH flag being set incorrectly
      when the host controller doesn't use a GPIO for card detection (but
      instead uses a dedicated pin). In this case mmc_gpiod_request_cd() will
      return before assigning to the gpio_invert variable, leaving the
      variable uninitialized. The variable then gets used to set the flag.
      This patch fixes the issue by making sure gpio_invert is set to false
      when a GPIO isn't used. After this patch, i.MX28 boots fine.
      
      The MMC_CAP2_RO_ACTIVE_HIGH (write protect) flag is also set incorrectly
      for the exact same reason (it uses the same uninitialized variable), so
      this patch fixes that too.
      
      Fixes: 89168b48 ("mmc: core: restore detect line inversion semantics")
      Reported-by: NStefan Wahren <stefan.wahren@i2se.com>
      Signed-off-by: NKristina Martšenko <kristina.martsenko@gmail.com>
      Tested-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      a31b0c6c
  4. 06 10月, 2014 3 次提交
  5. 05 10月, 2014 1 次提交
    • M
      block: disable entropy contributions for nonrot devices · b277da0a
      Mike Snitzer 提交于
      Clear QUEUE_FLAG_ADD_RANDOM in all block drivers that set
      QUEUE_FLAG_NONROT.
      
      Historically, all block devices have automatically made entropy
      contributions.  But as previously stated in commit e2e1a148 ("block: add
      sysfs knob for turning off disk entropy contributions"):
          - On SSD disks, the completion times aren't as random as they
            are for rotational drives. So it's questionable whether they
            should contribute to the random pool in the first place.
          - Calling add_disk_randomness() has a lot of overhead.
      
      There are more reliable sources for randomness than non-rotational block
      devices.  From a security perspective it is better to err on the side of
      caution than to allow entropy contributions from unreliable "random"
      sources.
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      b277da0a
  6. 03 10月, 2014 8 次提交
  7. 02 10月, 2014 1 次提交
  8. 30 9月, 2014 1 次提交
  9. 29 9月, 2014 3 次提交
  10. 24 9月, 2014 6 次提交
  11. 23 9月, 2014 3 次提交
    • S
      mmc: Consolidate emmc tuning blocks · 48d11e06
      Stephen Boyd 提交于
      The same tuning block exists in the dw_mmc h.c and sdhci-msm.c
      files. Move these into mmc.c so that they can be shared across
      drivers.
      Reported-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      48d11e06
    • S
      mmc: sdhci-msm: Make tuning block table endian agnostic · ffed1b94
      Stephen Boyd 提交于
      If we're tuning on a big-endian CPU we'll never determine we properly
      tuned the device because we compare the data we received from the
      controller with a table that assumes the CPU is little-endian.
      Change the table to be an array of bytes instead of 32-bit words
      so we can use memcmp() without needing to byte-swap every word
      depending on the endianess of the CPU.
      
      Cc: Asutosh Das <asutoshd@codeaurora.org>
      Cc: Venkat Gopalakrishnan <venkatg@codeaurora.org>
      Reviewed-by: NGeorgi Djakov <gdjakov@mm-sol.com>
      Fixes: 415b5a75 "mmc: sdhci-msm: Add platform_execute_tuning implementation"
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      ffed1b94
    • S
      mmc: don't request CD IRQ until mmc_start_host() · d4d11449
      Stephen Warren 提交于
      As soon as the CD IRQ is requested, it can trigger, since it's an
      externally controlled event. If it does, delayed_work host->detect will
      be scheduled.
      
      Many host controller probe()s are roughly structured as:
      
      *_probe() {
          host = sdhci_pltfm_init();
          mmc_of_parse(host->mmc);
          rc = sdhci_add_host(host);
          if (rc) {
              sdhci_pltfm_free();
              return rc;
          }
      
      In 3.17, CD IRQs can are enabled quite early via *_probe() ->
      mmc_of_parse() -> mmc_gpio_request_cd() -> mmc_gpiod_request_cd_irq().
      
      Note that in linux-next, mmc_of_parse() calls mmc_gpio*d*_request_cd()
      rather than mmc_gpio_request_cd(), and mmc_gpio*d*_request_cd() doesn't
      call mmc_gpiod_request_cd_irq(). However, this issue still exists if
      mmc_gpio_request_cd() is called directly before mmc_start_host().
      
      sdhci_add_host() may fail part way through (e.g. due to deferred
      probe for a vmmc regulator), and sdhci_pltfm_free() does nothing to
      unrequest the CD IRQ nor cancel the delayed_work. sdhci_pltfm_free() is
      coded to assume that if sdhci_add_host() failed, then the delayed_work
      cannot (or should not) have been triggered.
      
      This can lead to the following with CONFIG_DEBUG_OBJECTS_* enabled, when
      kfree(host) is eventually called inside sdhci_pltfm_free():
      
      WARNING: CPU: 2 PID: 6 at lib/debugobjects.c:263 debug_print_object+0x8c/0xb4()
      ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x18
      
      The object being complained about is host->detect.
      
      There's no need to request the CD IRQ so early; mmc_start_host() already
      requests it. For most SDHCI hosts at least, the typical call path that
      does this is: *_probe() -> sdhci_add_host() -> mmc_add_host() ->
      mmc_start_host(). Therefore, remove the call to mmc_gpiod_request_cd_irq()
      from mmc_gpio_request_cd(). This also matches mmc_gpio*d*_request_cd(),
      which already doesn't call mmc_gpiod_request_cd_irq().
      
      However, some host controller drivers call mmc_gpio_request_cd() after
      mmc_start_host() has already been called, and assume that this will also
      call mmc_gpiod_request_cd_irq(). Update those drivers to explicitly call
      mmc_gpiod_request_cd_irq() themselves. Ideally, these drivers should be
      modified to move their call to mmc_gpio_request_cd() before their call
      to mmc_add_host(). However that's too large a change for stable.
      
      This solves the problem (eliminates the kernel error message above),
      since it guarantees that the IRQ can't trigger before mmc_start_host()
      is called.
      
      The critical point here is that once sdhci_add_host() calls
      mmc_add_host() -> mmc_start_host(), sdhci_add_host() is coded not to
      fail. In other words, if there's a chance that mmc_start_host() may have
      been called, and CD IRQs triggered, and the delayed_work scheduled,
      sdhci_add_host() won't fail, and so cleanup is no longer via
      sdhci_pltfm_free() (which doesn't free the IRQ or cancel the work queue)
      but instead must be via sdhci_remove_host(), which calls mmc_remove_host()
      -> mmc_stop_host(), which does free the IRQ and cancel the work queue.
      
      CC: Russell King <linux@arm.linux.org.uk>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexandre Courbot <acourbot@nvidia.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: <stable@vger.kernel.org> # v3.15+
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      d4d11449
  12. 22 9月, 2014 1 次提交
  13. 20 9月, 2014 2 次提交
  14. 19 9月, 2014 5 次提交
  15. 10 9月, 2014 3 次提交