From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (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 11DA03DC4DA for ; Fri, 10 Jul 2026 09:21:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783675265; cv=none; b=iYeN8/rfYRNRMs2MpkQKWZLEXyePyZ63GiTkixHks+6B3jFpBRw7UwEo3yzBSO9PxVI8bRHdilY6M2vAzAHZAGQf1uzVDH0JVSvyIuzT8/ElNLTiWlql+WYhVI3MXPjr0roQHFasaOZKkSJCSNE/UMNYzVahX6mJWVJqnG5wce8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783675265; c=relaxed/simple; bh=+CLCSmfHRFD0fJakghuKiUj4R8fLlyXwhtIfQLvCOHo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=qZLggcrh++w4Ohj71OIbbSz70f5Fxl33VJryLpBeKIqrNQqdLTRPxdnboDttNY7qn8cwbih5RFy7GTNRI71/oGK0nZ6rjMU8mbGsVqscXsLx8oaCC+2i94bOjXw+uxneyRt6s1pqFe0KKGqxmsAPetlxxsGDjuYA6yi7U6S9FDY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a5IryXON; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a5IryXON" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-383cb94f742so621466a91.3 for ; Fri, 10 Jul 2026 02:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783675262; x=1784280062; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=oDtdeILJ2peez8AaokzA3pC4nRgV4ywb3bIoJcx7oEM=; b=a5IryXONTn6KkDM/Y0vCdIQTQ7721KjdlhcfefJIimikIU8Mxn2IogQOZQ92uJR1Z8 U54YlzTn9pHh5By2pRiY634MgIljpPFL/4pQ7pm3Vw+2xCph4Y5Zv2in9tnPM9mjuUNy NT1jC1rU/wji1PdgdZgLobAKP5a4uuXyj/OrEiYnwh8/wKMmu08aW3LFb1HkPxq9vori l+bpsApqWyKjaL7OgD+T159hOSoHnCcLm0BnHGnATW+1s5p/d57+AzT6myctPiWVgBDr Y1dJ9g6TuPI9opOF4TBOAgQpfd82G3kJFtCu8fmHhHHt3bB98doKWhWUDma15dnVrPXk SJFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783675262; x=1784280062; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=oDtdeILJ2peez8AaokzA3pC4nRgV4ywb3bIoJcx7oEM=; b=mjWNrGFKKpoZCXp6BdrnRaPEjfv7D/j0ZnPcC77iq3oFXuCFeFB7F3zMoX2vPqSLwR hqS2uCiSKhxCnyd6mFLTIMaNz+Pi40Uw5Td/l9Alby28+6f58Vq6dTzXOn1dKhuv6J7V Iw9GF8++/q8oA3MZJ2QUhA268b9ycLVgEs7iEBgItDwFHcOEcq8NXyM23hFGdY+UKTjM LIjhQnvIwlpKs9I4nEEZNThH8ZBAjuxBzwo/t0kXm5BbLWn4sUlvNou6x/qiQn6Y4PVG fu6h/YAewmLvMaBQx2nISuHwJCjY6vJgmoTuFBsarJP24Nl5RiYogQ+XwNorOfpRkFrw aSQw== X-Forwarded-Encrypted: i=1; AHgh+RrdQjNlXRcNyZdm0ZWcruv2kpdTOiFVkx/0YZ4BbvSi9RppeigaIfYToMV2S/VheG3dCQG3k+2Z/va/Omw=@vger.kernel.org X-Gm-Message-State: AOJu0YzhXRSFrQ0xLtwPziqiui+3in6M1C2yXyJmJVmwlY8C1v/alm6W IJJgwrcxZaQqJSmj0s+ctbI1lc0kCwGhPYJytROxXIOZnr7vH++58KdW X-Gm-Gg: AfdE7cmViVOYRBG+p3odogyOPOL3m82VbJrWzJ7CnspZ+w5kU0JDHj9o/fV3tgwgWHQ 2/oJn2OGv0+M+G46QGxKOnuJ4u8pe146o53nZ90pz59/6pV/JRs5sT1nxhAlnmKHHcEVbDcgNrc rp6UI0vjCJTDiLpHORqHPrmB0ScXSDrwl+UhJV/wAXOdINPbp7qXd2vHOEnWL+QVmAvJzkRyYGm S6dIxqEYyQBFkg+dfvkM7WKjyoatG12UBR+tGD9uOg1Z9NRbyG82iMniEnlz2xUe5YCj9VsQrLp ArlY+8IBWPJZewiKMBZ/YMlZCUiP29jS/B1N9vDZtPPP8Q+OS36XMqFop6MaR8DpmHS5yZ2WzES HASlymxqULYb0rS4l0Rmv0KZ9l5PHCqMsbHAARKcgWi+JwScD7CDj1J+sEsXzalpP8rdwRdy5fG QfEcCKBRWXjCOkiOtPRQURFcrFCJ3ZL4kN X-Received: by 2002:a17:90b:4cce:b0:37f:9ce0:af32 with SMTP id 98e67ed59e1d1-389421ac479mr11356288a91.29.1783675261731; Fri, 10 Jul 2026 02:21:01 -0700 (PDT) Received: from [10.0.55.204] ([61.213.176.13]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38d2fdd777csm507508a91.1.2026.07.10.02.20.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jul 2026 02:21:01 -0700 (PDT) Message-ID: <12726bc4-33ce-4602-b2a9-46885f2af1fe@gmail.com> Date: Fri, 10 Jul 2026 17:20:56 +0800 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] nvme: make firmware activation poll interval configurable To: Keith Busch , Christoph Hellwig Cc: axboe@kernel.dk, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Guzebing References: <20260627010610.47768-1-guzebing1612@gmail.com> <20260709064233.GA18381@lst.de> <7ae65361-f601-4fd9-8eac-5dfb9f6bb7ea@gmail.com> From: guzebing In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/9/26 11:07 PM, Keith Busch wrote: > On Thu, Jul 09, 2026 at 05:06:11PM +0800, guzebing wrote: >> The Samsung PM9D3a Gen5 SSD reports MTFA = 10, i.e. 1000 ms. >> >> I also checked another device, an Intel/Solidigm P5520 Gen4 drive. It >> reports MTFA = 100, i.e. 10000 ms, while the observed online activation >> time is about 800 ms. >> >> I agree that deriving the polling interval from MTFA would be better >> than adding a module parameter. Given that MTFA is a conservative upper >> bound rather than a good estimate of the common activation time, would >> using a small fraction of it, for example MTFA / 100 clamped to 10..100 >> ms, be a reasonable policy for v2? >> >> That would give 10 ms for the PM9D3a device above, while keeping the >> current 100 ms interval for the P5520 case and for large-MTFA devices. > > nvme_wait_ready() has a similar polling loop on the csts register, but > it does a udelay_range for 1-2 msecs no matter what the ready timeout > is. Maybe just do the same for consistency? Keith, using the same 1-2 ms sleep range as nvme_wait_ready() looks simpler to me as well. I measured two long-running nvme_wait_ready() calls in the normal nvme-pci NVMe controller-reset path for a live Intel P5520 (SSDPF2KX076T1), not the PCIe FLR fallback: nvme_disable_ctrl() cleared NVME_CC_ENABLE in ctrl->ctrl_config, wrote the cached value to CC, and then waited for CSTS.RDY == 0: 1353 ms nvme_enable_ctrl() set NVME_CC_ENABLE in ctrl->ctrl_config, wrote the cached value to CC, and then waited for CSTS.RDY == 1: 1070 ms Both long-running waits used an effective timeout argument of 30 seconds. The same drive reports MTFA = 100 (10 seconds), while its observed online firmware activation time was about 800 ms. Thus, on this device, the ready waits already use the 1-2 ms sleep range for longer than the observed firmware activation. Thanks both for the suggestions. Christoph, would this approach work for you as well? If so, I can respin v2 to drop the module parameter and replace msleep(100) with usleep_range(1000, 2000) in nvme_fw_act_work().