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=1796380152; b=U65uIpntwq31cWKTZ8pIE2agO8Dm+e7FBIxSFYD8prVnsSppZK7YXwRCXQrdHIXhbG0E 9V5tuvrPiaphAH47tKD/doKLJlMvLe9DAi8YvRTu2PnMO+x26ihV5hvGE+6rJ2AjYa0ch pkOP+NZh/qWLN8AaKnOJqz2CsgrMLov35m4IxWI/34ZVhfTv3sthOifhdGyU1rHlZEPZ9 4aDHeGeHXkPwH6EqAuJQbIk6SJ9BjTq/bKOAvRCqjP/NY1RwcNwxeS+48mMEWenDGHq1e p0ccpDVKuR16HRDopZMFelsgNSmAPNekLeGK122bbE7MJFdZtQVkFkFcqyk1tbi7XRA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380152; 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=ZZOjicR7lzM505VoTF2x+DPL0uPmESCOMhU+D96zdDs=; b=TuPHiutpMLPhMtDZjg7WVLfy2oE8no9qrvgPSNgORzw8HCJh4ZVPiY7vmTitzeebjhZi vBEz6ijsKAupnBQWLrckEEMlQHst+pSOO3oCCj5LoMtBlf8Zp5ikbIy/ib4EzP9HC8+Fg eLiidNnJWpQinJEQ0kAXDJm5liSrD5rhWa43WQ16pHpAx4C4NEyzb11O3LwsenRm1f4hk OVUy6MATPNtHEAciDyiZHNm95nJQDOwt6fdgzK8pIz5N6XXS5KwgzmRtrft+7iTGEWhMY CQHVoGqIGMnBryZ4bveUZCwc6RQdXwj68CZGW158UzhfN/sc59yc8f9nvR8lB1ah57Q== 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=s2Ezl2pI; 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 BEFF9606A6BB; Fri, 4 Dec 2026 10:29:12 +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=s2Ezl2pI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0692C1F000C2; Fri, 4 Dec 2026 10:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380152; bh=ZZOjicR7lzM505VoTF2x+DPL0uPmESCOMhU+D96zdDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=s2Ezl2pIgFEG0NTmG7H3jCflg+76GbfkYj1isRAgYuGtNoHoYPh4oaC8qfLjzY+ts Uhk/hdX4be/0/NqnkOv6GtccCIDg6mWypCAmJXSbS9ANrjAq5z1dMzKcsiRUbJnTaQ tiGdtN3ylzYjNQ3m3RcbCZPc4k8oRnJHoaz3PaeA= 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 7.3 150/742] dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend Date: Fri, 4 Dec 2026 19:00:14 +0900 Message-ID: <20261204100639.103634890@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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/stm32-mdma.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/dma/stm32/stm32-mdma.c b/drivers/dma/stm32/stm32-mdma.c index e3bbdc9ee36ed..fe1ff4a009fd3 100644 --- a/drivers/dma/stm32/stm32-mdma.c +++ b/drivers/dma/stm32/stm32-mdma.c @@ -1785,6 +1785,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