diff mbox series

[5/6] scsi: ufs: show ufs part info in error case

Message ID 20200915204532.1672300-5-jaegeuk@kernel.org
State New
Headers show
Series [1/6] scsi: ufs: atomic update for clkgating_enable | expand

Commit Message

Jaegeuk Kim Sept. 15, 2020, 8:45 p.m. UTC
From: Jaegeuk Kim <jaegeuk@google.com>

This patch shows ufs part info in kernel messages for debugging purpose.
It's useful when we only have the last kernel message.

Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
---
 drivers/scsi/ufs/ufshcd.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Bean Huo Sept. 16, 2020, 10:34 a.m. UTC | #1
On Tue, 2020-09-15 at 13:45 -0700, Jaegeuk Kim wrote:
> Cc: Avri Altman <avri.altman@wdc.com>

> Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>

> ---

>  drivers/scsi/ufs/ufshcd.c | 8 ++++++++

>  1 file changed, 8 insertions(+)

> 

> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

> index bdc82cc3824aa..b81c116b976ff 100644

> --- a/drivers/scsi/ufs/ufshcd.c

> +++ b/drivers/scsi/ufs/ufshcd.c

> @@ -500,6 +500,14 @@ static void ufshcd_print_tmrs(struct ufs_hba

> *hba, unsigned long bitmap)

>  static void ufshcd_print_host_state(struct ufs_hba *hba)

>  {

>         dev_err(hba->dev, "UFS Host state=%d\n", hba->ufshcd_state);

> +       if (hba->sdev_ufs_device) {

> +               dev_err(hba->dev, " vendor = %.8s\n",

> +                                       hba->sdev_ufs_device-

> >vendor);

> +               dev_err(hba->dev, " model = %.16s\n",

> +                                       hba->sdev_ufs_device->model);

> +               dev_err(hba->dev, " rev = %.4s\n",

> +                                       hba->sdev_ufs_device->rev);

> +       }


Hi Jaegeuk
these prints have been added since this change:

commit 3f8af6044713 ("scsi: ufs: Add some debug information to
ufshcd_print_host_state()")                

https://patchwork.kernel.org/patch/11694371/

Thanks,
Bean
Jaegeuk Kim Sept. 16, 2020, 4:05 p.m. UTC | #2
On 09/16, Bean Huo wrote:
> On Tue, 2020-09-15 at 13:45 -0700, Jaegeuk Kim wrote:

> > Cc: Avri Altman <avri.altman@wdc.com>

> > Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>

> > ---

> >  drivers/scsi/ufs/ufshcd.c | 8 ++++++++

> >  1 file changed, 8 insertions(+)

> > 

> > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

> > index bdc82cc3824aa..b81c116b976ff 100644

> > --- a/drivers/scsi/ufs/ufshcd.c

> > +++ b/drivers/scsi/ufs/ufshcd.c

> > @@ -500,6 +500,14 @@ static void ufshcd_print_tmrs(struct ufs_hba

> > *hba, unsigned long bitmap)

> >  static void ufshcd_print_host_state(struct ufs_hba *hba)

> >  {

> >         dev_err(hba->dev, "UFS Host state=%d\n", hba->ufshcd_state);

> > +       if (hba->sdev_ufs_device) {

> > +               dev_err(hba->dev, " vendor = %.8s\n",

> > +                                       hba->sdev_ufs_device-

> > >vendor);

> > +               dev_err(hba->dev, " model = %.16s\n",

> > +                                       hba->sdev_ufs_device->model);

> > +               dev_err(hba->dev, " rev = %.4s\n",

> > +                                       hba->sdev_ufs_device->rev);

> > +       }

> 

> Hi Jaegeuk

> these prints have been added since this change:

> 

> commit 3f8af6044713 ("scsi: ufs: Add some debug information to

> ufshcd_print_host_state()")                

> 

> https://patchwork.kernel.org/patch/11694371/


Cool, thank you for pointing this out. BTW, which branch can I see the -next
patches?

> 

> Thanks,

> Bean
Can Guo Sept. 17, 2020, 12:54 a.m. UTC | #3
On 2020-09-17 00:05, Jaegeuk Kim wrote:
> On 09/16, Bean Huo wrote:

>> On Tue, 2020-09-15 at 13:45 -0700, Jaegeuk Kim wrote:

>> > Cc: Avri Altman <avri.altman@wdc.com>

>> > Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>

>> > ---

>> >  drivers/scsi/ufs/ufshcd.c | 8 ++++++++

>> >  1 file changed, 8 insertions(+)

>> >

>> > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

>> > index bdc82cc3824aa..b81c116b976ff 100644

>> > --- a/drivers/scsi/ufs/ufshcd.c

>> > +++ b/drivers/scsi/ufs/ufshcd.c

>> > @@ -500,6 +500,14 @@ static void ufshcd_print_tmrs(struct ufs_hba

>> > *hba, unsigned long bitmap)

>> >  static void ufshcd_print_host_state(struct ufs_hba *hba)

>> >  {

>> >         dev_err(hba->dev, "UFS Host state=%d\n", hba->ufshcd_state);

>> > +       if (hba->sdev_ufs_device) {

>> > +               dev_err(hba->dev, " vendor = %.8s\n",

>> > +                                       hba->sdev_ufs_device-

>> > >vendor);

>> > +               dev_err(hba->dev, " model = %.16s\n",

>> > +                                       hba->sdev_ufs_device->model);

>> > +               dev_err(hba->dev, " rev = %.4s\n",

>> > +                                       hba->sdev_ufs_device->rev);

>> > +       }

>> 

>> Hi Jaegeuk

>> these prints have been added since this change:

>> 

>> commit 3f8af6044713 ("scsi: ufs: Add some debug information to

>> ufshcd_print_host_state()")

>> 

>> https://patchwork.kernel.org/patch/11694371/

> 

> Cool, thank you for pointing this out. BTW, which branch can I see the 

> -next

> patches?

> 


Hi Jaegeuk,

This patch comes from a series of changes trying to fix and simplify
the UFS error handling. You can find the whole series here - they are
picked up on scsi-queue-5.10

https://lore.kernel.org/linux-scsi/1596975355-39813-10-git-send-email-cang@codeaurora.org/

Besides, several more fixes for error handling based on above series are

https://lore.kernel.org/patchwork/patch/1290405/
&
https://lore.kernel.org/linux-scsi/159961731708.5787.8825955850640714260.b4-ty@oracle.com/

I've mainline all above changes to Android12-5.4 and Android11-5.4.

Moreover, there are 2 more fixes on the way for error handling, I
will push them soon.

Thanks,

Can Guo.

>> 

>> Thanks,

>> Bean
Jaegeuk Kim Sept. 18, 2020, 4:13 a.m. UTC | #4
On 09/17, Can Guo wrote:
> On 2020-09-17 00:05, Jaegeuk Kim wrote:

> > On 09/16, Bean Huo wrote:

> > > On Tue, 2020-09-15 at 13:45 -0700, Jaegeuk Kim wrote:

> > > > Cc: Avri Altman <avri.altman@wdc.com>

> > > > Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>

> > > > ---

> > > >  drivers/scsi/ufs/ufshcd.c | 8 ++++++++

> > > >  1 file changed, 8 insertions(+)

> > > >

> > > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

> > > > index bdc82cc3824aa..b81c116b976ff 100644

> > > > --- a/drivers/scsi/ufs/ufshcd.c

> > > > +++ b/drivers/scsi/ufs/ufshcd.c

> > > > @@ -500,6 +500,14 @@ static void ufshcd_print_tmrs(struct ufs_hba

> > > > *hba, unsigned long bitmap)

> > > >  static void ufshcd_print_host_state(struct ufs_hba *hba)

> > > >  {

> > > >         dev_err(hba->dev, "UFS Host state=%d\n", hba->ufshcd_state);

> > > > +       if (hba->sdev_ufs_device) {

> > > > +               dev_err(hba->dev, " vendor = %.8s\n",

> > > > +                                       hba->sdev_ufs_device-

> > > > >vendor);

> > > > +               dev_err(hba->dev, " model = %.16s\n",

> > > > +                                       hba->sdev_ufs_device->model);

> > > > +               dev_err(hba->dev, " rev = %.4s\n",

> > > > +                                       hba->sdev_ufs_device->rev);

> > > > +       }

> > > 

> > > Hi Jaegeuk

> > > these prints have been added since this change:

> > > 

> > > commit 3f8af6044713 ("scsi: ufs: Add some debug information to

> > > ufshcd_print_host_state()")

> > > 

> > > https://patchwork.kernel.org/patch/11694371/

> > 

> > Cool, thank you for pointing this out. BTW, which branch can I see the

> > -next

> > patches?

> > 

> 

> Hi Jaegeuk,

> 

> This patch comes from a series of changes trying to fix and simplify

> the UFS error handling. You can find the whole series here - they are

> picked up on scsi-queue-5.10

> 

> https://lore.kernel.org/linux-scsi/1596975355-39813-10-git-send-email-cang@codeaurora.org/

> 

> Besides, several more fixes for error handling based on above series are

> 

> https://lore.kernel.org/patchwork/patch/1290405/

> &

> https://lore.kernel.org/linux-scsi/159961731708.5787.8825955850640714260.b4-ty@oracle.com/

> 

> I've mainline all above changes to Android12-5.4 and Android11-5.4.


I've seen the patches in Android branches. Thank you for the explanation.

> 

> Moreover, there are 2 more fixes on the way for error handling, I

> will push them soon.


BTW, could you please take a look at these patches?

Thanks,

> 

> Thanks,

> 

> Can Guo.

> 

> > > 

> > > Thanks,

> > > Bean
Can Guo Sept. 22, 2020, 5:30 a.m. UTC | #5
On 2020-09-18 12:13, Jaegeuk Kim wrote:
> On 09/17, Can Guo wrote:

>> On 2020-09-17 00:05, Jaegeuk Kim wrote:

>> > On 09/16, Bean Huo wrote:

>> > > On Tue, 2020-09-15 at 13:45 -0700, Jaegeuk Kim wrote:

>> > > > Cc: Avri Altman <avri.altman@wdc.com>

>> > > > Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>

>> > > > ---

>> > > >  drivers/scsi/ufs/ufshcd.c | 8 ++++++++

>> > > >  1 file changed, 8 insertions(+)

>> > > >

>> > > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c

>> > > > index bdc82cc3824aa..b81c116b976ff 100644

>> > > > --- a/drivers/scsi/ufs/ufshcd.c

>> > > > +++ b/drivers/scsi/ufs/ufshcd.c

>> > > > @@ -500,6 +500,14 @@ static void ufshcd_print_tmrs(struct ufs_hba

>> > > > *hba, unsigned long bitmap)

>> > > >  static void ufshcd_print_host_state(struct ufs_hba *hba)

>> > > >  {

>> > > >         dev_err(hba->dev, "UFS Host state=%d\n", hba->ufshcd_state);

>> > > > +       if (hba->sdev_ufs_device) {

>> > > > +               dev_err(hba->dev, " vendor = %.8s\n",

>> > > > +                                       hba->sdev_ufs_device-

>> > > > >vendor);

>> > > > +               dev_err(hba->dev, " model = %.16s\n",

>> > > > +                                       hba->sdev_ufs_device->model);

>> > > > +               dev_err(hba->dev, " rev = %.4s\n",

>> > > > +                                       hba->sdev_ufs_device->rev);

>> > > > +       }

>> > >

>> > > Hi Jaegeuk

>> > > these prints have been added since this change:

>> > >

>> > > commit 3f8af6044713 ("scsi: ufs: Add some debug information to

>> > > ufshcd_print_host_state()")

>> > >

>> > > https://patchwork.kernel.org/patch/11694371/

>> >

>> > Cool, thank you for pointing this out. BTW, which branch can I see the

>> > -next

>> > patches?

>> >

>> 

>> Hi Jaegeuk,

>> 

>> This patch comes from a series of changes trying to fix and simplify

>> the UFS error handling. You can find the whole series here - they are

>> picked up on scsi-queue-5.10

>> 

>> https://lore.kernel.org/linux-scsi/1596975355-39813-10-git-send-email-cang@codeaurora.org/

>> 

>> Besides, several more fixes for error handling based on above series 

>> are

>> 

>> https://lore.kernel.org/patchwork/patch/1290405/

>> &

>> https://lore.kernel.org/linux-scsi/159961731708.5787.8825955850640714260.b4-ty@oracle.com/

>> 

>> I've mainline all above changes to Android12-5.4 and Android11-5.4.

> 

> I've seen the patches in Android branches. Thank you for the 

> explanation.

> 

>> 

>> Moreover, there are 2 more fixes on the way for error handling, I

>> will push them soon.

> 

> BTW, could you please take a look at these patches?

> 

> Thanks,

> 


Sure, but since I am not in your cc or to list, so I don't know which
patches. Maybe you can add me when you push the next version? Thanks.

Regards,

Can Guo.

>> 

>> Thanks,

>> 

>> Can Guo.

>> 

>> > >

>> > > Thanks,

>> > > Bean
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index bdc82cc3824aa..b81c116b976ff 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -500,6 +500,14 @@  static void ufshcd_print_tmrs(struct ufs_hba *hba, unsigned long bitmap)
 static void ufshcd_print_host_state(struct ufs_hba *hba)
 {
 	dev_err(hba->dev, "UFS Host state=%d\n", hba->ufshcd_state);
+	if (hba->sdev_ufs_device) {
+		dev_err(hba->dev, " vendor = %.8s\n",
+					hba->sdev_ufs_device->vendor);
+		dev_err(hba->dev, " model = %.16s\n",
+					hba->sdev_ufs_device->model);
+		dev_err(hba->dev, " rev = %.4s\n",
+					hba->sdev_ufs_device->rev);
+	}
 	dev_err(hba->dev, "outstanding reqs=0x%lx tasks=0x%lx\n",
 		hba->outstanding_reqs, hba->outstanding_tasks);
 	dev_err(hba->dev, "saved_err=0x%x, saved_uic_err=0x%x\n",