1. 21 7月, 2011 5 次提交
    • J
      mmc: dw_mmc: fix stop when fallen back to PIO · 03e8cb53
      James Hogan 提交于
      There are several situations when dw_mci_submit_data_dma() decides to
      fall back to PIO mode instead of using DMA, due to a short (to avoid
      overhead) or "complex" (e.g. with unaligned buffers) transaction, even
      though host->use_dma is set. However dw_mci_stop_dma() decides whether
      to stop DMA or set the EVENT_XFER_COMPLETE event based on host->use_dma.
      When falling back to PIO mode this results in data timeout errors
      getting missed and the driver locking up.
      
      Therefore add host->using_dma to indicate whether the current
      transaction is using dma or not, and adjust dw_mci_stop_dma() to use
      that instead.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NWill Newton <will.newton@imgtec.com>
      Tested-by: NJaehoon Chung <jh80.chung@samsung.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      03e8cb53
    • J
      mmc: dw_mmc: handle unaligned buffers and sizes · 34b664a2
      James Hogan 提交于
      Update functions for PIO pushing and pulling data to and from the FIFO
      so that they can handle unaligned output buffers and unaligned buffer
      lengths. This makes more of the tests in mmc_test pass.
      
      Unaligned lengths in pulls are handled by reading the full FIFO item,
      and storing the remaining bytes in a small internal buffer (part_buf).
      The next data pull will copy data out of this buffer first before
      accessing the FIFO again. Similarly, for pushes the final bytes that
      don't fill a FIFO item are stored in the part_buf (or sent anyway if
      it's the last transfer), and then the part_buf is included at the
      beginning of the next buffer pushed.
      
      Unaligned buffers in pulls are handled specially if the architecture
      cannot do efficient unaligned accesses, by reading FIFO items into a
      aligned local buffer, and memcpy'ing them into the output buffer, again
      storing any remaining bytes in the internal buffer. Similarly for pushes
      the buffer is memcpy'd into an aligned local buffer then written to the
      FIFO.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NWill Newton <will.newton@imgtec.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      34b664a2
    • J
      mmc: dw_mmc: don't hard code fifo depth, fix usage · b86d8253
      James Hogan 提交于
      The FIFO_DEPTH hardware configuration parameter can be found from the
      power-on value of RX_WMark in the FIFOTH register. This is used to
      initialise the watermarks, but when calculating the number of free fifo
      spaces a preprocessor definition is used which is hard coded to 32.
      
      Fix reading the value out of FIFOTH (the default value in the RX_WMark
      field is FIFO_DEPTH-1 not FIFO_DEPTH). Allow the fifo depth to be
      overriden by platform data (since a bootloader may have changed FIFOTH
      making auto-detection unreliable). Store the fifo_depth for later use.
      Also fix the calculation to find the number of free bytes in the fifo to
      include the fifo depth in the left shift by the data shift, since the
      fifo depth is measured in fifo items not bytes.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NWill Newton <will.newton@imgtec.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      b86d8253
    • J
      mmc: dw_mmc: convert card tasklet to workqueue · 1791b13e
      James Hogan 提交于
      Convert the card insert/remove tasklet to a workqueue, and call the
      setpower platform specific callback without the spinlock held. This
      means neither of the setpower or get_cd callbacks are called from atomic
      context which allows them to sleep.
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Acked-by: NWill Newton <will.newton@imgtec.com>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      1791b13e
    • R
      mmc: Standardize header file inclusion checks. · 100e9186
      Robert P. J. Day 提交于
      Standardize the checks for multiple MMC header file inclusion,
      including adding comments to terminating #endif's, and fixing
      one incorrect comment.
      Signed-off-by: NRobert P. J. Day <rpjday@crashcourse.ca>
      Signed-off-by: NChris Ball <cjb@laptop.org>
      100e9186
  2. 31 3月, 2011 1 次提交
  3. 18 3月, 2011 3 次提交
  4. 16 3月, 2011 1 次提交
  5. 09 1月, 2011 1 次提交