Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] usb: storage: scsiglue: Do not skip VPD if try_vpd_pages is set
@ 2019-06-18 22:44 Marcos Paulo de Souza
  2019-06-25 16:57 ` Marcos Paulo de Souza
  2019-07-02 22:58 ` Marcos Paulo de Souza
  0 siblings, 2 replies; 3+ messages in thread
From: Marcos Paulo de Souza @ 2019-06-18 22:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: Marcos Paulo de Souza, Alan Stern, Greg Kroah-Hartman, linux-usb,
	usb-storage

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>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
---

 Changes from v1:
 changed the check of try_vpd_pages from:
 	sdev->try_vpd_pages == 0;
 to:
 	!sdev->try_vpd_pages;
 (as suggested by Alan Stern)

 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..30790240aec6 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;
 
 		/* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
 		sdev->no_report_opcodes = 1;
-- 
2.21.0


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

* Re: [PATCH v2] usb: storage: scsiglue: Do not skip VPD if try_vpd_pages is set
  2019-06-18 22:44 [PATCH v2] usb: storage: scsiglue: Do not skip VPD if try_vpd_pages is set Marcos Paulo de Souza
@ 2019-06-25 16:57 ` Marcos Paulo de Souza
  2019-07-02 22:58 ` Marcos Paulo de Souza
  1 sibling, 0 replies; 3+ messages in thread
From: Marcos Paulo de Souza @ 2019-06-25 16:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alan Stern, Greg Kroah-Hartman,
	open list:USB MASS STORAGE DRIVER,
	open list:USB MASS STORAGE DRIVER

humble ping :)

On Tue, Jun 18, 2019 at 07:44:54PM -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>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> ---
> 
>  Changes from v1:
>  changed the check of try_vpd_pages from:
>  	sdev->try_vpd_pages == 0;
>  to:
>  	!sdev->try_vpd_pages;
>  (as suggested by Alan Stern)
> 
>  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..30790240aec6 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;
>  
>  		/* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
>  		sdev->no_report_opcodes = 1;
> -- 
> 2.21.0
> 

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

* Re: [PATCH v2] usb: storage: scsiglue: Do not skip VPD if try_vpd_pages is set
  2019-06-18 22:44 [PATCH v2] usb: storage: scsiglue: Do not skip VPD if try_vpd_pages is set Marcos Paulo de Souza
  2019-06-25 16:57 ` Marcos Paulo de Souza
@ 2019-07-02 22:58 ` Marcos Paulo de Souza
  1 sibling, 0 replies; 3+ messages in thread
From: Marcos Paulo de Souza @ 2019-07-02 22:58 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alan Stern, Greg Kroah-Hartman,
	open list:USB MASS STORAGE DRIVER,
	open list:USB MASS STORAGE DRIVER

ping?

On Tue, Jun 18, 2019 at 07:44:54PM -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>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> ---
> 
>  Changes from v1:
>  changed the check of try_vpd_pages from:
>  	sdev->try_vpd_pages == 0;
>  to:
>  	!sdev->try_vpd_pages;
>  (as suggested by Alan Stern)
> 
>  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..30790240aec6 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;
>  
>  		/* Do not attempt to use REPORT SUPPORTED OPERATION CODES */
>  		sdev->no_report_opcodes = 1;
> -- 
> 2.21.0
> 

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 22:44 [PATCH v2] usb: storage: scsiglue: Do not skip VPD if try_vpd_pages is set Marcos Paulo de Souza
2019-06-25 16:57 ` Marcos Paulo de Souza
2019-07-02 22:58 ` Marcos Paulo de Souza

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox