Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ MODULE_PARM_DESC(ring_avail_percent_lowater,
/*
* Timeout in seconds for all devices managed by this driver.
*/
static int storvsc_timeout = 180;
static const int storvsc_timeout = 180;

#if IS_ENABLED(CONFIG_SCSI_FC_ATTRS)
static struct scsi_transport_template *fc_transport_template;
Expand Down Expand Up @@ -762,7 +762,7 @@ static void handle_multichannel_storage(struct hv_device *device, int max_chns)
return;
}

t = wait_for_completion_timeout(&request->wait_event, 10*HZ);
t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ);
if (t == 0) {
dev_err(dev, "Failed to create sub-channel: timed out\n");
return;
Expand Down Expand Up @@ -827,7 +827,7 @@ static int storvsc_execute_vstor_op(struct hv_device *device,
if (ret != 0)
return ret;

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

Expand Down Expand Up @@ -1345,6 +1345,8 @@ static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size,
return ret;

ret = storvsc_channel_init(device, is_fc);
if (ret)
vmbus_close(device->channel);

return ret;
}
Expand Down Expand Up @@ -1662,7 +1664,7 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
if (ret != 0)
return FAILED;

t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
t = wait_for_completion_timeout(&request->wait_event, storvsc_timeout * HZ);
if (t == 0)
return TIMEOUT_ERROR;

Expand Down