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=1795055790; b=N1qO++lx309P7lzflVsll9urofNp1fIYwKoNVQZmZvdKh0s7uuVPAyY9Y7tfHs7As94V MvJ0PNB4u5QfNYUitEmorKwJORb5m4PgAKCIlmo/QphA5TeA7D9le7vrbjfMBNwHSRwZJ P7jCtuYy0usPZm98Hk9Sd4eWBYZZnvlrWjqekMJn3yEp90jzeLs0sEp7MQhz+n4M4i9x3 2QZfKxfZTEXf7y6Capx4eokMx1Ks43Df+vEPG0BmcRUDvEDs2eJwNuWZJbYFAiGIAkXj0 CyquTslNW7LxEoyQc8OeQOCBnp3ry9WB9yN3AFZTMxHWA8KkYgl/Kv15ej+8J0vH1NA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795055790; 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=/HL5KMdpfeLLPuZ6b5dr4j2apBrWrxShRtFBT+Tp7Qs=; b=OxlzPXOgvq0zRpLREW0WtlGfJUsKz3TclbjnyO3K89H9EJn8pHD4i6EeQU8/gMcrxp2X ieLyjJ+WosCf3oZviM9Hk1fGO55RYqlRZew/F93xJ6fxiBiMdvOdk9LwWjYKo6cWXRUvN V+mwpl7whtm3gKxlazsyGkPPHnF83CZQjorgi9GMge4liLl1Ut0SvJMODim0vxilgVHos fU7JCROG48PZUDulrYA0IbsY1P0Kvjn09xsGxa9b7kRaZpsm+u/IzR8+mSSguUKpPejX/ UnqmfT7ATquXYB9YxVpcq0W+0k+KpgJr0pZttmC4LNOAtBNedb631uT+ISG/d83f5IQ== 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=emiFC7vL; 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 20129606A31C; Thu, 19 Nov 2026 02:36:30 +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=emiFC7vL Received: by smtp.kernel.org (Postfix) with ESMTPSA id 790F71F000C4; Thu, 19 Nov 2026 02:36:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795055790; bh=/HL5KMdpfeLLPuZ6b5dr4j2apBrWrxShRtFBT+Tp7Qs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=emiFC7vLzzf9nPK+f9Df5fQYKWm2vvB4FqUcIVZhxUHcVHzdS0tkGSPAcWo0uMzHH x+0R6N2x05aPD9kKLYzDVNZQPr3BGNxk5iaNLzbrAlFpCwCmr5sh6saUOr2dtEbeGg vs+sa648QI2D2E/EVJT3R20/8ADoF0zTXHgIApUc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, sashiko-bot@kernel.org, Frank Li , Linus Walleij , Vinod Koul , Sasha Levin Subject: [PATCH 5.15 1756/2214] dmaengine: ste_dma40: Fix probe runtime PM disable Date: Wed, 18 Nov 2026 15:57:12 +0100 Message-ID: <20261118150121.811308317@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150009.797899913@linuxfoundation.org> References: <20261118150009.797899913@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 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Linus Walleij [ Upstream commit c6809b381e34f8966cc3d9e5d7d658775a408f83 ] Some d40_probe() error paths jump to destroy_cache before runtime PM has been enabled for the DMA controller device. The label unconditionally calls pm_runtime_disable(), which increments disable_depth even though this probe attempt never enabled runtime PM. Use devm_pm_runtime_set_active_enabled() to mark the controller active, enable runtime PM and register balanced cleanup for probe failure. This avoids both the disable-depth imbalance and ad-hoc probe state tracking. The interrupt handler uses pm_runtime_get_if_active() and cannot acknowledge a pending interrupt while runtime PM is disabled. Request the IRQ only after enabling runtime PM so the handler cannot enter an unacknowledged interrupt loop during probe. Fixes: 0618c077a8c2 ("dmaengine: ste_dma40: Fix PM disable depth imbalance in d40_probe") Reported-by: sashiko-bot@kernel.org Closes: https://lore.kernel.org/dmaengine/20260618051539.15E201F000E9@smtp.kernel.org/ Assisted-by: LLM Reviewed-by: Frank Li Signed-off-by: Linus Walleij Link: https://patch.msgid.link/20260927-dma40-fixes-v7-5-89f595e8851d@kernel.org Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/ste_dma40.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 191e2e506be18..ed7705e4efd19 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3616,12 +3616,6 @@ static int __init d40_probe(struct platform_device *pdev) goto destroy_cache; } - ret = request_irq(base->irq, d40_handle_interrupt, 0, D40_NAME, base); - if (ret) { - d40_err(dev, "No IRQ defined\n"); - goto destroy_cache; - } - if (base->plat_data->use_esram_lcla) { base->lcpa_regulator = regulator_get(base->dev, "lcla_esram"); @@ -3646,10 +3640,20 @@ static int __init d40_probe(struct platform_device *pdev) pm_runtime_irq_safe(base->dev); pm_runtime_set_autosuspend_delay(base->dev, DMA40_AUTOSUSPEND_DELAY); - pm_runtime_use_autosuspend(base->dev); pm_runtime_mark_last_busy(base->dev); - pm_runtime_set_active(base->dev); - pm_runtime_enable(base->dev); + + ret = devm_pm_runtime_set_active_enabled(base->dev); + if (ret) { + d40_err(dev, "Failed to enable runtime PM: %d\n", ret); + goto destroy_cache; + } + pm_runtime_use_autosuspend(base->dev); + + ret = request_irq(base->irq, d40_handle_interrupt, 0, D40_NAME, base); + if (ret) { + d40_err(dev, "No IRQ defined\n"); + goto destroy_cache; + } ret = d40_dmaengine_init(base, num_reserved_chans); if (ret) @@ -3709,7 +3713,6 @@ static int __init d40_probe(struct platform_device *pdev) regulator_disable(base->lcpa_regulator); regulator_put(base->lcpa_regulator); } - pm_runtime_disable(base->dev); kfree(base->lcla_pool.alloc_map); kfree(base->lookup_log_chans); -- 2.53.0