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=1795061246; b=T15n2UXJVTM1aTGf1fTypglD5XlYlm0EltX40b3zTM/YSSsh2vOePNbRp4VDO3reSbI+ +AuwnWbL9hL7sSWoZcKM+kuuduB/bDmerRKsYGvjqn2cMMb1UfTato3fJGj+0JODXbjiY r/5D2TMy5w/A4i0nc+oBSq5x10e8bPah3BXkSS+VhO23nxwA2+ic3hAVWgyHfobwk1G0S OEDY+soAfylBFHdkHkuHDHja924MTM5sSfH9QJOODWdAL0Usv3kWqX9wIYMTGWvpc7b06 7UwxkXBVHNZqVsTd/2Nm3gYqTgTRPX8bQY5zusz9Dgp8KVYhAVNeiFahE1hCn9BYeug== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795061246; 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=BwKPXrtpvQWZbm4UdxoNLXhe0p8g33Z7sD33gFiOD8w=; b=ldCSgKOktzMyKzX82oyBLeWh2c1sYZSHFAy4rVRIYawf+Kpqg/m0jjE/OHLnhjNQrByU HKnG9j5ErTkH/+7e0gqrRQ/PFpwcTdponeJs6PlK8XnWtDNLgf5StHpaAAUnp5s6NEYOX ilSm/HjZLxAM3zTnW5nxC0wcHyuoGIp0sYeKwE0jXzyhj3cfPW+kYECjDYyOCu2mBk4QY DJrxv3iGyZsU6hAmAuAsB9iuIYu1Z47pWMyrmUvtdIR4iQiyoOSrLGtByXJGYfvpWNvcy V1jESBh8fk/5QN2SwqiPUic1aDmAzGbOxfBCxZJxH3bpwaDZe3gSE3Wd3tWNjBXIl1g== 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=P8XtmyLD; 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 D8674606A32F; Thu, 19 Nov 2026 04:07:26 +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=P8XtmyLD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 359D81F000CF; Thu, 19 Nov 2026 04:07:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795061246; bh=BwKPXrtpvQWZbm4UdxoNLXhe0p8g33Z7sD33gFiOD8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=P8XtmyLDzhNwJlxA2f7jVsgTf2pHxFP6yj/axKALdG/Az5wL5mYRfd6NZxcZ/+2BF vIiWURfbrp6FVASKRtKalVbkTCECpOCULbStO3qKkiB12wjloXVbzyGukBEBHnX3Rm mDk5w3liVJXUY4htqyTf06u0oGZ5D4BGz61//Lfk= 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.10 1484/1848] dmaengine: ste_dma40: Fix probe runtime PM disable Date: Wed, 18 Nov 2026 15:58:42 +0100 Message-ID: <20261118150021.384832728@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118145911.150052362@linuxfoundation.org> References: <20261118145911.150052362@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.10-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 de6712c1587d7..1cf711dbbb873 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3617,12 +3617,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"); @@ -3647,10 +3641,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) @@ -3710,7 +3714,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