1. 27 Aug, 2015 24 commits
  2. 24 Aug, 2015 4 commits
  3. 17 Aug, 2015 12 commits
    • Addy Ke's avatar
      mmc: dw_mmc: add quirk for broken data transfer over scheme · 57e10486
      Addy Ke authored
      This patch add a new quirk to add a s/w timer to notify the driver
      to terminate current transfer and report a data timeout to the core,
      if DTO interrupt does NOT come within the given time.
      
      dw_mmc call mmc_request_done func to finish transfer depends on
      DTO interrupt. If DTO interrupt does not come in sending data state,
      the current transfer will be blocked.
      
      We got the reply from synopsys:
      There are two counters but both use the same value of [31:8] bits.
      Data timeout counter doesn't wait for stop clock and you should get
      DRTO even when the clock is not stopped.
      Host Starvation timeout counter is triggered with stop clock condition.
      
      This means that host should get DRTO and DTO interrupt.
      
      But this case really exists, when driver reads tuning data from
      card on RK3288-pink2 board. I measured waveforms by oscilloscope
      and found that card clock was always on and data lines were always
      holded high level in sending data state.
      
      There are two possibility that data over interrupt doesn't come in
      reading data state on RK3X SoCs:
      - get command done interrupt, but doesn't get any data-related interrupt.
      - get data error interrupt, but doesn't get data over interrupt.
      Signed-off-by: default avatarAddy Ke <addy.ke@rock-chips.com>
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
      57e10486
    • Jaehoon Chung's avatar
      mmc: dw_mmc: print the message for deprecated property · 40a7a463
      Jaehoon Chung authored
      supports-highspeed was deprecated.
      If someone use it, we need to notice information for it.
      Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
      40a7a463
    • Jaehoon Chung's avatar
      mmc: dw_mmc: remove the unused blk_setting · 2b708df2
      Jaehoon Chung authored
      "blk_setting" doesn't use anywhere.
      Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
      2b708df2
    • Jaehoon Chung's avatar
      mmc: dw_mmc: fix the wrong condition checking · 9e747b7e
      Jaehoon Chung authored
      When num-slots is lower than 1, it's right that should be returned -ENODEV.
      Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
      9e747b7e
    • Heiko Stuebner's avatar
      mmc: dw_mmc: fix pio mode when internal dmac is enabled · 575c319d
      Heiko Stuebner authored
      The dw_mci_init_dma() may decide to not use dma, but pio instead, caused
      by things like wrong dma settings in the system.
      
      Till now the code dw_mci_init_slot() always assumed that dma is available
      when CONFIG_MMC_DW_IDMAC was defined, ignoring the host->use_dma var
      set during dma init.
      
      So when now the dma init failed for whatever reason, the transfer sizes
      would still be set for dma transfers, especially including the maximum
      block-count calculated from host->ring_size and resulting in a
      
      [    4.991109] ------------[ cut here ]------------
      [    4.991111] kernel BUG at drivers/mmc/core/core.c:256!
      [    4.991113] Internal error: Oops - BUG: 0 [#1] SMP ARM
      
      because host->ring_size is 0 in this case and the slot init code uses
      the wrong code to calculate the values.
      
      Fix this by selecting the correct calculations using the host->use_dma
      variable instead of the CONFIG_MMC_DW_IDMAC config option.
      Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
      575c319d
    • Shawn Lin's avatar
      mmc: dw_mmc: Fix coding style issues · 0e3a22c0
      Shawn Lin authored
      This patch fixes the following issues reported by checkpatch.pl:
      - use -EINVAL instead of -ENOSYS, to fix warning message:
         "ENOSYS means 'invalid syscall nr' and nothing else"
      - split lines whose length is greater than 80 characters
      - avoid quoted string split across lines
      - use min_t instead of min, to fix warning message:
         "min() should probably be min_t(int, cnt, host->part_buf_count)"
      - fix missing a blank line after declarations
      Signed-off-by: default avatarShawn Lin <shawn.lin@rock-chips.com>
      Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
      0e3a22c0
    • Alexey Brodkin's avatar
      mmc: dw_mmc: handle data blocks > than 4kB if IDMAC is used · 5959b32e
      Alexey Brodkin authored
      As per DW MobileStorage databook "each descriptor can transfer up to 4kB
      of data in chained mode", moreover buffer size that is put in "des1" is
      limited to 13 bits, i.e. for example on attempt to
      IDMAC_SET_BUFFER1_SIZE(desc, 8192) size value that's effectively written
      will be 0.
      
      On the platform with 8kB PAGE_SIZE I see dw_mmc gets data blocks in
      SG-list of 8kB size and that leads to unpredictable behavior of the
      SD/MMC controller.
      
      In particular on write to FAT partition of SD-card the controller will
      stuck in the middle of DMA transaction.
      
      Solution to the problem is simple - we need to pass large (> 4kB) data
      buffers to the controller via multiple descriptors. And that's what
      that change does.
      
      What's interesting I did try original driver on same platform but
      configured with 4kB PAGE_SIZE and may confirm that data blocks passed
      in SG-list to dw_mmc never exeed 4kB limit - that explains why nobody
      ever faced a problem I did.
      Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Seungwon Jeon <tgih.jun@samsung.com>
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: arc-linux-dev@synopsys.com
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarJaehoon Chung <jh80.chung@samsung.com>
      5959b32e
    • Yangbo Lu's avatar
      mmc: block: add fixup of broken CMD23 for Sandisk card · 7d70d476
      Yangbo Lu authored
      Some Sandisk cards(such as "SDMB-32" and "SDM032" cards)
      can't support CMD23, and would generate CMD timeout. So add
      FIX-UP for these two types Sandisk cards.
      
      Error log:
      mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
      mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
      mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
      end_request: I/O error, dev mmcblk0, sector 0
      Buffer I/O error on device mmcblk0, logical block 0
      mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900
      Signed-off-by: default avatarYangbo Lu <yangbo.lu@freescale.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      7d70d476
    • Yangbo Lu's avatar
      mmc: sdhci-esdhc: add default quirk SDHCI_QUIRK_NO_HISPD_BIT · 67b589a2
      Yangbo Lu authored
      eSDHC supports high speed mode, but has no enabling bit for it.
      Add this quirk to avoid writing to eSDHC_PROCTL[DTW] by mistake.
      Signed-off-by: default avatarYangbo Lu <yangbo.lu@freescale.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      67b589a2
    • Yangbo Lu's avatar
      mmc: sdio: avoid using NULL sdio_irq_thread pointer · f13e5b9f
      Yangbo Lu authored
      For Freescale QorIQ LS1021AQDS board, there is a SDIO interrupt
      in the process of resume without inserting SD adapter because of
      some unknown issue. But the driver doesn't assign sdio_irq_thread
      pointer. This will block the resume of kernel. This patch is used
      to avoid using NULL sdio_irq_thread pointer.
      Signed-off-by: default avatarYangbo Lu <yangbo.lu@freescale.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      f13e5b9f
    • Andreas Fenkart's avatar
    • Andreas Fenkart's avatar
      mmc: omap_hsmmc: call omap_hsmmc_set_power directly · f7f0f035
      Andreas Fenkart authored
      If no pdata.set_power was set by the platform code, the driver
      was updating pdata with its own fallback function. This is a no-no
      since pdata shall be read-only.
      This patch pushes the check 'pdata->set_power != NULL' down into
      the fallback functions. If pdata.set_power is really set, it calls them
      and exits, otherwise the fallback code is used.
      Signed-off-by: default avatarAndreas Fenkart <afenkart@gmail.com>
      Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      f7f0f035