[PATCH] nvme: add support for TP4084 - Time-to-Ready Enhancements
Keith Busch
kbusch at kernel.org
Wed May 18 07:36:47 PDT 2022
On Wed, May 18, 2022 at 08:40:40AM +0200, Christoph Hellwig wrote:
> +static int nvme_identify_ns_cs_indep(struct nvme_ctrl *ctrl, unsigned nsid,
> + struct nvme_id_ns_cs_indep **id)
> +{
> + struct nvme_command c = {
> + .identify.opcode = nvme_admin_identify,
> + .identify.nsid = cpu_to_le32(nsid),
> + .identify.cns = NVME_ID_CNS_NS_CS_INDEP,
> + };
> + int error;
Every other place in this driver calls this value 'ret'.
> -static int nvme_wait_ready(struct nvme_ctrl *ctrl, u64 cap, bool enabled)
> +static int nvme_wait_ready(struct nvme_ctrl *ctrl, bool enabled)
> {
> - unsigned long timeout =
> - ((NVME_CAP_TIMEOUT(cap) + 1) * HZ / 2) + jiffies;
> + unsigned long timeout = ((ctrl->enable_timeout + 1) * HZ / 2) + jiffies;
I think we need to continue using the NVME_CAP_TIMEOUT() value when 'enabled'
is false. The enable_timeout is only applicable for the 0->1 transition and may
be too short if CRIME is set or too long when it's not.
More information about the Linux-nvme
mailing list