1. 01 7月, 2012 26 次提交
  2. 11 5月, 2012 2 次提交
    • L
      dmaengine: Use dma_sg_len(sg) instead of sg->length · fdaf9c4b
      Lars-Peter Clausen 提交于
      sg->length may or may not contain the length of the dma region to transfer,
      depending on the architecture - dma_sg_len(sg) always will though. For the
      architectures which use the drivers modified by this patch it probably is the
      case that sg->length contains the dma transfer length. But to be consistent and
      future proof change them to use dma_sg_len.
      
      To quote Russel King:
      	sg->length is meaningless to something performing DMA.
      
      	In cases where sg_dma_len(sg) and sg->length are the same storage, then
      	there's no problem. But scatterlists _can_ (and one some architectures) do
      	split them - especially when you have an IOMMU which can allow you to
      	combine a scatterlist into fewer entries.
      
      	So, anything using sg->length for the size of a scatterlist's DMA transfer
      	_after_ a call to dma_map_sg() is almost certainly buggy.
      
      The patch has been generated using the following coccinelle patch:
      <smpl>
      @@
      struct scatterlist *sg;
      expression X;
      @@
      -sg[X].length
      +sg_dma_len(&sg[X])
      @@
      struct scatterlist *sg;
      @@
      -sg->length
      +sg_dma_len(sg)
      </smpl>
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      fdaf9c4b
    • L
      dmaengine: Use sg_dma_address instead of sg_phys · cbb796cc
      Lars-Peter Clausen 提交于
      dmaengine drivers should always use sg_dma_address instead of sg_phys to get the
      addresses for the transfer from a sg element.
      
      To quote Russel King:
      	sg_phys(sg) of course has nothing to do with DMA addresses. It's the
      	physical address _to the CPU_ of the memory associated with the scatterlist
      	entry. That may, or may not have the same value for the DMA engine,
      	particularly if IOMMUs are involved.
      
      	And if these drivers are used on ARM, they must be fixed, sooner rather
      	than later.  There's patches in the works which will mean we will end up
      	with IOMMU support in the DMA mapping later, which means everything I've
      	said above will become reality.
      
      The patch has been generated using the following coccinelle patch:
      <smpl>
      @@
      struct scatterlist *sg;
      @@
      -sg_phys(sg)
      +sg_dma_address(sg)
      </smpl>
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      cbb796cc
  3. 25 4月, 2012 2 次提交
  4. 23 4月, 2012 1 次提交
    • L
      dma/amba-pl08x: check for terminal count status only · d29bf019
      Linus Walleij 提交于
      For some reason I can't figure out we're reading the PL080_INT_STATUS
      register instead of PL080_TC_STATUS when checking for the terminal
      count. The PL080_INT_STATUS is a logical OR between the error and
      terminal count status register and may not report what we want it
      to, especially if there is an error and a terminal count at the same
      time and the former is not lowered in time for the check in the TC
      register. Make sure we read what we're actually interested in.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Viresh Kumar <viresh.kumar@st.com>
      Cc: Alim Akhtar <alim.akhtar@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NViresh Kumar <viresh.kumar@st.com>
      Signed-off-by: NVinod Koul <vinod.koul@linux.intel.com>
      d29bf019
  5. 21 3月, 2012 1 次提交
  6. 13 3月, 2012 6 次提交
  7. 22 2月, 2012 1 次提交
  8. 31 1月, 2012 1 次提交