Linux USB
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org,
	Joao Machado <jocrismachado@gmail.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Christian Heusel <christian@heusel.eu>,
	stable@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 2/2] scsi: core: Do not query IO hints for USB devices
Date: Wed, 12 Jun 2024 12:30:34 -0700	[thread overview]
Message-ID: <a7ac0431-2b30-43bf-bb90-1476e33aa6cd@acm.org> (raw)
In-Reply-To: <de4492b5-a681-42bf-99d7-e9ba30dabeb2@rowland.harvard.edu>

On 6/12/24 11:08 AM, Alan Stern wrote:
> You might want to do the same thing in uas.c.  I don't know if UAS
> devices suffer from the same problem, but it wouldn't be surprising if
> they do.

Hi Alan,

How about replacing patch 2/2 from this series with the patch below?

Thanks,

Bart.

diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index b31464740f6c..b4cf0349fd0d 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -79,6 +79,12 @@ static int slave_alloc (struct scsi_device *sdev)
  	if (us->protocol == USB_PR_BULK && us->max_lun > 0)
  		sdev->sdev_bflags |= BLIST_FORCELUN;

+	/*
+	 * Some USB storage devices reset if the IO hints VPD page is queried.
+	 * Hence skip that VPD page.
+	 */
+	sdev->sdev_bflags |= BLIST_SKIP_IO_HINTS;
+
  	return 0;
  }

diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c
index a48870a87a29..bb75901b53e3 100644
--- a/drivers/usb/storage/uas.c
+++ b/drivers/usb/storage/uas.c
@@ -820,6 +820,12 @@ static int uas_slave_alloc(struct scsi_device *sdev)
  	struct uas_dev_info *devinfo =
  		(struct uas_dev_info *)sdev->host->hostdata;

+	/*
+	 * Some USB storage devices reset if the IO hints VPD page is queried.
+	 * Hence skip that VPD page.
+	 */
+	sdev->sdev_bflags |= BLIST_SKIP_IO_HINTS;
+
  	sdev->hostdata = devinfo;
  	return 0;
  }


  reply	other threads:[~2024-06-12 19:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12 16:52 [PATCH 0/2] Do not read the IO hints VPD page from USB storage devices Bart Van Assche
2024-06-12 16:52 ` [PATCH 1/2] scsi: core: Introduce the BLIST_SKIP_IO_HINTS flag Bart Van Assche
2024-06-12 16:52 ` [PATCH 2/2] scsi: core: Do not query IO hints for USB devices Bart Van Assche
2024-06-12 18:08   ` Alan Stern
2024-06-12 19:30     ` Bart Van Assche [this message]
2024-06-12 19:43       ` Alan Stern
2024-06-13 17:44   ` Andy Shevchenko
2024-06-13 18:10     ` Bart Van Assche
2024-06-13 19:44       ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7ac0431-2b30-43bf-bb90-1476e33aa6cd@acm.org \
    --to=bvanassche@acm.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=christian@heusel.eu \
    --cc=gregkh@linuxfoundation.org \
    --cc=jocrismachado@gmail.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox