[PATCH 1/1] nvme: retry security commands if media not ready
Greg Joyce
gjoyce at linux.ibm.com
Thu Oct 3 16:35:30 PDT 2024
On Thu, 2024-10-03 at 16:41 +0200, Christoph Hellwig wrote:
> On Thu, Oct 03, 2024 at 08:30:21AM -0500, Greg Joyce wrote:
> > Thanks. I think that leads me to ask a larger question. If we
> > always
> > wait until media ready,
>
> We don't generally wait - the namespaces only become online when they
> are ready, but otherwise we should be up. Unfortunately the
> technical
> working group allowed some admin command to return media not ready,
> probably to shoe horn existing implementation. But this generally
> is a bad quality of implementation and there is no good reason for it
> if the little bit of media used by these comes from a separate pool
> that doesn't take as long to recover. Or in other words, if you see
> this error someonone at IBM messed up writing their purchase spec..
>
I agree, I wonder about the value/wisdom of the CC.CRIME capability
especially since there is no way to read status that indicates that the
media is ready for the Figure 103 commands. But it is a defined feature
and setting it does cause CSTS.RDY to be asserted before the media is
ready.
The Kioxia CM7 drive does set both CRWMS and CRIMS (CRMS=11b). And
these lines in the NVMe driver thus set CC.CRIME:
if (ctrl->cap & NVME_CAP_CRMS_CRWMS && ctrl->cap &
NVME_CAP_CRMS_CRIMS)
ctrl->ctrl_config |= NVME_CC_CRIME;
After reading more of the spec and driver code and discussions here, I
suggest that those two lines be removed. This has the effect of
returning to the NVMe version 1.4 behavior and CSTS.RDY will not be
asserted until the media is ready for commands.
Greg
More information about the Linux-nvme
mailing list