[PATCH V4 2/9] nvme: add sysfs attribute to change admin timeout per nvme controller
Christoph Hellwig
hch at lst.de
Mon May 11 01:07:21 PDT 2026
On Fri, May 08, 2026 at 03:33:28PM +0200, 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.
Please use up all 73 characters for commit messages.
>
> +static ssize_t nvme_admin_timeout_show(struct device *dev,
> + struct device_attribute *attr, char *buf)
The indent for prototype continuations should use two, not three tabs.
> + * Wait until the controller reaches the LIVE state
> + * to be sure that admin_q and fabrics_q are
> + * properly initialized.
Please use up all 80 characters for comments.
> + */
> + if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags))
> + return -EBUSY;
> +
> + err = kstrtou32(buf, 10, &timeout);
> + if (err || !timeout)
> + return -EINVAL;
> +
> + ctrl->admin_timeout = msecs_to_jiffies(timeout);
> +
> + blk_queue_rq_timeout(ctrl->admin_q, ctrl->admin_timeout);
> + if (ctrl->fabrics_q)
> + blk_queue_rq_timeout(ctrl->fabrics_q, ctrl->admin_timeout);
Do we really want to apply the the admin timeout for the fabrics queue?
If so can you document here why we do that?
More information about the Linux-nvme
mailing list