RE: [PATCH v6 6/8] fsl-dma: use spin_lock_bh to instead ofspin_lock_irqsave

From: Liu Qiang-B32616
Date: Mon Aug 06 2012 - 22:46:15 EST


> -----Original Message-----
> From: Arnd Bergmann [mailto:arnd@xxxxxxxx]
> Sent: Monday, August 06, 2012 7:57 PM
> To: Liu Qiang-B32616
> Cc: linux-crypto@xxxxxxxxxxxxxxx; linuxppc-dev@xxxxxxxxxxxxxxxx;
> dan.j.williams@xxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> dan.j.williams@xxxxxxxxx; vinod.koul@xxxxxxxxx; Phillips Kim-R1AAHA;
> herbert@xxxxxxxxxxxxxxxxxxxx; davem@xxxxxxxxxxxxx;
> gregkh@xxxxxxxxxxxxxxxxxxx; 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@xxxxxxxxxxxxx wrote:
> >
> > From: Qiang Liu <qiang.liu@xxxxxxxxxxxxx>
> >
> > 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@xxxxxxxxx>
> > Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
> > Cc: Vinod Koul <vinod.koul@xxxxxxxxx>
> > Cc: Li Yang <leoli@xxxxxxxxxxxxx>
> > Cc: Timur Tabi <timur@xxxxxxxxxxxxx>
> > Signed-off-by: Qiang Liu <qiang.liu@xxxxxxxxxxxxx>
> > Acked-by: Ira W. Snyder <iws@xxxxxxxxxxxxxxxx>
>
> Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
>
> 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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/