From: Bart Van Assche Date: Mon, 12 Feb 2018 18:57:52 +0000 (-0800) Subject: scsi: core: Reduce number of scsi_test_unit_ready() retries X-Git-Tag: Ubuntu-5.2.0-15.16~4680^2~122 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9b91fd34b46ded81232de3ce41b9b662ec74b07f;p=mirror_ubuntu-eoan-kernel.git scsi: core: Reduce number of scsi_test_unit_ready() retries 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 Reviewed-by: Hannes Reinecke Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index a86df9ca7d1c..aea5a1ae318b 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;