RE: [PATCH v6 6/8] fsl-dma: use spin_lock_bh to instead of spin_lock_irqsave
From: Liu Qiang-B32616 <hidden>
Date: 2012-08-07 02:46:12
Also in:
linux-crypto, lkml
-----Original Message----- From: Arnd Bergmann [mailto:arnd@arndb.de] Sent: Monday, August 06, 2012 7:57 PM To: Liu Qiang-B32616 Cc: linux-crypto@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; dan.j.williams@intel.com; linux-kernel@vger.kernel.org; dan.j.williams@gmail.com; vinod.koul@intel.com; Phillips Kim-R1AAHA; herbert@gondor.hengli.com.au; davem@davemloft.net; gregkh@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 =20 On Monday 06 August 2012, qiang.liu@freescale.com wrote:quoted
From: Qiang Liu <redacted> 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 <redacted> Cc: Dan Williams <redacted> Cc: Vinod Koul <redacted> Cc: Li Yang <redacted> Cc: Timur Tabi <redacted> Signed-off-by: Qiang Liu <redacted> Acked-by: Ira W. Snyder <redacted>=20 Acked-by: Arnd Bergmann <arnd@arndb.de> =20 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.