From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E929F2222B2; Mon, 23 Jun 2025 22:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750717541; cv=none; b=iTsR51WL/DdHVBUFBnwSZp68rRwYSoTw2OML/XHoiaDfUZ/i9fP8nlupTRFUkZvAM+6VjNZIS1xMZ/YyKyNfq8xhnpsdJHjJGVS5At3udoNyL5UKq/LvcmKsoKxJPiQ+heMCFPbyx7TftkgNZETOCDSZTHJ7Vf66joX39kjJAJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750717541; c=relaxed/simple; bh=gxo5bcogfSEkzGMn9gMHwcpcgUQygaOiW44ognuHwIg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pn1GGpEp3ZUm9cxV4zyDCGZik/ro07XGFmnYEqAPUgxBY1YDF8uxbPR56FPzw3RJyd9Lm36oIZDEDLHrOV77g5uW/oGnFcY29oBlCeQ4fzzAO834IhgXqfnRPbqb2G7mWVxn/MIFCcDka/F4YXoogMLSYR0GzwFHAi2LrH0Suec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XAL4pSjR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XAL4pSjR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7939EC4CEED; Mon, 23 Jun 2025 22:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750717540; bh=gxo5bcogfSEkzGMn9gMHwcpcgUQygaOiW44ognuHwIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XAL4pSjRwoWe20m0T6WAUam2969nwKLyE6kdog/gpTPiYkZjUr25NzOz/A9wBmlYA 2J1+UugIq+Bn9A0Zhmb7M2lJXJKKARdxTzGQkPwxUpOAa6aGOzzr3rr6zcXr5EuGzz lDfHvjwDehj2UZ1eGEgC+MRlaBpklU8CI6XTKtRE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Dexuan Cui , Long Li , "Martin K. Petersen" Subject: [PATCH 6.1 449/508] scsi: storvsc: Increase the timeouts to storvsc_timeout Date: Mon, 23 Jun 2025 15:08:14 +0200 Message-ID: <20250623130656.201354636@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130645.255320792@linuxfoundation.org> References: <20250623130645.255320792@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dexuan Cui commit b2f966568faaad326de97481096d0f3dc0971c43 upstream. 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 Link: https://lore.kernel.org/r/1749243459-10419-1-git-send-email-decui@microsoft.com Reviewed-by: Long Li Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/storvsc_drv.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -358,7 +358,7 @@ MODULE_PARM_DESC(ring_avail_percent_lowa /* * 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; @@ -764,7 +764,7 @@ static void handle_multichannel_storage 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; @@ -829,7 +829,7 @@ static int storvsc_execute_vstor_op(stru 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; @@ -1342,6 +1342,8 @@ static int storvsc_connect_to_vsp(struct return ret; ret = storvsc_channel_init(device, is_fc); + if (ret) + vmbus_close(device->channel); return ret; } @@ -1659,7 +1661,7 @@ static int storvsc_host_reset_handler(st 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;