1. 16 2月, 2015 1 次提交
  2. 12 2月, 2015 3 次提交
  3. 11 2月, 2015 1 次提交
    • A
      dmaengine: pl330: fix bug that cause start the same descs in cyclic · 0091b9d6
      Addy Ke 提交于
      This bug will cause NULL pointer after commit dfac17, and cause
      wrong package in I2S DMA transfer before commit dfac17.
      
      Tested on RK3288-pinky2 board.
      
      Detail:
      I2S DMA transfer(sound/core/pcm_dmaengine.c):
      dmaengine_pcm_prepare_and_submit -->
      dmaengine_prep_dma_cyclic -->
      pl330_prep_dma_cyclic -->
      the case:
      1. pl330_submit_req(desc0): thrd->req[0].desc = desc0, thrd->lstenq = 0
      2. pl330_submit_req(desc1): thrd->req[1].desc = desc1, thrd->lstenq = 1
      3. _start(desc0) by submit_req: thrd->req_running = 0
         because: idx = 1 - thrd->lstenq = 0
      4. pl330_update(desc0 OK): thrd->req[0].desc = NULL, desc0 to req_done list
         because: idx = active = thrd->req_running = 0
      5. _start(desc1) by pl330_update: thrd->req_running = 1
         because:
         idx = 1 - thrd->lstenq = 0, but thrd->req[0].desc == NULL,
         so:
         idx = thrd->lstenq = 1
      6. pl330_submit_req(desc2): thrd->req[0].desc = desc2, thrd->lstenq = 0
      7. _start(desc1) by submit_req: thrd->req_running = 1
         because: idx = 1 - thrd->lstenq = 1
         Note: _start started the same descs
               _start should start desc2 here, NOT desc1
      
      8. pl330_update(desc1 OK): thrd->req[1].desc = NULL, desc1 to req_done list
         because: idx = active = thrd->req_running = 1
      9. _start(desc2) by pl330_update : thrd->req_running = 0
         because: idx = 1 - thrd->lstenq = 0
      10.pl330_update(desc1 OK, NOT desc2): thrd->req[0].desc = NULL,
         desc2 to req_done list
         because: idx = active = thrd->req_running = 0
      
      11.pl330_submit_req(desc3): thrd->req[0].desc = desc3, thrd->lstenq = 0
      12.pl330_submit_req(desc4): thrd->req[1].desc = desc4, thrd->lstenq = 1
      13._start(desc3) by submit_req: thrd->req_running = 0
         because: idx = 1 - thrd->lstenq = 0
      14.pl330_update(desc2 OK NOT desc3): thrd->req[0].desc = NULL
         desc3 to req_done list
         because: idx = active = thrd->req_running = 0
      15._start(desc4) by pl330_update: thrd->req_running = 1
         because:
         idx = 1 - thrd->lstenq = 0, but thrd->req[0].desc == NULL,
         so:
         idx = thrd->lstenq = 1
      16.pl330_submit_req(desc5): thrd->req[0].desc = desc5, thrd->lstenq = 0
      17._start(desc4) by submit_req: thrd->req_running = 1
         because: idx = 1 - thrd->lstenq = 1
      18.pl330_update(desc3 OK NOT desc4): thrd->req[1].desc = NULL
         desc4 to req_done list
         because: idx = active = thrd->req_running = 1
      19._start(desc4) by pl330_update: thrd->req_running = 0
         because:
         idx = 1 - thrd->lstenq = 1, but thrd->req[1].desc == NULL,
         so:
         idx = thrd->lstenq = 0
      20.pl330_update(desc4 OK): thrd->req[0].desc = NULL, desc5 to req_done list
         because: idx = active = thrd->req_running = 0
      21.pl330_update(desc4 OK):
         1) before commit dfac17(set req_running -1 in pl330_update/mark_free()):
            because: active = -1, abort
            result: desc0-desc5's callback are all called,
      	      but step 10 and step 18 go wrong.
         2) before commit dfac17:
            idx = active = thrd->req_runnig = 0 -->
            descdone = thrd->req[0] = NULL -->
            list_add_tail(&descdone->rqd, &pl330->req_done); -->
            got NULL pointer!!!
      Signed-off-by: NAddy Ke <addy.ke@rock-chips.com>
      Signed-off-by: NVinod Koul <vinod.koul@intel.com>
      0091b9d6
  4. 05 2月, 2015 10 次提交
  5. 04 2月, 2015 1 次提交
  6. 26 1月, 2015 3 次提交
  7. 18 1月, 2015 4 次提交
  8. 14 1月, 2015 11 次提交
  9. 13 1月, 2015 4 次提交
  10. 23 12月, 2014 2 次提交
    • J
      dmaengine: rcar-dmac: Handle hardware descriptor allocation failure · ee4b876b
      Jürg Billeter 提交于
      If the atomic DMA coherent pool is too small, disable use of hardware
      descriptor lists instead of crashing the system:
      
      ERROR: 256 KiB atomic DMA coherent pool is too small!
      Please increase it with coherent_pool= kernel parameter!
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000004
      Internal error: Oops: a07 [#1] PREEMPT SMP ARM
      
      PC is at rcar_dmac_chan_reinit+0x3c/0x160
      LR is at _raw_spin_lock_irqsave+0x18/0x5c
      
      [<802132c0>] (rcar_dmac_chan_reinit) from [<80214818>] (rcar_dmac_isr_error+0x84/0xa0)
      [<80214818>] (rcar_dmac_isr_error) from [<80060484>] (handle_irq_event_percpu+0x50/0x150)
      [<80060484>] (handle_irq_event_percpu) from [<800605c0>] (handle_irq_event+0x3c/0x5c)
      [<800605c0>] (handle_irq_event) from [<8006350c>] (handle_fasteoi_irq+0xb8/0x198)
      [<8006350c>] (handle_fasteoi_irq) from [<8005fdb0>] (generic_handle_irq+0x20/0x30)
      [<8005fdb0>] (generic_handle_irq) from [<8000fcd0>] (handle_IRQ+0x50/0xc4)
      [<8000fcd0>] (handle_IRQ) from [<800092cc>] (gic_handle_irq+0x28/0x5c)
      [<800092cc>] (gic_handle_irq) from [<80012700>] (__irq_svc+0x40/0x70)
      
      Kernel panic - not syncing: Fatal exception in interrupt
      Signed-off-by: NJürg Billeter <j@bitron.ch>
      Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      ee4b876b
    • L
      dmaengine: rcar-dmac: Cache hardware descriptors memory · 1ed1315f
      Laurent Pinchart 提交于
      Unlike DMA transfers descriptors that are preallocated and cached,
      memory used to store hardware descriptors is allocated and freed with
      the DMA coherent allocation API for every transfer. Besides degrading
      performances, this creates a CMA stress test that seems to cause issues.
      Running dmatest with the noverify option produces
      
      [   50.066539] alloc_contig_range test_pages_isolated(6b845, 6b846) failed
      [   50.235180] alloc_contig_range test_pages_isolated(6b848, 6b84e) failed
      [   52.964584] alloc_contig_range test_pages_isolated(6b847, 6b848) failed
      [   54.127113] alloc_contig_range test_pages_isolated(6b843, 6b844) failed
      [   56.270253] alloc_contig_range test_pages_isolated(6b84c, 6b850) failed
      
      The root cause needs to be fixed, but in the meantime, as a workaround
      and a performance improvement, cache hardware descriptors.
      Signed-off-by: NLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Tested-by: NWolfram Sang <wsa+renesas@sang-engineering.com>
      1ed1315f