From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388964; b=3m8zI46XZPMbIIq24WYtLeNKk9l3hfCVNRWH1m+Z64Qu+2uDOJhswEYec3Hfyx0GmE5C lh2fh/ebsUn4Pr3mYg4WAv1MQZwCJDkQxLS5LHOx+ACjmPdxi9H5vnXids+oVmy8Q32Fs cHjoQ/sQGByG94Gap1d2uu/gxRkPvdUFiM0Mv+Qy15CwbQEiYLH2Pi5Z0i4WJiHxvhA4u PzWhAWNlgq/W3Hd/QgJYYAxHUlKRvEUgHy+DrOTbFJ3mTqxOgAGjbodq3vIzRhB+Fahnk KS5wmTq5K/WFhkB26vITPP/5MSWEYIv71EyNBYEETzuRUaQnxDw0lTrWOSF4sIn2FCw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388964; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=h2NpPkKe5AfqOYFZ70HlCiCWtYgk0q5tOlxHlBD1hF8=; b=Hryco/B0em0LzUEQgEZJ6AYUXMA7vu+5Cfp3Ed72EXeG3ItuprgwWORQe1oXlckL3JjC yKzjkx8Be13/KYSxtBJJKTn/btudfpOfrOOInB0LG32Zht5angPhgZBOm1xyCbl12sJ9T HCUu1bsH6jARvM9oyqEmVSDyoJKFc/UC7wCIf7gkghL2y1ZGRn28NMlNsodsTQllSbY2l rX0K3A92cX2xJRJFVxWXaNmsLtoc/yUFAYWxSXYE7fXTcDaikvoyQXu5ooGTpeujEl01e woF2App4lEHMjwodHkPAoLWUxZT1h5zquY7+rupwYnDZKWGOHUf/BW51qB5Z61rnRgA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="b8/ZowXV"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E274606A32C; Fri, 4 Dec 2026 12:56:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=b8/ZowXV Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1C261F00A07; Fri, 4 Dec 2026 12:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388964; bh=h2NpPkKe5AfqOYFZ70HlCiCWtYgk0q5tOlxHlBD1hF8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=b8/ZowXVnCZ58hD9kavNXOp90ExYnOZKtNkzNwmDA1iwION4iso1xG9pXThQrCIsX vUVgEqK+mcj+Zgy5LNyXos4ZFMGSwst8AqlpkaFJmKFCQ4Y2D+IrePCMJcevOJqSIK mQxaVciWCcCxJLkcujUUjvFVuddHXzR4Sj70wVY8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Xiangwu Lai , Frank Li , Amelie Delaunay , Vinod Koul , Sasha Levin Subject: [PATCH 6.1 0817/1059] dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend Date: Fri, 4 Dec 2026 19:05:48 +0900 Message-ID: <20261204100705.191661181@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Xiangwu Lai [ Upstream commit 34c8c2ea213aab7b452df93e5b7547f4459a49e9 ] stm32_mdma_pm_suspend() increments the runtime PM usage counter with pm_runtime_resume_and_get(), but when a channel is still enabled it returns -EBUSY directly without dropping the reference. The matching pm_runtime_put_sync() only runs on the success path. Each failed suspend attempt therefore leaks one runtime PM reference, so the device can never runtime suspend afterwards. Drop the reference before returning -EBUSY. Fixes: 7cb819c856d9 ("dmaengine: stm32-mdma: add suspend/resume power management support") Signed-off-by: Xiangwu Lai Reviewed-by: Frank Li Reviewed-by: Amelie Delaunay Link: https://patch.msgid.link/20261102104432.873-1-laixiangwu@cmss.chinamobile.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/stm32-mdma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c index 405c1fe2d6a3e..cd0aadd45f7ba 100644 --- a/drivers/dma/stm32-mdma.c +++ b/drivers/dma/stm32-mdma.c @@ -1789,6 +1789,7 @@ static int stm32_mdma_pm_suspend(struct device *dev) ccr = stm32_mdma_read(dmadev, STM32_MDMA_CCR(id)); if (ccr & STM32_MDMA_CCR_EN) { dev_warn(dev, "Suspend is prevented by Chan %i\n", id); + pm_runtime_put_sync(dev); return -EBUSY; } } -- 2.53.0