diff mbox series

[2/2] usb: storage: scsiglue: Do not skip VPD if try_vpd_pages is set

Message ID 20190618013146.21961-3-marcos.souza.org@gmail.com (mailing list archive)
State New, archived
Headers show
Series None | expand

Commit Message

Marcos Paulo de Souza June 18, 2019, 1:31 a.m. UTC
If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
be honored, so only set skip_vpd_pages is try_vpd_pages is not set.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
---
 drivers/usb/storage/scsiglue.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Greg KH June 18, 2019, 6:49 a.m. UTC | #1
On Mon, Jun 17, 2019 at 10:31:46PM -0300, Marcos Paulo de Souza wrote:
> If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
> be honored, so only set skip_vpd_pages is try_vpd_pages is not set.
> 
> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> ---
>  drivers/usb/storage/scsiglue.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)

Where is patch 1/2 of this series?

confused,

greg k-h
Marcos Paulo de Souza June 18, 2019, 10:30 a.m. UTC | #2
On Tue, Jun 18, 2019 at 08:49:47AM +0200, Greg Kroah-Hartman wrote:
> On Mon, Jun 17, 2019 at 10:31:46PM -0300, Marcos Paulo de Souza wrote:
> > If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
> > be honored, so only set skip_vpd_pages is try_vpd_pages is not set.
> > 
> > Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> > ---
> >  drivers/usb/storage/scsiglue.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> Where is patch 1/2 of this series?

You can find it here:
https://lore.kernel.org/lkml/20190618013146.21961-2-marcos.souza.org@gmail.com/

> 
> confused,
> 
> greg k-h
Greg KH June 18, 2019, 10:52 a.m. UTC | #3
On Tue, Jun 18, 2019 at 07:30:04AM -0300, Marcos Paulo de Souza wrote:
> On Tue, Jun 18, 2019 at 08:49:47AM +0200, Greg Kroah-Hartman wrote:
> > On Mon, Jun 17, 2019 at 10:31:46PM -0300, Marcos Paulo de Souza wrote:
> > > If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
> > > be honored, so only set skip_vpd_pages is try_vpd_pages is not set.
> > > 
> > > Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> > > ---
> > >  drivers/usb/storage/scsiglue.c | 7 +++++--
> > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > Where is patch 1/2 of this series?
> 
> You can find it here:
> https://lore.kernel.org/lkml/20190618013146.21961-2-marcos.souza.org@gmail.com/

So is this 2/2 patch independant of 1/2 and can go throught the USB
tree, or do they both need to be together?

As it is, I have no idea what to do with this patch :(

thanks,

greg k-h
Marcos Paulo de Souza June 18, 2019, 10:56 a.m. UTC | #4
On Tue, Jun 18, 2019 at 12:52:03PM +0200, Greg Kroah-Hartman wrote:
> On Tue, Jun 18, 2019 at 07:30:04AM -0300, Marcos Paulo de Souza wrote:
> > On Tue, Jun 18, 2019 at 08:49:47AM +0200, Greg Kroah-Hartman wrote:
> > > On Mon, Jun 17, 2019 at 10:31:46PM -0300, Marcos Paulo de Souza wrote:
> > > > If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
> > > > be honored, so only set skip_vpd_pages is try_vpd_pages is not set.
> > > > 
> > > > Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> > > > ---
> > > >  drivers/usb/storage/scsiglue.c | 7 +++++--
> > > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > > 
> > > Where is patch 1/2 of this series?
> > 
> > You can find it here:
> > https://lore.kernel.org/lkml/20190618013146.21961-2-marcos.souza.org@gmail.com/
> 
> So is this 2/2 patch independant of 1/2 and can go throught the USB
> tree, or do they both need to be together?

I think it is, since we are not dealing with something specific to a device in
this patch.

> 
> As it is, I have no idea what to do with this patch :(
Sorry, I relied in get_maintainer.pl only, so you weren't CCed in both patches.
But feel free to grab this patch in your tree.
> 
> thanks,
> 
> greg k-h
Alan Stern June 18, 2019, 1:48 p.m. UTC | #5
On Mon, 17 Jun 2019, Marcos Paulo de Souza wrote:

> If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
> be honored, so only set skip_vpd_pages is try_vpd_pages is not set.
> 
> Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> ---
>  drivers/usb/storage/scsiglue.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> index 59190d88fa9f..0a9520780771 100644
> --- a/drivers/usb/storage/scsiglue.c
> +++ b/drivers/usb/storage/scsiglue.c
> @@ -195,8 +195,11 @@ static int slave_configure(struct scsi_device *sdev)
>  		 */
>  		sdev->skip_ms_page_8 = 1;
>  
> -		/* Some devices don't handle VPD pages correctly */
> -		sdev->skip_vpd_pages = 1;
> +		/*
> +		 * Some devices don't handle VPD pages correctly, so skip vpd
> +		 * pages if not forced by SCSI layer.
> +		 */
> +		sdev->skip_vpd_pages = sdev->try_vpd_pages == 0;
>  
>  		/* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
>  		sdev->no_report_opcodes = 1;

Acked-by: Alan Stern <stern@rowland.harvard.edu>

Although I think it would be clearer to write:

		sdev->skip_vpd_pages = !sdev->try_vpd_pages;

But that's just personal preference.  This is okay as it is.

Alan Stern
Marcos Paulo de Souza June 18, 2019, 3:17 p.m. UTC | #6
On Tue, Jun 18, 2019 at 09:48:01AM -0400, Alan Stern wrote:
> On Mon, 17 Jun 2019, Marcos Paulo de Souza wrote:
> 
> > If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
> > be honored, so only set skip_vpd_pages is try_vpd_pages is not set.
> > 
> > Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> > ---
> >  drivers/usb/storage/scsiglue.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> > index 59190d88fa9f..0a9520780771 100644
> > --- a/drivers/usb/storage/scsiglue.c
> > +++ b/drivers/usb/storage/scsiglue.c
> > @@ -195,8 +195,11 @@ static int slave_configure(struct scsi_device *sdev)
> >  		 */
> >  		sdev->skip_ms_page_8 = 1;
> >  
> > -		/* Some devices don't handle VPD pages correctly */
> > -		sdev->skip_vpd_pages = 1;
> > +		/*
> > +		 * Some devices don't handle VPD pages correctly, so skip vpd
> > +		 * pages if not forced by SCSI layer.
> > +		 */
> > +		sdev->skip_vpd_pages = sdev->try_vpd_pages == 0;
> >  
> >  		/* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
> >  		sdev->no_report_opcodes = 1;
> 
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> 
> Although I think it would be clearer to write:
> 
> 		sdev->skip_vpd_pages = !sdev->try_vpd_pages;

I agree. Greg, would you like me to send a v2 of this patch with this change, or
can you apply the change suggested by Alan?

Thanks,
Marcos

> 
> But that's just personal preference.  This is okay as it is.
> 
> Alan Stern
>
Greg KH June 18, 2019, 4:07 p.m. UTC | #7
On Tue, Jun 18, 2019 at 12:17:39PM -0300, Marcos Paulo de Souza wrote:
> On Tue, Jun 18, 2019 at 09:48:01AM -0400, Alan Stern wrote:
> > On Mon, 17 Jun 2019, Marcos Paulo de Souza wrote:
> > 
> > > If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
> > > be honored, so only set skip_vpd_pages is try_vpd_pages is not set.
> > > 
> > > Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> > > ---
> > >  drivers/usb/storage/scsiglue.c | 7 +++++--
> > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> > > index 59190d88fa9f..0a9520780771 100644
> > > --- a/drivers/usb/storage/scsiglue.c
> > > +++ b/drivers/usb/storage/scsiglue.c
> > > @@ -195,8 +195,11 @@ static int slave_configure(struct scsi_device *sdev)
> > >  		 */
> > >  		sdev->skip_ms_page_8 = 1;
> > >  
> > > -		/* Some devices don't handle VPD pages correctly */
> > > -		sdev->skip_vpd_pages = 1;
> > > +		/*
> > > +		 * Some devices don't handle VPD pages correctly, so skip vpd
> > > +		 * pages if not forced by SCSI layer.
> > > +		 */
> > > +		sdev->skip_vpd_pages = sdev->try_vpd_pages == 0;
> > >  
> > >  		/* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
> > >  		sdev->no_report_opcodes = 1;
> > 
> > Acked-by: Alan Stern <stern@rowland.harvard.edu>
> > 
> > Although I think it would be clearer to write:
> > 
> > 		sdev->skip_vpd_pages = !sdev->try_vpd_pages;
> 
> I agree. Greg, would you like me to send a v2 of this patch with this change, or
> can you apply the change suggested by Alan?

I do not hand-edit patches, sorry.  It does not scale, please resend.

greg k-h
Marcos Paulo de Souza June 18, 2019, 10:46 p.m. UTC | #8
On Tue, Jun 18, 2019 at 06:07:24PM +0200, Greg Kroah-Hartman wrote:
> On Tue, Jun 18, 2019 at 12:17:39PM -0300, Marcos Paulo de Souza wrote:
> > On Tue, Jun 18, 2019 at 09:48:01AM -0400, Alan Stern wrote:
> > > On Mon, 17 Jun 2019, Marcos Paulo de Souza wrote:
> > > 
> > > > If BLIST_TRY_VPD_PAGES is set for a device, even for an USB, it should
> > > > be honored, so only set skip_vpd_pages is try_vpd_pages is not set.
> > > > 
> > > > Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
> > > > ---
> > > >  drivers/usb/storage/scsiglue.c | 7 +++++--
> > > >  1 file changed, 5 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
> > > > index 59190d88fa9f..0a9520780771 100644
> > > > --- a/drivers/usb/storage/scsiglue.c
> > > > +++ b/drivers/usb/storage/scsiglue.c
> > > > @@ -195,8 +195,11 @@ static int slave_configure(struct scsi_device *sdev)
> > > >  		 */
> > > >  		sdev->skip_ms_page_8 = 1;
> > > >  
> > > > -		/* Some devices don't handle VPD pages correctly */
> > > > -		sdev->skip_vpd_pages = 1;
> > > > +		/*
> > > > +		 * Some devices don't handle VPD pages correctly, so skip vpd
> > > > +		 * pages if not forced by SCSI layer.
> > > > +		 */
> > > > +		sdev->skip_vpd_pages = sdev->try_vpd_pages == 0;
> > > >  
> > > >  		/* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
> > > >  		sdev->no_report_opcodes = 1;
> > > 
> > > Acked-by: Alan Stern <stern@rowland.harvard.edu>
> > > 
> > > Although I think it would be clearer to write:
> > > 
> > > 		sdev->skip_vpd_pages = !sdev->try_vpd_pages;
> > 
> > I agree. Greg, would you like me to send a v2 of this patch with this change, or
> > can you apply the change suggested by Alan?
> 
> I do not hand-edit patches, sorry.  It does not scale, please resend.

No problem, v2 just sent:
https://lore.kernel.org/linux-usb/20190618224454.16595-1-marcos.souza.org@gmail.com/T/#u

Thanks Alan for the quick review!

> 
> greg k-h
diff mbox series

Patch

diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 59190d88fa9f..0a9520780771 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -195,8 +195,11 @@  static int slave_configure(struct scsi_device *sdev)
 		 */
 		sdev->skip_ms_page_8 = 1;
 
-		/* Some devices don't handle VPD pages correctly */
-		sdev->skip_vpd_pages = 1;
+		/*
+		 * Some devices don't handle VPD pages correctly, so skip vpd
+		 * pages if not forced by SCSI layer.
+		 */
+		sdev->skip_vpd_pages = sdev->try_vpd_pages == 0;
 
 		/* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
 		sdev->no_report_opcodes = 1;