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=1796381832; b=v70vHPqloVLDwjRz8y4Pv3XQ9Snd9P6yKinvfAM9FtgP31oFD37Y3v+rrOXHa1PRrAD8 knCOm8BfJ/1GjqFpVztGPheU++kDdXYsqD/AEDg+0liSlXC9bXTdhjOODBANvTJnuzMZo rfj9rvd3NEhaJ7UwnIk8UJem+GSNVdvwuKuCX/ArU0vBith4O9cg4azxDaPQF6uGyNbYd /T9HFUrtNIn9dC9I27jGBo1eq1kKhr2Ayfxyuo9DF+iUSjAv+vqX5Rmf0yalEcYXt//0g NGv2AczkGMLUSCwr9n9FfKowJLWY/VndA361atasCHojQUznvGw0ZfvLJDvHuSBUf8Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381832; 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=B0W/1AI3cEPIeFyFckGfceVJUhzS6QiBactKbK17qfY=; b=p936cBGTPnzr2DPXsQ3E3gRA997XGMzggD8g7bauoI4wpirLO2iK2dc8kW3PSQH1vHuU qQjMhfVTDiZMZvQi8jvHuy2EymLXBJBzvlfWpiD6lhPzNaKPyJ+0eIObqbPZt5Se/GtKT 7Jv3QSpmq3fWcV/bH99W5cfq15EdMmOcleCzYHFpYdnyFBpLUBfACxkLW8iq3WH1FTm6A AHvtnYUlO33+HILwL+dO2Ln+jKtmqQxVOjY3qdH+BYe9KmADOB+6Jc45ER4BLGbNniUn8 rMW9tfLv+GEejGhJio7foOTEZ4M2yvcFh5MP1Y0h1xaTe/FA/G0xczrlw9XeaTZoSvg== 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=RRwAKbcs; 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 D3EE9606A32F; Fri, 4 Dec 2026 10:57: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=RRwAKbcs Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52C681F00897; Fri, 4 Dec 2026 10:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796381832; bh=B0W/1AI3cEPIeFyFckGfceVJUhzS6QiBactKbK17qfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RRwAKbcsNEhFCB+QdRjoclFzqlRd/Ev5hqbYu62sfi9o4ck3XC3r6p3JuhmUoKJhp VlOXmlmcef81Z7yM8Q/u5O9mWo+NqGiI4HcdycsY0BMUBpsIelFoELRgQYyN6x3LEA 5mMgnpQLTh+I1i+C344ImRQMPzxJupatL23wH3FY= 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.18 194/703] dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend Date: Fri, 4 Dec 2026 19:01:33 +0900 Message-ID: <20261204100633.018086545@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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 b87d41b234df1..1811c59949d0e 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