* [PATCH] Reduce number of scsi_test_unit_ready() retries
@ 2018-02-12 18:57 Bart Van Assche
2018-02-13 9:26 ` Hannes Reinecke
2018-02-14 2:44 ` Martin K. Petersen
0 siblings, 2 replies; 3+ messages in thread
From: Bart Van Assche @ 2018-02-12 18:57 UTC (permalink / raw)
To: Martin K . Petersen, James E . J . Bottomley; +Cc: linux-scsi, Bart Van Assche
Make scsi_test_unit_ready() send at most as many TURs as specified
in the 'retries' argument instead of retries * (retries + 1) / 2.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
---
drivers/scsi/scsi_lib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index b03cb2d5b733..9c793090dbf1 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2607,7 +2607,7 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries,
/* try to eat the UNIT_ATTENTION if there are enough retries */
do {
result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr,
- timeout, retries, NULL);
+ timeout, 1, NULL);
if (sdev->removable && scsi_sense_valid(sshdr) &&
sshdr->sense_key == UNIT_ATTENTION)
sdev->changed = 1;
--
2.16.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Reduce number of scsi_test_unit_ready() retries
2018-02-12 18:57 [PATCH] Reduce number of scsi_test_unit_ready() retries Bart Van Assche
@ 2018-02-13 9:26 ` Hannes Reinecke
2018-02-14 2:44 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Hannes Reinecke @ 2018-02-13 9:26 UTC (permalink / raw)
To: Bart Van Assche, Martin K . Petersen, James E . J . Bottomley; +Cc: linux-scsi
On 02/12/2018 07:57 PM, Bart Van Assche wrote:
> Make scsi_test_unit_ready() send at most as many TURs as specified
> in the 'retries' argument instead of retries * (retries + 1) / 2.
>
> Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
> ---
> drivers/scsi/scsi_lib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index b03cb2d5b733..9c793090dbf1 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -2607,7 +2607,7 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries,
> /* try to eat the UNIT_ATTENTION if there are enough retries */
> do {
> result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr,
> - timeout, retries, NULL);
> + timeout, 1, NULL);
> if (sdev->removable && scsi_sense_valid(sshdr) &&
> sshdr->sense_key == UNIT_ATTENTION)
> sdev->changed = 1;
>
At one point we _really_ need to clean up BLOCK_PC command handling.
This 'some parts are handled by the core, some parts need to be
evaluated by the caller' magic is driving my nuts :-(
Anyway.
Reviewed-by: Hannes Reinecke <hare@suse.com>
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Reduce number of scsi_test_unit_ready() retries
2018-02-12 18:57 [PATCH] Reduce number of scsi_test_unit_ready() retries Bart Van Assche
2018-02-13 9:26 ` Hannes Reinecke
@ 2018-02-14 2:44 ` Martin K. Petersen
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2018-02-14 2:44 UTC (permalink / raw)
To: Bart Van Assche; +Cc: Martin K . Petersen, James E . J . Bottomley, linux-scsi
Bart,
> Make scsi_test_unit_ready() send at most as many TURs as specified
> in the 'retries' argument instead of retries * (retries + 1) / 2.
Applied to 4.17/scsi-queue, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-14 2:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-12 18:57 [PATCH] Reduce number of scsi_test_unit_ready() retries Bart Van Assche
2018-02-13 9:26 ` Hannes Reinecke
2018-02-14 2:44 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox