Skip to content
  1. Nov 14, 2017
  2. Nov 08, 2017
  3. Nov 02, 2017
  4. Oct 31, 2017
  5. Oct 24, 2017
  6. Oct 23, 2017
  7. Oct 20, 2017
    • Alexander Kochetkov's avatar
      dmaengine: pl330: fix descriptor allocation fail · e5887103
      Alexander Kochetkov authored
      
      
      If two concurrent threads call pl330_get_desc() when DMAC descriptor
      pool is empty it is possible that allocation for one of threads will fail
      with message:
      
      kernel: dma-pl330 20078000.dma-controller: pl330_get_desc:2469 ALERT!
      
      Here how that can happen. Thread A calls pl330_get_desc() to get
      descriptor. If DMAC descriptor pool is empty pl330_get_desc() allocates
      new descriptor on shared pool using add_desc() and then get newly
      allocated descriptor using pluck_desc(). At the same time thread B calls
      pluck_desc() and take newly allocated descriptor. In that case descriptor
      allocation for thread A will fail.
      
      Using on-stack pool for new descriptor allow avoid the issue described.
      The patch modify pl330_get_desc() to use on-stack pool for allocation
      new descriptors.
      
      Signed-off-by: default avatarAlexander Kochetkov <al.kochet@gmail.com>
      Tested-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      e5887103
    • Hiroyuki Yokoyama's avatar
      dmaengine: rcar-dmac: use TCRB instead of TCR for residue · 847449f2
      Hiroyuki Yokoyama authored
      SYS/RT/Audio DMAC includes independent data buffers for reading
      and writing. Therefore, the read transfer counter and write transfer
      counter have different values.
      TCR indicates read counter, and TCRB indicates write counter.
      The relationship is like below.
      
              TCR       TCRB
      [SOURCE] -> [DMAC] -> [SINK]
      
      In the MEM_TO_DEV direction, what really matters is how much data has
      been written to the device. If the DMA is interrupted between read and
      write, then, the data doesn't end up in the destination, so shouldn't
      be counted. TCRB is thus the register we should use in this cases.
      
      In the DEV_TO_MEM direction, the situation is more complex. Both the
      read and write side are important. What matters from a data consumer
      point of view is how much data has been written to memory.
      On the other hand, if the transfer is interrupted between read and
      write, we'll end up losing data. It can also be important to report.
      
      In the MEM_TO_MEM direction, what matters is of course how much data
      has been written to memory from data consumer point of view.
      Here, because read and write have independent data buffers, it will
      take a while for TCR and TCRB to become equal. Thus we should check
      TCRB in this case, too.
      
      Thus, all cases we should check TCRB instead of TCR.
      
      Without this patch, Sound Capture has noise after PluseAudio support
      (= 07b7acb5
      
       ("ASoC: rsnd: update pointer more accurate")), because
      the recorder will use wrong residue counter which indicates transferred
      from sound device, but in reality the data was not yet put to memory
      and recorder will record it.
      
      Signed-off-by: default avatarHiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
      [Kuninori: added detail information in log]
      Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
      847449f2
  8. Oct 16, 2017