[PATCH v2] nvme: reduce firmware activation poll interval

guzebing posted 1 patch 1 week, 4 days ago
There is a newer version of this series
drivers/nvme/host/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH v2] nvme: reduce firmware activation poll interval
Posted by guzebing 1 week, 4 days ago
From: Guzebing <guzebing@bytedance.com>

nvme_fw_act_work() polls the controller processing-paused status every
100 ms while firmware activation is pending. Some devices can complete
online activation in only a few hundred milliseconds, so the fixed
100 ms interval can add up to 100 ms of latency before the driver
observes completion.

Poll every 1 to 2 ms instead. The shorter interval reduces the delay
before the driver observes completion and allows the timeout check to
track the MTFA boundary more closely.

Signed-off-by: Guzebing <guzebing@bytedance.com>
---
Changes in v2:
- Drop the module parameter and use a fixed 1 to 2 ms poll interval.

v1: https://lore.kernel.org/linux-nvme/20260627010610.47768-1-guzebing1612@gmail.com/

 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 453c1f0b2dd09..c226baf8641a5 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4813,7 +4813,7 @@ static void nvme_fw_act_work(struct work_struct *work)
 			nvme_try_sched_reset(ctrl);
 			return;
 		}
-		msleep(100);
+		usleep_range(1000, 2000);
 	}
 
 	if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_CONNECTING) ||
-- 
2.20.1
Re: [PATCH v2] nvme: reduce firmware activation poll interval
Posted by Christoph Hellwig 1 week, 4 days ago
On Tue, Jul 14, 2026 at 05:28:46PM +0800, guzebing wrote:
>  			nvme_try_sched_reset(ctrl);
>  			return;
>  		}
> -		msleep(100);
> +		usleep_range(1000, 2000);

Add a comment that this matches nvme_wait_ready?  Or even better add
a helper with a name like nvme_busy_wait and add a comment describing
the use case?