[PATCH V4 2/9] nvme: add sysfs attribute to change admin timeout per nvme controller

Maurizio Lombardi mlombard at arkamax.eu
Mon May 11 03:05:59 PDT 2026


On Mon May 11, 2026 at 11:46 AM CEST, Hannes Reinecke wrote:
> On 5/8/26 15:33, Maurizio Lombardi wrote:
>> Currently, there is no method to adjust the timeout values
>> on a per controller basis with nvme admin queues.
>> Add an admin_timeout attribute to nvme so that different
>> nvme controllers which may have different timeout
>> requirements can have custom admin timeouts set.
>> 
>> Signed-off-by: Maurizio Lombardi <mlombard at redhat.com>
>> ---
>>   drivers/nvme/host/core.c  |  1 +
>>   drivers/nvme/host/nvme.h  |  1 +
>>   drivers/nvme/host/sysfs.c | 42 +++++++++++++++++++++++++++++++++++++++
>>   3 files changed, 44 insertions(+)
>> 
>> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
>> index 89948d0acf18..b1bfcd0a0e5b 100644
>> --- a/drivers/nvme/host/core.c
>> +++ b/drivers/nvme/host/core.c
>> @@ -5140,6 +5140,7 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,
>>   	memset(&ctrl->ka_cmd, 0, sizeof(ctrl->ka_cmd));
>>   	ctrl->ka_cmd.common.opcode = nvme_admin_keep_alive;
>>   	ctrl->ka_last_check_time = jiffies;
>> +	ctrl->admin_timeout = NVME_ADMIN_TIMEOUT;
>
> Why do you remove the default timeout?

nvme_init_ctrl() initializes a new controller, so it must inherit the
default global NVME_ADMIN_TIMEOUT settings

> Shouldn't admin requests run with the admin timeout per default?

They do, the default admin timeout for new controllers remains
NVME_ADMIN_TIMEOUT and it's applied to both admin_q and fabrics_q queues
when they are initialized.

Maurizio





More information about the Linux-nvme mailing list