Page MenuHomeFreeBSD

nvme: Fix default is_storage_device kobj method
AcceptedPublic

Authored by guest-ayrton on Tue, Sep 29, 2:59 AM.
Tags
None
Referenced Files
F174057017: D60112.id.diff
Wed, Sep 30, 6:51 AM
Unknown Object (File)
Tue, Sep 29, 5:45 PM
Unknown Object (File)
Tue, Sep 29, 4:11 PM
Unknown Object (File)
Tue, Sep 29, 3:53 PM
Unknown Object (File)
Tue, Sep 29, 3:36 PM
Unknown Object (File)
Tue, Sep 29, 1:34 PM
Subscribers

Details

Reviewers
imp
kevans
Summary

makeobjops.awk only accepts an uppercase DEFAULT before a default kobj method.
This commit fixes a typo introduced in 949804c81909 so non-PCI drivers actually
use nvme_is_storage_device_default instead of kobj_error_method. Note that even
though kobj_error_method returns ENXIO (6), it does not get implicitly cast to a
bool due to the function pointer casting in the nvme_if.h generated by
makeobjops. Instead the codegen for the NVME_IS_STORAGE_DEVICE callsite shows
that only the lowest bit is being checked as if it were always a bool. Without
this any nvme driver that doesn't implement is_storage_device is not treated as
a storage device.

Test Plan

I tested this on an out-of-tree nvme bus for an aarch64 machine. Without it the
nvme driver was not treated as a storage device and I was not able to mount the
root filesystem during boot.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 77431
Build 74314: arc lint + arc unit