diff mbox series

[v3,1/8] scsi: ufs: Fix ufshcd_probe_hba() reture value in case ufshcd_scsi_add_wlus() fails

Message ID 20200119001327.29155-2-huobean@gmail.com (mailing list archive)
State Superseded
Headers show
Series Use UFS device indicated maximum LU number | expand

Commit Message

Bean Huo Jan. 19, 2020, 12:13 a.m. UTC
From: Bean Huo <beanhuo@micron.com>

A non-zero error value likely being returned by ufshcd_scsi_add_wlus()
in case of failure of adding the WLs, but ufshcd_probe_hba() doesn't
use this value, and doesn't report this failure to upper caller.
This patch is to fix this issue.

Fixes: 2a8fa600445c ("ufs: manually add well known logical units")
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/scsi/ufs/ufshcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Alim Akhtar Jan. 19, 2020, 1:30 a.m. UTC | #1
Hi Bean

On Sun, Jan 19, 2020 at 5:44 AM Bean Huo <huobean@gmail.com> wrote:
>
> From: Bean Huo <beanhuo@micron.com>
>
> A non-zero error value likely being returned by ufshcd_scsi_add_wlus()
> in case of failure of adding the WLs, but ufshcd_probe_hba() doesn't
> use this value, and doesn't report this failure to upper caller.
> This patch is to fix this issue.
>
> Fixes: 2a8fa600445c ("ufs: manually add well known logical units")
> Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
> Signed-off-by: Bean Huo <beanhuo@micron.com>
> ---
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>

>  drivers/scsi/ufs/ufshcd.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index bea036ab189a..9a9085a7bcc5 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -7032,7 +7032,8 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
>                         ufshcd_init_icc_levels(hba);
>
>                 /* Add required well known logical units to scsi mid layer */
> -               if (ufshcd_scsi_add_wlus(hba))
> +               ret = ufshcd_scsi_add_wlus(hba);
> +               if (ret)
>                         goto out;
>
>                 /* Initialize devfreq after UFS device is detected */
> --
> 2.17.1
>
Alim Akhtar Jan. 19, 2020, 1:33 a.m. UTC | #2
Hi Bean

On Sun, Jan 19, 2020 at 7:00 AM Alim Akhtar <alim.akhtar@gmail.com> wrote:
>
> Hi Bean
>
> On Sun, Jan 19, 2020 at 5:44 AM Bean Huo <huobean@gmail.com> wrote:
> >
> > From: Bean Huo <beanhuo@micron.com>
> >
> > A non-zero error value likely being returned by ufshcd_scsi_add_wlus()
> > in case of failure of adding the WLs, but ufshcd_probe_hba() doesn't
> > use this value, and doesn't report this failure to upper caller.
> > This patch is to fix this issue.
> >
> > Fixes: 2a8fa600445c ("ufs: manually add well known logical units")
> > Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
> > Signed-off-by: Bean Huo <beanhuo@micron.com>
> > ---
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
>
Sorry for noise, its not signed-off, please have my

Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>

> >  drivers/scsi/ufs/ufshcd.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> > index bea036ab189a..9a9085a7bcc5 100644
> > --- a/drivers/scsi/ufs/ufshcd.c
> > +++ b/drivers/scsi/ufs/ufshcd.c
> > @@ -7032,7 +7032,8 @@ static int ufshcd_probe_hba(struct ufs_hba *hba)
> >                         ufshcd_init_icc_levels(hba);
> >
> >                 /* Add required well known logical units to scsi mid layer */
> > -               if (ufshcd_scsi_add_wlus(hba))
> > +               ret = ufshcd_scsi_add_wlus(hba);
> > +               if (ret)
> >                         goto out;
> >
> >                 /* Initialize devfreq after UFS device is detected */
> > --
> > 2.17.1
> >
>
>
> --
> Regards,
> Alim
Stanley Chu Jan. 19, 2020, 9:55 a.m. UTC | #3
On Sun, 2020-01-19 at 01:13 +0100, Bean Huo wrote:
> From: Bean Huo <beanhuo@micron.com>
> 
> A non-zero error value likely being returned by ufshcd_scsi_add_wlus()
> in case of failure of adding the WLs, but ufshcd_probe_hba() doesn't
> use this value, and doesn't report this failure to upper caller.
> This patch is to fix this issue.
> 
> Fixes: 2a8fa600445c ("ufs: manually add well known logical units")
> Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
> Signed-off-by: Bean Huo <beanhuo@micron.com>

Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index bea036ab189a..9a9085a7bcc5 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -7032,7 +7032,8 @@  static int ufshcd_probe_hba(struct ufs_hba *hba)
 			ufshcd_init_icc_levels(hba);
 
 		/* Add required well known logical units to scsi mid layer */
-		if (ufshcd_scsi_add_wlus(hba))
+		ret = ufshcd_scsi_add_wlus(hba);
+		if (ret)
 			goto out;
 
 		/* Initialize devfreq after UFS device is detected */