[PATCH 3/3] nvme: Add async shutdown support

Christoph Hellwig hch at lst.de
Mon Dec 18 21:43:49 PST 2023


On Thu, Dec 14, 2023 at 04:03:58PM -0800, Jeremy Allison wrote:
> From: Tanjore Suresh <tansuresh at google.com>
> 
> This works with the asynchronous shutdown mechanism setup for the PCI
> drivers and participates to provide both pre and post shutdown
> routines at pci_driver structure level.
> 
> The shutdown_pre routine starts the shutdown and does not wait for the
> shutdown to complete.  The shutdown_post routine waits for the shutdown
> to complete on individual controllers that this driver instance
> controls. This mechanism optimizes to speed up the shutdown in a
> system which host many controllers.

I had a really hard time trying to understand this patch.

Please split switching from the bool shutdown to an enum (with initially
just two values) into a separate patch.   And the names really confuse
me.  I would have expect something like:

	NVME_DISABLE_RESET,
	NVME_DISABLE_SHUTDOWN_SYNC,
	NVME_DISABLE_SHUTDOWN_ASYNC,

then again mixing two rather different concept (reset vs shutdown)
into a single enum is also not very helpful (but neither would be
two bool arguments).  Not really sure what the right thing is, but
as-is it feels pretty obfuscated.




More information about the Linux-nvme mailing list