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

Daniel Wagner dwagner at suse.de
Thu Apr 23 05:46:54 PDT 2026


On Wed, Apr 22, 2026 at 01:08:44PM +0200, Maurizio Lombardi wrote:
> On Wed Apr 22, 2026 at 12:10 PM CEST, Daniel Wagner wrote:
> > On Fri, Apr 10, 2026 at 09:39:18AM +0200, Maurizio Lombardi wrote:
> >> +	/*
> >> +	 * Wait until the controller reaches the LIVE state
> >> +	 * to be sure that admin_q and fabrics_q are
> >> +	 * properly initialized.
> >> +	 */
> >> +	if (!test_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags))
> >> +		return -EBUSY;
> >
> > I assume the idea is to use an udev rule to set the value. Though I
> > think this is racy:
> >
> > 	nvme_change_uevent(ctrl, "NVME_EVENT=connected");
> > 	set_bit(NVME_CTRL_STARTED_ONCE, &ctrl->flags);
> 
> 
> Not really, the idea was about to prevent the user from setting the
> timeouts too early during the controller's initialization.

Yes, but then how do you know when is too early? Do you read/poll the
state of the controller? 

> Otherwise the user could try to change the timeout while
> admin_q and fabrics_q are still being created.
> 
> if the NVME_CTRL_STARTED_ONCE bit is set, we know that the
> initialization has been completed and that admin_q and fabrics_q will
> exist until the controller will be torn down.

Yes, that is all fine but I think it would be good to be able to use
udev here as we have it other timeouts.



More information about the Linux-nvme mailing list