Skip to content

Commit f76e667

Browse files
committed
Merge: scsi: storvsc: Increase the timeouts to storvsc_timeout
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7161 JIRA: https://issues.redhat.com/browse/RHEL-100669 Currently storvsc_timeout is only used in storvsc_sdev_configure(), and 5s and 10s are used elsewhere. It turns out that rarely the 5s is not enough on Azure, so let's use storvsc_timeout everywhere. In case a timeout happens and storvsc_channel_init() returns an error, close the VMBus channel so that any host-to-guest messages in the channel's ringbuffer, which might come late, can be safely ignored. Add a "const" to storvsc_timeout. Cc: stable@kernel.org Signed-off-by: Dexuan Cui <decui@microsoft.com> Link: https://lore.kernel.org/r/1749243459-10419-1-git-send-email-decui@microsoft.com Reviewed-by: Long Li <longli@microsoft.com> Signed-off-by: Martin K. Petersen's Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit b2f9665) Signed-off-by: Xuemin Li <xuli@redhat.com> Approved-by: Ani Sinha <anisinha@redhat.com> Approved-by: Maxim Levitsky <mlevitsk@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents a6f311b + 53f0e75 commit f76e667

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/scsi/storvsc_drv.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ MODULE_PARM_DESC(ring_avail_percent_lowater,
362362
/*
363363
* Timeout in seconds for all devices managed by this driver.
364364
*/
365-
static int storvsc_timeout = 180;
365+
static const int storvsc_timeout = 180;
366366

367367
#if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
368368
static struct scsi_transport_template *fc_transport_template;
@@ -768,7 +768,7 @@ static void handle_multichannel_storage(struct hv_device *device, int max_chns)
768768
return;
769769
}
770770

771-
t = wait_for_completion_timeout(&request->wait_event, 10*HZ);
771+
t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ);
772772
if (t == 0) {
773773
dev_err(dev, "Failed to create sub-channel: timed out\n");
774774
return;
@@ -833,7 +833,7 @@ static int storvsc_execute_vstor_op(struct hv_device *device,
833833
if (ret != 0)
834834
return ret;
835835

836-
t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
836+
t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ);
837837
if (t == 0)
838838
return -ETIMEDOUT;
839839

@@ -1350,6 +1350,8 @@ static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size,
13501350
return ret;
13511351

13521352
ret = storvsc_channel_init(device, is_fc);
1353+
if (ret)
1354+
vmbus_close(device->channel);
13531355

13541356
return ret;
13551357
}
@@ -1667,7 +1669,7 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
16671669
if (ret != 0)
16681670
return FAILED;
16691671

1670-
t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
1672+
t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ);
16711673
if (t == 0)
16721674
return TIMEOUT_ERROR;
16731675

0 commit comments

Comments
 (0)