@@ -437,17 +437,18 @@ static void dma_irq_handle_channel(struct imxdma_channel *imxdmac)
437
437
struct imxdma_engine * imxdma = imxdmac -> imxdma ;
438
438
int chno = imxdmac -> channel ;
439
439
struct imxdma_desc * desc ;
440
+ unsigned long flags ;
440
441
441
- spin_lock (& imxdma -> lock );
442
+ spin_lock_irqsave (& imxdma -> lock , flags );
442
443
if (list_empty (& imxdmac -> ld_active )) {
443
- spin_unlock (& imxdma -> lock );
444
+ spin_unlock_irqrestore (& imxdma -> lock , flags );
444
445
goto out ;
445
446
}
446
447
447
448
desc = list_first_entry (& imxdmac -> ld_active ,
448
449
struct imxdma_desc ,
449
450
node );
450
- spin_unlock (& imxdma -> lock );
451
+ spin_unlock_irqrestore (& imxdma -> lock , flags );
451
452
452
453
if (desc -> sg ) {
453
454
u32 tmp ;
@@ -519,15 +520,13 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
519
520
{
520
521
struct imxdma_channel * imxdmac = to_imxdma_chan (d -> desc .chan );
521
522
struct imxdma_engine * imxdma = imxdmac -> imxdma ;
522
- unsigned long flags ;
523
523
int slot = -1 ;
524
524
int i ;
525
525
526
526
/* Configure and enable */
527
527
switch (d -> type ) {
528
528
case IMXDMA_DESC_INTERLEAVED :
529
529
/* Try to get a free 2D slot */
530
- spin_lock_irqsave (& imxdma -> lock , flags );
531
530
for (i = 0 ; i < IMX_DMA_2D_SLOTS ; i ++ ) {
532
531
if ((imxdma -> slots_2d [i ].count > 0 ) &&
533
532
((imxdma -> slots_2d [i ].xsr != d -> x ) ||
@@ -537,10 +536,8 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
537
536
slot = i ;
538
537
break ;
539
538
}
540
- if (slot < 0 ) {
541
- spin_unlock_irqrestore (& imxdma -> lock , flags );
539
+ if (slot < 0 )
542
540
return - EBUSY ;
543
- }
544
541
545
542
imxdma -> slots_2d [slot ].xsr = d -> x ;
546
543
imxdma -> slots_2d [slot ].ysr = d -> y ;
@@ -549,7 +546,6 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
549
546
550
547
imxdmac -> slot_2d = slot ;
551
548
imxdmac -> enabled_2d = true;
552
- spin_unlock_irqrestore (& imxdma -> lock , flags );
553
549
554
550
if (slot == IMX_DMA_2D_SLOT_A ) {
555
551
d -> config_mem &= ~CCR_MSEL_B ;
@@ -625,8 +621,9 @@ static void imxdma_tasklet(unsigned long data)
625
621
struct imxdma_channel * imxdmac = (void * )data ;
626
622
struct imxdma_engine * imxdma = imxdmac -> imxdma ;
627
623
struct imxdma_desc * desc ;
624
+ unsigned long flags ;
628
625
629
- spin_lock (& imxdma -> lock );
626
+ spin_lock_irqsave (& imxdma -> lock , flags );
630
627
631
628
if (list_empty (& imxdmac -> ld_active )) {
632
629
/* Someone might have called terminate all */
@@ -663,7 +660,7 @@ static void imxdma_tasklet(unsigned long data)
663
660
__func__ , imxdmac -> channel );
664
661
}
665
662
out :
666
- spin_unlock (& imxdma -> lock );
663
+ spin_unlock_irqrestore (& imxdma -> lock , flags );
667
664
}
668
665
669
666
static int imxdma_control (struct dma_chan * chan , enum dma_ctrl_cmd cmd ,
0 commit comments