All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ufs: host: Remove redundant dev_err()
@ 2026-07-17  3:50 Pan Chuang
  2026-07-17  4:03 ` sashiko-bot
  2026-07-17  6:35 ` Peter Wang (王信友)
  0 siblings, 2 replies; 3+ messages in thread
From: Pan Chuang @ 2026-07-17  3:50 UTC (permalink / raw)
  To: Peter Wang, Chaotian Jing, Stanley Jhu, James E.J. Bottomley,
	Martin K. Petersen, Manivannan Sadhasivam, Matthias Brugger,
	AngeloGioacchino Del Regno,
	open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER...,
	moderated list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER...,
	open list,
	open list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER...,
	moderated list:ARM/Mediatek SoC support:Keyword:mediatek
  Cc: Pan Chuang

Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() calls.

Signed-off-by: Pan Chuang <panchuang@vivo.com>
---
 drivers/ufs/host/ufs-mediatek.c | 4 +---
 drivers/ufs/host/ufs-qcom.c     | 2 --
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
index 3991a51263a6..98ea9aa2a39c 100644
--- a/drivers/ufs/host/ufs-mediatek.c
+++ b/drivers/ufs/host/ufs-mediatek.c
@@ -2266,10 +2266,8 @@ static int ufs_mtk_config_mcq_irq(struct ufs_hba *hba)
 
 		dev_dbg(hba->dev, "request irq %d intr %s\n", irq, ret ? "failed" : "");
 
-		if (ret) {
-			dev_err(hba->dev, "Cannot request irq %d\n", ret);
+		if (ret)
 			return ret;
-		}
 	}
 	host->is_mcq_intr_enabled = true;
 
diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index 291c43448764..7d690ea2fa67 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -2431,8 +2431,6 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
 		ret = devm_request_irq(hba->dev, qi[idx].irq, ufs_qcom_mcq_esi_handler,
 				       IRQF_SHARED, "qcom-mcq-esi", qi + idx);
 		if (ret) {
-			dev_err(hba->dev, "%s: Failed to request IRQ for %d, err = %d\n",
-				__func__, qi[idx].irq, ret);
 			/* Free previously allocated IRQs */
 			for (int j = 0; j < idx; j++)
 				devm_free_irq(hba->dev, qi[j].irq, qi + j);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ufs: host: Remove redundant dev_err()
  2026-07-17  3:50 [PATCH] ufs: host: Remove redundant dev_err() Pan Chuang
@ 2026-07-17  4:03 ` sashiko-bot
  2026-07-17  6:35 ` Peter Wang (王信友)
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-07-17  4:03 UTC (permalink / raw)
  To: Pan Chuang; +Cc: linux-scsi

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Teardown order violation in ufs_qcom_remove() destroys the MSI domain before devres-managed IRQs are freed, leading to a potential Use-After-Free or panic.
--

--- Patch [1]: [PATCH] ufs: host: Remove redundant dev_err() ---
commit 2d60d33ee1768b4175522f72c450271bc5ddc6ae
Author: Pan Chuang <panchuang@vivo.com>

ufs: host: Remove redundant dev_err()

Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
devm_request_*_irq()"), devm_request_irq() automatically logs
detailed error messages on failure. Remove the now-redundant
driver-specific dev_err() calls.

> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index 291c434487648..7d690ea2fa674 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -2431,8 +2431,6 @@ static int ufs_qcom_config_esi(struct ufs_hba *hba)
>  		ret = devm_request_irq(hba->dev, qi[idx].irq, ufs_qcom_mcq_esi_handler,
>  				       IRQF_SHARED, "qcom-mcq-esi", qi + idx);
>  		if (ret) {
> -			dev_err(hba->dev, "%s: Failed to request IRQ for %d, err = %d\n",
> -				__func__, qi[idx].irq, ret);
>  			/* Free previously allocated IRQs */
>  			for (int j = 0; j < idx; j++)
>  				devm_free_irq(hba->dev, qi[j].irq, qi + j);

[Severity: High]
This is a pre-existing issue, but since devres-managed IRQs are used here, 
does ufs_qcom_remove() break teardown symmetry?

In ufs_qcom_remove(), the MSI domain is destroyed manually before
devres-managed IRQ handlers are released:

drivers/ufs/host/ufs-qcom.c:ufs_qcom_remove() {
    ...
    ufshcd_pltfrm_remove(pdev);
    if (host->esi_enabled)
        platform_device_msi_free_irqs_all(hba->dev);
    ...
}

When the device is unbound, platform_device_msi_free_irqs_all() destroys the
MSI IRQ domain and descriptors before devres runs.

When devm_irq_release() later calls free_irq(), it silently returns early
because the descriptor is already gone. This bypasses the critical
__synchronize_irq() and kthread_stop() cleanup logic.

Could this permanently leak the threaded IRQ handlers (struct irqaction
objects) and cause a use-after-free or kernel panic if a handler is
scheduled or running while the driver memory is freed?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260717035013.563791-1-panchuang@vivo.com?part=1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ufs: host: Remove redundant dev_err()
  2026-07-17  3:50 [PATCH] ufs: host: Remove redundant dev_err() Pan Chuang
  2026-07-17  4:03 ` sashiko-bot
@ 2026-07-17  6:35 ` Peter Wang (王信友)
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Wang (王信友) @ 2026-07-17  6:35 UTC (permalink / raw)
  To: linux-arm-kernel@lists.infradead.org, chu.stanley@gmail.com,
	AngeloGioacchino Del Regno, linux-scsi@vger.kernel.org,
	Chaotian Jing (井朝天), panchuang@vivo.com,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	matthias.bgg@gmail.com, James.Bottomley@HansenPartnership.com,
	mani@kernel.org, linux-mediatek@lists.infradead.org,
	martin.petersen@oracle.com

On Fri, 2026-07-17 at 11:50 +0800, Pan Chuang wrote:
> Since commit 55b48e23f5c4 ("genirq/devres: Add error handling in
> devm_request_*_irq()"), devm_request_irq() automatically logs
> detailed error messages on failure. Remove the now-redundant
> driver-specific dev_err() calls.
> 
> Signed-off-by: Pan Chuang <panchuang@vivo.com>
> ---

Reviewed-by: Peter Wang <peter.wang@mediatek.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-17  6:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-17  3:50 [PATCH] ufs: host: Remove redundant dev_err() Pan Chuang
2026-07-17  4:03 ` sashiko-bot
2026-07-17  6:35 ` Peter Wang (王信友)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.