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=1794591417; b=kNaRVMMT0rfWlEkQiWGi5sSIDZwk+zUbFnbTcWKwR6zxF7NpsNi4eJcdOPV0thMokufp b1LRv1pLkRJ8n02f+4LWy58t0AaphcVJXhgbCLPHL9yX2ma83UhvlulripJMxbopNYlWH +X61ioH/4e3MLoxMwNcW/YFvwVwYpTOgmBf+kSvCldUcGXe4f/jeWJFul3LhhGE9bnuuT RH7cESTcA8EZs+fvoyVWHHcaf0I/1OosudultBWMUs3nKItEskjGFWqJK11tOmt9JWHOJ 8qHWsFghtpbYth8ysqYwWzxMaW9qsd6spJ2c/Zd7xAAiZg7pD9npG2Rwx3FSAgAI7Hw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794591417; 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=Nj0VQShWN13ta83NmLABkwjbMOM8TLoTBY5clBuLUoM=; b=W3MPzel3yu1YehY5mo0nAUtG456MahCV2YzXMmKEAbZ24dmqj0s54zsQg8UdlXaZ2T8w Kp5Xv+X2OVrNtFMK8WPit6WTl3tb3FkB6OOp4i3xMQxHkXpICgonOkNfuep5qb3v8kweB ugo7aZmbQzhnFt76N2mw3f3VQaNG1KMBRQV+DZ+tLQo8OkpmNEBAh2VxcibU6YNHan/x/ sVSuDw+VGcD4U1C7xDPSeu0tYXYG15PFnl7gkK9+NNdn5Kkhey00VgJeXypJU441VKQIg 2qm/ZYuk32Cax4UAo9ei6dME64DtZkyJSIj0aP8ULpLwcba+EnRztOk1BKY8eY0JRSA== 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=apfvsM0h; 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 A87EA607A5F2; Fri, 13 Nov 2026 17:36:57 +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=apfvsM0h Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5486B1F000C4; Fri, 13 Nov 2026 17:36:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1794591417; bh=Nj0VQShWN13ta83NmLABkwjbMOM8TLoTBY5clBuLUoM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=apfvsM0hwoGb0Ch+nPW8AOebk8QsEKpj7uDBcTG2I7VyxY4AhmOZi4YJYIA0n0C8I ln1z7nsbQ5pUUNAPUoGn3ueRIi35n/+eyWf1ANslUNlznu77wtKGuHZckqSKkCRhxj R3QFxj0/BC4pB07glG5C/ylTp9P67cZQRVNgsNBw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sashiko , Manivannan Sadhasivam , Bartosz Golaszewski , Vinod Koul , Sasha Levin Subject: [PATCH 6.12 510/670] dmaengine: qcom: bam_dma: free interrupt before the clock in error path Date: Fri, 13 Nov 2026 10:51:14 -0500 Message-ID: <20261113153829.232249079@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261113153811.177190860@linuxfoundation.org> References: <20261113153811.177190860@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bartosz Golaszewski [ Upstream commit 82eed160cfa7a296ae4eb5acb8dd8f493323eea7 ] The BAM interrupt is requested with a devres helper and so on error it's freed after probe() returns. We disable the clock before freeing or masking it so it may still fire and we may end up reading BAM registers with clock disabled. Stop using devres for interrupts as we free it in remove() manually anyway. Add an appropriate label and free the interrupt before disabling the clock in error path and in remove(). Cc: stable@vger.kernel.org Fixes: e7c0fe2a5c84 ("dmaengine: add Qualcomm BAM dma driver") Reported-by: Sashiko Closes: https://sashiko.dev/#/patchset/20260427-qcom-qce-cmd-descr-v16-0-945fd1cafbbc%40oss.qualcomm.com?part=2 Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bartosz Golaszewski Link: https://patch.msgid.link/20261008-bam-dma-free-irq-v28-1-5e5b10de441e@oss.qualcomm.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/qcom/bam_dma.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 9f712e7c7e07f..d06f95f7868c1 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -1322,8 +1322,8 @@ static int bam_dma_probe(struct platform_device *pdev) for (i = 0; i < bdev->num_channels; i++) bam_channel_init(bdev, &bdev->channels[i], i); - ret = devm_request_irq(bdev->dev, bdev->irq, bam_dma_irq, - IRQF_TRIGGER_NONE, "bam_dma", bdev); + ret = request_irq(bdev->irq, bam_dma_irq, IRQF_TRIGGER_NONE, + "bam_dma", bdev); if (ret) goto err_bam_channel_exit; @@ -1356,7 +1356,7 @@ static int bam_dma_probe(struct platform_device *pdev) ret = dma_async_device_register(&bdev->common); if (ret) { dev_err(bdev->dev, "failed to register dma async device\n"); - goto err_bam_channel_exit; + goto err_free_irq; } ret = of_dma_controller_register(pdev->dev.of_node, bam_dma_xlate, @@ -1375,6 +1375,8 @@ static int bam_dma_probe(struct platform_device *pdev) err_unregister_dma: dma_async_device_unregister(&bdev->common); +err_free_irq: + free_irq(bdev->irq, bdev); err_bam_channel_exit: for (i = 0; i < bdev->num_channels; i++) tasklet_kill(&bdev->channels[i].vc.task); @@ -1400,7 +1402,7 @@ static void bam_dma_remove(struct platform_device *pdev) /* mask all interrupts for this execution environment */ writel_relaxed(0, bam_addr(bdev, 0, BAM_IRQ_SRCS_MSK_EE)); - devm_free_irq(bdev->dev, bdev->irq, bdev); + free_irq(bdev->irq, bdev); for (i = 0; i < bdev->num_channels; i++) { bam_dma_terminate_all(&bdev->channels[i].vc.chan); -- 2.53.0