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=1795018712; b=2VkI3/1REDpNl53lvaw//eb1Fn+VsknRce9kzSgMtpYPMdjsGRKIJ4EbxChi49tDGVxb F6IQ/SD8Hp8w7dID5VR9qXJKVMy+IhFW2wai7oeaqajilYxtKOVbQM87YzXa3O5XTaHwo /gSpU9UESXX9y1KVL0oCmRtok4IcecaMejTwLp4sWl5Gi/qjA535/7wFp+hd3LHzLKk/P yYUiCRhkCoLzDkRLM/DN/UD7LjHd9dFBy7RxCRbTNmuWAglWkesa8LMZLU2GODXi4MMWm +bTLefB6Baj0fh/xfuwHLTmAksTKjsE35cH8lWgF06Duh7CzYGJhfk44pWJBwyF41cg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795018712; 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=jt6jJBIseBdf3/TINncQR/kTJaI5Xwn8W5L3F1MYWAQ=; b=2xxPp0UZAchxfbKYTVtJPrRgaZZ4WOcLScW9e6KSntjdTM3RYMdKRGE0EffSAxjVd/G3 QmWkYFBVewR+1QsXS3snURytjHPccQCknNaSRDcx3TFbFKOZNyzzWgGBE52xhL3vQIG3D 4t+ZEvPSGyp0ayMke1rPU6Qs+Uvuk8OWIfyZRx7z26rLN1NwRdwT3M4Lz7Pf8DcKdiDie qO0Q/Eg4o4I8r+FgC9yZUHens3Wc3e7HrlIjQaCW+kZ/wRbHX7gV7g9p6mcuycIHZ9Nb9 8RQmSzgh92llhkgrvU1Y76BhpCjo8/92928W7byS+k1HHlWvgDaOnENqku+l+ZNS4ow== 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="d7KiKBq/"; 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 EA98F606A338; Wed, 18 Nov 2026 16:18:31 +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=d7KiKBq/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38B761F000C8; Wed, 18 Nov 2026 16:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795018711; bh=jt6jJBIseBdf3/TINncQR/kTJaI5Xwn8W5L3F1MYWAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=d7KiKBq/NSubqvy3H2Pp47ER1TR7ipW2iE+O5ytnah78WksmgqoCwhK28O16n/0ja kirgFYLZwMqNYtQjQUlBTCcQwuE5yHn0/YiX3WVzev6U/DIDJl0UyBZvshfktNKT6V qfzNMYOYTOsmXDThf+PwXM5Je4qWYoo47hmxDxtE= 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 7.3 1336/2651] dmaengine: ste_dma40: Fix probe runtime PM disable Date: Wed, 18 Nov 2026 15:42:56 +0100 Message-ID: <20261118150336.105394866@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150247.972732815@linuxfoundation.org> References: <20261118150247.972732815@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 7.3-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 64f7a0ca20b9f..1dcfeabb3f363 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -3757,12 +3757,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"); @@ -3787,10 +3781,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) @@ -3826,7 +3830,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); report_failure: d40_err(dev, "probe failed\n"); -- 2.53.0