[PATCH v6 6/8] fsl-dma: use spin_lock_bh to instead of spin_lock_irqsave

Liu Qiang-B32616 B32616 at freescale.com
Tue Aug 7 12:45:45 EST 2012


> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd at arndb.de]
> Sent: Monday, August 06, 2012 7:57 PM
> To: Liu Qiang-B32616
> Cc: linux-crypto at vger.kernel.org; linuxppc-dev at lists.ozlabs.org;
> dan.j.williams at intel.com; linux-kernel at vger.kernel.org;
> dan.j.williams at gmail.com; vinod.koul at intel.com; Phillips Kim-R1AAHA;
> herbert at gondor.hengli.com.au; davem at davemloft.net;
> gregkh at linuxfoundation.org; Li Yang-R58472; Tabi Timur-B04825
> Subject: Re: [PATCH v6 6/8] fsl-dma: use spin_lock_bh to instead of
> spin_lock_irqsave
> 
> On Monday 06 August 2012, qiang.liu at freescale.com wrote:
> >
> > From: Qiang Liu <qiang.liu at freescale.com>
> >
> > The use of spin_lock_irqsave() is a stronger locking mechanism than is
> > required throughout the driver. The minimum locking required should be
> > used instead. Interrupts will be turned off and context will be saved,
> > there is needless to use irqsave.
> >
> > Change all instances of spin_lock_irqsave() to spin_lock_bh().
> > All manipulation of protected fields is done using tasklet context or
> > weaker, which makes spin_lock_bh() the correct choice.
> >
> > Cc: Dan Williams <dan.j.williams at intel.com>
> > Cc: Dan Williams <dan.j.williams at gmail.com>
> > Cc: Vinod Koul <vinod.koul at intel.com>
> > Cc: Li Yang <leoli at freescale.com>
> > Cc: Timur Tabi <timur at freescale.com>
> > Signed-off-by: Qiang Liu <qiang.liu at freescale.com>
> > Acked-by: Ira W. Snyder <iws at ovro.caltech.edu>
> 
> Acked-by: Arnd Bergmann <arnd at arndb.de>
> 
> You could actually change the use of spin_lock_bh inside of the tasklet
> function (dma_do_tasklet) do just spin_lock(), because softirqs are
> already disabled there, but your version is also ok.
Yes, you are right, it will disable softirq.
Thank you very much.




More information about the Linuxppc-dev mailing list