linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] scsi: ufs: convert probe to use dev_err_probe()
@ 2023-08-08 14:26 Brian Masney
  2023-08-08 14:26 ` [PATCH 1/2] scsi: ufs: core: convert to dev_err_probe() in hba_init Brian Masney
  2023-08-08 14:26 ` [PATCH 2/2] scsi: ufs: host: convert to dev_err_probe() in pltfrm_init Brian Masney
  0 siblings, 2 replies; 5+ messages in thread
From: Brian Masney @ 2023-08-08 14:26 UTC (permalink / raw)
  To: jejb, martin.petersen
  Cc: alim.akhtar, avri.altman, bvanassche, linux-scsi, linux-kernel

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.

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        | 17 +++++++++--------
 drivers/ufs/host/ufshcd-pltfrm.c |  2 +-
 2 files changed, 10 insertions(+), 9 deletions(-)

-- 
2.41.0


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

* [PATCH 1/2] scsi: ufs: core: convert to dev_err_probe() in hba_init
  2023-08-08 14:26 [PATCH 0/2] scsi: ufs: convert probe to use dev_err_probe() Brian Masney
@ 2023-08-08 14:26 ` Brian Masney
  2023-08-08 20:29   ` Hugo Villeneuve
  2023-08-08 14:26 ` [PATCH 2/2] scsi: ufs: host: convert to dev_err_probe() in pltfrm_init Brian Masney
  1 sibling, 1 reply; 5+ messages in thread
From: Brian Masney @ 2023-08-08 14:26 UTC (permalink / raw)
  To: jejb, martin.petersen
  Cc: alim.akhtar, avri.altman, bvanassche, linux-scsi, linux-kernel

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

While changes are being made here, let's go ahead and clean up the rest
of that function.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/ufs/core/ufshcd.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 129446775796..90d87cf5e25e 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9228,17 +9228,18 @@ static int ufshcd_init_clocks(struct ufs_hba *hba)
 
 static int ufshcd_variant_hba_init(struct ufs_hba *hba)
 {
-	int err = 0;
+	int ret;
 
 	if (!hba->vops)
-		goto out;
+		return 0;
 
-	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);
-out:
-	return err;
+	ret = ufshcd_vops_init(hba);
+	if (ret)
+		dev_err_probe(hba->dev, ret,
+			      "%s: variant %s init failed with error %d\n",
+			      __func__, ufshcd_get_var_name(hba), ret);
+
+	return ret;
 }
 
 static void ufshcd_variant_hba_exit(struct ufs_hba *hba)
-- 
2.41.0


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

* [PATCH 2/2] scsi: ufs: host: convert to dev_err_probe() in pltfrm_init
  2023-08-08 14:26 [PATCH 0/2] scsi: ufs: convert probe to use dev_err_probe() Brian Masney
  2023-08-08 14:26 ` [PATCH 1/2] scsi: ufs: core: convert to dev_err_probe() in hba_init Brian Masney
@ 2023-08-08 14:26 ` Brian Masney
  1 sibling, 0 replies; 5+ messages in thread
From: Brian Masney @ 2023-08-08 14:26 UTC (permalink / raw)
  To: jejb, martin.petersen
  Cc: alim.akhtar, avri.altman, bvanassche, linux-scsi, linux-kernel

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

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
 drivers/ufs/host/ufshcd-pltfrm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
index 0b7430033047..f2c50b78efbf 100644
--- a/drivers/ufs/host/ufshcd-pltfrm.c
+++ b/drivers/ufs/host/ufshcd-pltfrm.c
@@ -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;
 	}
 
-- 
2.41.0


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

* Re: [PATCH 1/2] scsi: ufs: core: convert to dev_err_probe() in hba_init
  2023-08-08 14:26 ` [PATCH 1/2] scsi: ufs: core: convert to dev_err_probe() in hba_init Brian Masney
@ 2023-08-08 20:29   ` Hugo Villeneuve
  2023-08-09 18:56     ` Brian Masney
  0 siblings, 1 reply; 5+ messages in thread
From: Hugo Villeneuve @ 2023-08-08 20:29 UTC (permalink / raw)
  To: Brian Masney
  Cc: jejb, martin.petersen, alim.akhtar, avri.altman, bvanassche,
	linux-scsi, linux-kernel

On Tue,  8 Aug 2023 10:26:49 -0400
Brian Masney <bmasney@redhat.com> wrote:

> 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
> 
> While changes are being made here, let's go ahead and clean up the rest
> of that function.

Hi,
you should not combine code cleanup and fixes/improvements in the same
patch, split them.

Hugo Villeneuve


> Signed-off-by: Brian Masney <bmasney@redhat.com>
> ---
>  drivers/ufs/core/ufshcd.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 129446775796..90d87cf5e25e 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -9228,17 +9228,18 @@ static int ufshcd_init_clocks(struct ufs_hba *hba)
>  
>  static int ufshcd_variant_hba_init(struct ufs_hba *hba)
>  {
> -	int err = 0;
> +	int ret;
>  
>  	if (!hba->vops)
> -		goto out;
> +		return 0;
>  
> -	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);
> -out:
> -	return err;
> +	ret = ufshcd_vops_init(hba);
> +	if (ret)
> +		dev_err_probe(hba->dev, ret,
> +			      "%s: variant %s init failed with error %d\n",
> +			      __func__, ufshcd_get_var_name(hba), ret);
> +
> +	return ret;
>  }
>  
>  static void ufshcd_variant_hba_exit(struct ufs_hba *hba)
> -- 
> 2.41.0
> 

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

* Re: [PATCH 1/2] scsi: ufs: core: convert to dev_err_probe() in hba_init
  2023-08-08 20:29   ` Hugo Villeneuve
@ 2023-08-09 18:56     ` Brian Masney
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Masney @ 2023-08-09 18:56 UTC (permalink / raw)
  To: Hugo Villeneuve
  Cc: jejb, martin.petersen, alim.akhtar, avri.altman, bvanassche,
	linux-scsi, linux-kernel

On Tue, Aug 08, 2023 at 04:29:29PM -0400, Hugo Villeneuve wrote:
> On Tue,  8 Aug 2023 10:26:49 -0400
> Brian Masney <bmasney@redhat.com> wrote:
> 
> > 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
> > 
> > While changes are being made here, let's go ahead and clean up the rest
> > of that function.
> 
> Hi,
> you should not combine code cleanup and fixes/improvements in the same
> patch, split them.

This is a pretty simple patch as is, and split up the code clean up is
not very useful on its own. I'll just skip doing the code cleanup and
only post the dev_err_probe() change in v2.

Brian


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

end of thread, other threads:[~2023-08-09 18:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-08 14:26 [PATCH 0/2] scsi: ufs: convert probe to use dev_err_probe() Brian Masney
2023-08-08 14:26 ` [PATCH 1/2] scsi: ufs: core: convert to dev_err_probe() in hba_init Brian Masney
2023-08-08 20:29   ` Hugo Villeneuve
2023-08-09 18:56     ` Brian Masney
2023-08-08 14:26 ` [PATCH 2/2] scsi: ufs: host: convert to dev_err_probe() in pltfrm_init Brian Masney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).