From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFBD6263F44 for ; Tue, 17 Feb 2026 07:09:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771312182; cv=none; b=W3G66KYckgVJk9lJ9uWz14rscdZbAw616YUIE5+d/UcL+e2DPD8xFP8TGDQyy238Fbbx/93uM0EPkFa0tG6mbofx/NX9i9Jz8mz8SWMP50T4J0hL3PGYzEgPRAn2ejw80SAkLgH8RD5FuJJobUFC9ZzMS5fj9ecOd/FOYZkP5T0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771312182; c=relaxed/simple; bh=lRhdVxYvkL94iM2/okk3qucmjYvB1ellr9v2vFqAyPY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jVJbVaL+5HXKWu27+Tajlg0d7YgQ9wvR6HGHvDKK7r/ppjX8v7m4zsa8tNttpfmZfnvalnxKJrs1ksexGOq3BOWGcqrzxP/YpFRIj5okh/mCDJRJ2CAV9473eTlEzIn0+q73uw/zkf08YORWrjXoDSg1P8QHzteUWrFlpEyzjNk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=qDwu5gOa; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Bs0Xkhcq; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=qDwu5gOa; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Bs0Xkhcq; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="qDwu5gOa"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Bs0Xkhcq"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="qDwu5gOa"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Bs0Xkhcq" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3897B5BCD9; Tue, 17 Feb 2026 07:09:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771312179; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zptlUhDUhQ/ClynPqe9MRdFUVPTk77XaWJ7L6G/r//Q=; b=qDwu5gOa35Tr9DoTpHppktq+Lq6y6Noqcc7zeJ8cr8fJw4+s/p0N71lFOHA85sTDq3cV6K DNafHZ7d3qZvAt6GblgG3aDPkuZjP7fPdfK3FmhW+9WTK9wcmxLQFVinpPESeJ8l2hi2B4 mvJpD4MlSDu2C6tHkfx6coT0J11D6jc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771312179; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zptlUhDUhQ/ClynPqe9MRdFUVPTk77XaWJ7L6G/r//Q=; b=Bs0XkhcqzTMKzLKtfS+W2tRlqjoeeoTr+0wiATm4XxisAFv7hHioOCTba0YA35q+S6Aj+3 EZF6LJf/m6+57rCg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1771312179; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zptlUhDUhQ/ClynPqe9MRdFUVPTk77XaWJ7L6G/r//Q=; b=qDwu5gOa35Tr9DoTpHppktq+Lq6y6Noqcc7zeJ8cr8fJw4+s/p0N71lFOHA85sTDq3cV6K DNafHZ7d3qZvAt6GblgG3aDPkuZjP7fPdfK3FmhW+9WTK9wcmxLQFVinpPESeJ8l2hi2B4 mvJpD4MlSDu2C6tHkfx6coT0J11D6jc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1771312179; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zptlUhDUhQ/ClynPqe9MRdFUVPTk77XaWJ7L6G/r//Q=; b=Bs0XkhcqzTMKzLKtfS+W2tRlqjoeeoTr+0wiATm4XxisAFv7hHioOCTba0YA35q+S6Aj+3 EZF6LJf/m6+57rCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3218E3EA65; Tue, 17 Feb 2026 07:09:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id nQQ7CjAUlGnzCgAAD6G6ig (envelope-from ); Tue, 17 Feb 2026 07:09:36 +0000 Message-ID: <3bad149e-a0fa-4377-9701-7b35ef6b5b88@suse.de> Date: Tue, 17 Feb 2026 08:09:33 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 18/21] nvme: Update CCR completion wait timeout to consider CQT To: Mohamed Khalfella Cc: Justin Tee , Naresh Gottumukkala , Paul Ely , Chaitanya Kulkarni , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , James Smart , Aaron Dailey , Randy Jennings , Dhaval Giani , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org References: <20260214042753.4073668-1-mkhalfella@purestorage.com> <20260214042753.4073668-19-mkhalfella@purestorage.com> <9d6cf4f9-37d8-4704-bcc1-0b849ad28955@suse.de> <20260216184515.GH2392949-mkhalfella@purestorage.com> Content-Language: en-US From: Hannes Reinecke In-Reply-To: <20260216184515.GH2392949-mkhalfella@purestorage.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -4.30 X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWELVE(0.00)[15]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[broadcom.com,gmail.com,nvidia.com,lst.de,kernel.dk,kernel.org,grimberg.me,purestorage.com,lists.infradead.org,vger.kernel.org]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:helo] X-Spam-Level: X-Spam-Flag: NO On 2/16/26 19:45, Mohamed Khalfella wrote: > On Mon 2026-02-16 13:54:18 +0100, Hannes Reinecke wrote: >> On 2/14/26 05:25, Mohamed Khalfella wrote: >>> TP8028 Rapid Path Failure Recovery does not define how much time the >>> host should wait for CCR operation to complete. It is reasonable to >>> assume that CCR operation can take up to ctrl->cqt. Update wait time for >>> CCR operation to be max(ctrl->cqt, ctrl->kato). >>> >>> Signed-off-by: Mohamed Khalfella >>> --- >>> drivers/nvme/host/core.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c >>> index 0680d05900c1..ff479c0263ab 100644 >>> --- a/drivers/nvme/host/core.c >>> +++ b/drivers/nvme/host/core.c >>> @@ -631,7 +631,7 @@ static int nvme_issue_wait_ccr(struct nvme_ctrl *sctrl, struct nvme_ctrl *ictrl) >>> if (result & 0x01) /* Immediate Reset Successful */ >>> goto out; >>> >>> - tmo = secs_to_jiffies(ictrl->kato); >>> + tmo = msecs_to_jiffies(max(ictrl->cqt, ictrl->kato * 1000)); >>> if (!wait_for_completion_timeout(&ccr.complete, tmo)) { >>> ret = -ETIMEDOUT; >>> goto out; >> >> That is not my understanding. I was under the impression that CQT is the >> _additional_ time a controller requires to clear out outstanding >> commands once it detected a loss of communication (ie _after_ KATO). >> Which would mean we have to wait for up to >> (ctrl->kato * 1000) + ctrl->cqt. > > At this point the source controller knows about communication loss. We > do not need kato wait. In theory we should just wait for CQT. > max(cqt, kato) is a conservative guess I made. > Not quite. The source controller (on the host!) knows about the communication loss. But the target might not, as the keep-alive command might have arrived at the target _just_ before KATO triggered on the host. So the target is still good, and will be waiting for _another_ KATO interval before declaring a loss of communication. And only then will the CQT period start at the target. Randy, please correct me if I'm wrong ... Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich