Patch "dmaengine: shdma: Fix runtime PM imbalance on error" has been added to the 5.16-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    dmaengine: shdma: Fix runtime PM imbalance on error

to the 5.16-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dmaengine-shdma-fix-runtime-pm-imbalance-on-error.patch
and it can be found in the queue-5.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ca5b90fae047b61a3b28c7fc675d7ca5da89f303
Author: Yongzhi Liu <lyz_cs@xxxxxxxxxx>
Date:   Sat Jan 15 21:34:56 2022 -0800

    dmaengine: shdma: Fix runtime PM imbalance on error
    
    [ Upstream commit 455896c53d5b803733ddd84e1bf8a430644439b6 ]
    
    pm_runtime_get_() increments the runtime PM usage counter even
    when it returns an error code, thus a matching decrement is needed on
    the error handling path to keep the counter balanced.
    
    Signed-off-by: Yongzhi Liu <lyz_cs@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/1642311296-87020-1-git-send-email-lyz_cs@xxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c
index 7f72b3f4cd1ae..19ac95c0098f0 100644
--- a/drivers/dma/sh/shdma-base.c
+++ b/drivers/dma/sh/shdma-base.c
@@ -115,8 +115,10 @@ static dma_cookie_t shdma_tx_submit(struct dma_async_tx_descriptor *tx)
 		ret = pm_runtime_get(schan->dev);
 
 		spin_unlock_irq(&schan->chan_lock);
-		if (ret < 0)
+		if (ret < 0) {
 			dev_err(schan->dev, "%s(): GET = %d\n", __func__, ret);
+			pm_runtime_put(schan->dev);
+		}
 
 		pm_runtime_barrier(schan->dev);
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux