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 ACE64223DEF; Mon, 23 Jun 2025 22:11:11 +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=1750716671; cv=none; b=nxv0gUHMhSekXcyEfcpFsv6rfe7ZSdEZkhOo2ymyiFmRHsbJhHy3s7Zm1yUIcIckwtgZGqC02sngqvHHdOPCRPGrfeV1nYheBywPAVwrmIu53nKsfDIavEH4/hef5JQjptcyxqRfWfahetUIy368mQFEL0dA3T9u9sAlcjR9ir0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750716671; c=relaxed/simple; bh=+H/icuFlwsUQPzrYjNBP+FeQwMR3XwEwvn+pMa3JIF4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p0wd70oFNNWIJel6cIF9sYXoSStzrnHJz1HQEeWyEztzW6d88ZIMVTIV0teGllJAN+/P60WnxTmtyLrW+A0JdnBZGf6A2SxFNViANkj6uP0Jpt0fkpDwJlAONwRWcMWV4Z45SlfDE8cazbAh9arvYC1nvsg9sys8nEXiqP1H+5Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=o11z8B0x; 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="o11z8B0x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 455CCC4CEEA; Mon, 23 Jun 2025 22:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750716671; bh=+H/icuFlwsUQPzrYjNBP+FeQwMR3XwEwvn+pMa3JIF4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o11z8B0xzgPDE5DsmtjHJ2Ek9gss68u1h0ZBal8FC+cbtKGAoipsRkV2AneDymDZy oIDf+PrUzEXHWetd27hdctjIwU09etQByiehuPJ3Xo7Co2lovtbTNYA5NraD6rsinc yzraptiLDY/2dFnxe7RHFjBnKGBIi2GnzJC+po8c= 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 5.15 349/411] scsi: storvsc: Increase the timeouts to storvsc_timeout Date: Mon, 23 Jun 2025 15:08:13 +0200 Message-ID: <20250623130642.432437050@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130632.993849527@linuxfoundation.org> References: <20250623130632.993849527@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-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 @@ -399,7 +399,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; @@ -819,7 +819,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; @@ -885,7 +885,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; @@ -1398,6 +1398,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; } @@ -1719,7 +1721,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;