Skip to contentSkip to conversation

scsi: ufs: convert probe to use dev_err_probe()

PATCH Superseded Brian Masney 2 participants 4 messages Aug 9, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover scsi: ufs: convert probe to use dev_err_probe()

The following two log messages are shown on bootup due to an -EPROBE_DEFER when booting on a Qualcomm sa8775p development board:

ufshcd-qcom 1d84000.ufs: ufshcd_variant_hba_init: variant qcom init
failed err -517
ufshcd-qcom 1d84000.ufs: Initialization failed

This patch series converts the relevant two probe functions over to use dev_err_probe() so that these messages are not shown on bootup.

Changes since v1
https://lore.kernel.org/lkml/[email protected]/
- Dropped code cleanup

Brian Masney (2):
scsi: ufs: core: convert to dev_err_probe() in hba_init
scsi: ufs: host: convert to dev_err_probe() in pltfrm_init

 drivers/ufs/core/ufshcd.c        | 5 +++--
 drivers/ufs/host/ufshcd-pltfrm.c | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH v2 1/2 scsi: ufs: core: convert to dev_err_probe() in hba_init

Convert ufshcd_variant_hba_init() over to use dev_err_probe() to avoid log messages like the following on bootup:

ufshcd-qcom 1d84000.ufs: ufshcd_variant_hba_init: variant qcom init
failed err -517

---
Changes since v1
- Dropped code cleanup

 drivers/ufs/core/ufshcd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/ufs/core/ufshcd.c +3 -2
index 129446775796..409d176542e1 100644
@@ -9235,8 +9235,9 @@ static int ufshcd_variant_hba_init(struct ufs_hba *hba)
 
 	err = ufshcd_vops_init(hba);
 	if (err)
-		dev_err(hba->dev, "%s: variant %s init failed err %d\n",
-			__func__, ufshcd_get_var_name(hba), err);
+		dev_err_probe(hba->dev, err,
+			      "%s: variant %s init failed err %d\n",
+			      __func__, ufshcd_get_var_name(hba), err);
 out:
 	return err;
 }
Signature · 1 line
2.41.0
#2 lore raw

PATCH v2 2/2 scsi: ufs: host: convert to dev_err_probe() in pltfrm_init

In reply to Brian Masney

Convert ufshcd_pltfrm_init() over to use dev_err_probe() to avoid the following log message on bootup due to an -EPROBE_DEFER return code:

ufshcd-qcom 1d84000.ufs: Initialization failed

---
No changes since v1

 drivers/ufs/host/ufshcd-pltfrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ufs/host/ufshcd-pltfrm.c +1 -1
index 0b7430033047..f2c50b78efbf 100644
@@ -373,7 +373,7 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
 
 	err = ufshcd_init(hba, mmio_base, irq);
 	if (err) {
-		dev_err(dev, "Initialization failed\n");
+		dev_err_probe(dev, err, "Initialization failed\n");
 		goto dealloc_host;
 	}
 
Signature · 1 line
2.41.0
#3 lore raw

Re: [PATCH v2 2/2] scsi: ufs: host: convert to dev_err_probe() in pltfrm_init

Quoted 18 lines · Brian Masney

Convert ufshcd_pltfrm_init() over to use dev_err_probe() to avoid the following log message on bootup due to an -EPROBE_DEFER return code:

ufshcd-qcom 1d84000.ufs: Initialization failed

---
No changes since v1

  drivers/ufs/host/ufshcd-pltfrm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ufs/host/ufshcd-pltfrm.c +0 -0
index 0b7430033047..f2c50b78efbf 100644

drivers/ufs/host/ufshcd-pltfrm.c int ufshcd_pltfrm_init(struct platform_device *pdev, · line 376

Quoted 5 lines
drivers/ufs/host/ufshcd-pltfrm.c +1 -1
@@ -373,7 +373,7 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
 
  	err = ufshcd_init(hba, mmio_base, irq);
  	if (err) {
-		dev_err(dev, "Initialization failed\n");
+		dev_err_probe(dev, err, "Initialization failed\n");

Hi Brian,
Can you pls add the error code to the print?

Quoted 3 lines
drivers/ufs/host/ufshcd-pltfrm.c +0 -0
  		goto dealloc_host;
  	}