Page MenuHomeFreeBSD

nvme: Add quirk for broken namespace-change log
ClosedPublic

Authored by cperciva on Jul 14 2026, 6:50 PM.
Tags
None
Referenced Files
F167006763: D58231.diff
Tue, Aug 18, 1:13 PM
Unknown Object (File)
Sun, Aug 16, 2:52 PM
Unknown Object (File)
Thu, Aug 13, 8:45 PM
Unknown Object (File)
Tue, Aug 11, 10:50 PM
Unknown Object (File)
Sat, Aug 8, 10:47 PM
Unknown Object (File)
Sat, Aug 8, 3:49 PM
Unknown Object (File)
Sat, Aug 8, 10:45 AM
Unknown Object (File)
Fri, Aug 7, 3:13 PM
Subscribers

Details

Summary

Add a QUIRK_EMPTY_NAMESPACE_CHANGED_LOG quirk which indicates that the
nvme controller may not properly populate the namespace-changed log
page. If we receive a NVME_LOG_CHANGED_NAMESPACE page for a device
with this quirk and the page is empty, probe all of the namespaces
rather than none of them.

MFC after: 1 week
Sponsored by: Amazon

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/nvme/nvme_ctrlr.c
1312

@imp I followed the pattern of what you wrote earlier, in terms of notifying every child about each (potentially) changed namespace, but I have to admit that I don't understand under what conditions we would have multiple children or whether it would make sense that all of them need to be notified about all of the changed namespaces.

sys/dev/nvme/nvme_ctrlr.c
1312

Worst case is we send a size changed event with no size change i think.

If you have a time for the refactor I requested, that would be idea.
If not, this is OK enough as it is with the ns == 0 check, since that's not a valid namespace.

sys/dev/nvme/nvme_ctrlr.c
1308

We should add a check for nsl->ns[i] != 0 for safety.

1315

So this is OK, with the above safety. But I can't help but think we want this if to control wither we do all the namespaces, or just the ones listed rather than expecting namespace 0 to be a nop.

This revision is now accepted and ready to land.Sat, Jul 25, 7:42 PM
sys/dev/nvme/nvme_ctrlr.c
1308

That's already on line 1301? Or am I missing something here?

1315

The buggy hardware (well, hypervisor technically) returns a zeroed log page. So checking for the quirk *and* for nsl->ns[0] == 0 is "the hardware needs to be known-buggy and also exhibit the bug". There's no option for "only the namespaces listed" on this hardware because it doesn't list anything in the log page.