1. 16 Jun, 2015 4 commits
    • Ding Wang's avatar
      mmc: card: Fixup request missing in mmc_blk_issue_rw_rq · 29535f7b
      Ding Wang authored
      The current handler of MMC_BLK_CMD_ERR in mmc_blk_issue_rw_rq function
      may cause new coming request permanent missing when the ongoing
      request (previoulsy started) complete end.
      
      The problem scenario is as follows:
      (1) Request A is ongoing;
      (2) Request B arrived, and finally mmc_blk_issue_rw_rq() is called;
      (3) Request A encounters the MMC_BLK_CMD_ERR error;
      (4) In the error handling of MMC_BLK_CMD_ERR, suppose mmc_blk_cmd_err()
          end request A completed and return zero. Continue the error handling,
          suppose mmc_blk_reset() reset device success;
      (5) Continue the execution, while loop completed because variable ret
          is zero now;
      (6) Finally, mmc_blk_issue_rw_rq() return without processing request B.
      
      The process related to the missing request may wait that IO request
      complete forever, possibly crashing the application or hanging the system.
      
      Fix this issue by starting new request when reset success.
      Signed-off-by: default avatarDing Wang <justin.wang@spreadtrum.com>
      Fixes: 67716327 ("mmc: block: add eMMC hardware reset support")
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      29535f7b
    • Jiri Slaby's avatar
      mmc: sdhci: fix low memory corruption · 62a7f368
      Jiri Slaby authored
      When dma mapping (dma_map_sg) fails in sdhci_pre_dma_transfer, -EINVAL
      is returned. There are 3 callers of sdhci_pre_dma_transfer:
      * sdhci_pre_req and sdhci_adma_table_pre: handle negative return
      * sdhci_prepare_data: handles 0 (error) and "else" (good) only
      
      sdhci_prepare_data is therefore broken. When it receives -EINVAL from
      sdhci_pre_dma_transfer, it assumes 1 sg mapping was mapped. Later,
      this non-existent mapping with address 0 is kmap'ped and written to:
      Corrupted low memory at ffff880000001000 (1000 phys) = 22b7d67df2f6d1cf
      Corrupted low memory at ffff880000001008 (1008 phys) = 63848a5216b7dd95
      Corrupted low memory at ffff880000001010 (1010 phys) = 330eb7ddef39e427
      Corrupted low memory at ffff880000001018 (1018 phys) = 8017ac7295039bda
      Corrupted low memory at ffff880000001020 (1020 phys) = 8ce039eac119074f
      ...
      
      So teach sdhci_prepare_data to understand negative return values from
      sdhci_pre_dma_transfer and disable DMA in that case, as well as for
      zero.
      
      It was introduced in 348487cb (mmc:
      sdhci: use pipeline mmc requests to improve performance). The commit
      seems to be suspicious also by assigning host->sg_count both in
      sdhci_pre_dma_transfer and sdhci_adma_table_pre.
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: stable@vger.kernel.org # 4.0+
      Fixes: 348487cb
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Haibo Chen <haibo.chen@freescale.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      62a7f368
    • Vincent Wan's avatar
      mmc: sdhci-pci: Change AMD SDHCI quirk application scope · b5e97d6e
      Vincent Wan authored
      Change this quirk to apply to AMD Carrizo platform.
      Signed-off-by: default avatarWan ZongShun <Vincent.Wan@amd.com>
      Tested-by: default avatarNath, Arindam <Arindam.Nath@amd.com>
      Tested-by: default avatarRamesh, Ramya <Ramya.Ramesh@amd.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      b5e97d6e
    • Vincent Wan's avatar
      i2c-piix4: Use Macro for AMD CZ SMBus device ID · bcb29994
      Vincent Wan authored
      Change AMD CZ SMBUS device ID from 0x790b to
      use Macro definition
      Signed-off-by: default avatarWan ZongShun <Vincent.Wan@amd.com>
      Acked-by: default avatarWolfram Sang <wsa@the-dreams.de>
      Acked-by: default avatarJean Delvare <jdelvare@suse.de>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      bcb29994
  2. 15 Jun, 2015 2 commits
  3. 12 Jun, 2015 1 commit
  4. 08 Jun, 2015 1 commit
    • Ulf Hansson's avatar
      mmc: sdhci: Restore behavior while creating OCR mask · 5fd26c7e
      Ulf Hansson authored
      Commit 3a48edc4 ("mmc: sdhci: Use mmc core regulator infrastucture")
      changed the behavior for how to assign the ocr_avail mask for the mmc
      host. More precisely it started to mask the bits instead of assigning
      them.
      
      Restore the behavior, but also make it clear that an OCR mask created
      from an external regulator overrides the other ones. The OCR mask is
      determined by one of the following with this priority:
      
      1. Supported ranges of external regulator if one supplies VDD
      2. Host OCR mask if set by the driver (based on DT properties)
      3. The capabilities reported by the controller itself
      
      Fixes: 3a48edc4 ("mmc: sdhci: Use mmc core regulator infrastucture")
      Cc: Tim Kryger <tim.kryger@gmail.com>
      Reported-by: default avatarYangbo Lu <yangbo.lu@freescale.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: default avatarTim Kryger <tim.kryger@gmail.com>
      5fd26c7e
  5. 04 Jun, 2015 4 commits
  6. 01 Jun, 2015 28 commits