diff mbox series

[1/2] dmaengine: fsl-edma: Add lockdep assert for exported function

Message ID 1591877861-28156-1-git-send-email-krzk@kernel.org (mailing list archive)
State Accepted
Headers show
Series [1/2] dmaengine: fsl-edma: Add lockdep assert for exported function | expand

Commit Message

Krzysztof Kozlowski June 11, 2020, 12:17 p.m. UTC
Add lockdep assert for an exported function expected to be called under
spin lock.  Since this function is called in different modules, the
lockdep assert will be self-documenting note about need for locking.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/dma/fsl-edma-common.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Robin Gong June 12, 2020, 2:25 a.m. UTC | #1
On 2020/06/11 20:18 Krzysztof Kozlowski <krzk@kernel.org> wrote:
> Add lockdep assert for an exported function expected to be called under spin
> lock.  Since this function is called in different modules, the lockdep assert will
> be self-documenting note about need for locking.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Robin Gong <yibin.gong@nxp.com> 
> ---
>  drivers/dma/fsl-edma-common.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/dma/fsl-edma-common.c
> b/drivers/dma/fsl-edma-common.c index 5697c3622699..4550818cca4a
> 100644
> --- a/drivers/dma/fsl-edma-common.c
> +++ b/drivers/dma/fsl-edma-common.c
> @@ -589,6 +589,8 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan
> *fsl_chan)  {
>  	struct virt_dma_desc *vdesc;
> 
> +	lockdep_assert_held(&fsl_chan->vchan.lock);
> +
>  	vdesc = vchan_next_desc(&fsl_chan->vchan);
>  	if (!vdesc)
>  		return;
> --
> 2.7.4
Vinod Koul June 24, 2020, 7:37 a.m. UTC | #2
On 11-06-20, 14:17, Krzysztof Kozlowski wrote:
> Add lockdep assert for an exported function expected to be called under
> spin lock.  Since this function is called in different modules, the
> lockdep assert will be self-documenting note about need for locking.

Applied all to fixes, thanks
diff mbox series

Patch

diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c
index 5697c3622699..4550818cca4a 100644
--- a/drivers/dma/fsl-edma-common.c
+++ b/drivers/dma/fsl-edma-common.c
@@ -589,6 +589,8 @@  void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan)
 {
 	struct virt_dma_desc *vdesc;
 
+	lockdep_assert_held(&fsl_chan->vchan.lock);
+
 	vdesc = vchan_next_desc(&fsl_chan->vchan);
 	if (!vdesc)
 		return;