[PATCH v2] nvme: Honor RTD3 Entry Latency for shutdowns

Christoph Hellwig hch at infradead.org
Thu Aug 24 02:02:22 PDT 2017


On Wed, Aug 23, 2017 at 06:32:58PM -0400, Martin K. Petersen wrote:
> If an NVMe v1.2+ compliant controller reports RTD3 Entry Latency larger
> than shutdown_timeout, up to a maximum of 60 seconds, use that value to
> set the shutdown timer. Otherwise fall back to the module parameter
> which defaults to 5 seconds.

This generally looks fine, but NVMe allows TPs and thus new fields
to be implemented even against older spec versions, so we should avoid
version tests wherever possible.

> +	if (ctrl->vs >= NVME_VS(1, 2, 0)) {
> +		u32 transition_time = le32_to_cpu(id->rtd3e);

So instead of the version check here I'd check for a non-zero
RTD3E field instead.



More information about the Linux-nvme mailing list