]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nvme: add support for dynamic quirk configuration via module parameter
authorMaurizio Lombardi <mlombard@redhat.com>
Wed, 4 Feb 2026 10:55:55 +0000 (11:55 +0100)
committerKeith Busch <kbusch@kernel.org>
Thu, 5 Feb 2026 15:35:58 +0000 (07:35 -0800)
commit7bb8c40f5ad88392bbabb719ebfd5e3354ce0428
tree9b8e64ef1741722fa23c4d326ed1a4b6bbb1c7fb
parentb84bb7bd913d8ca2f976ee6faf4a174f91c02b8d
nvme: add support for dynamic quirk configuration via module parameter

Introduce support for enabling or disabling specific NVMe quirks at module
load time through the `quirks` module parameter.
This mechanism allows users to apply known quirks dynamically based on the
device's PCI vendor and device IDs, without requiring to add hardcoded
entries in the driver and recompiling the kernel.

While the generic PCI new_id sysfs interface exists for dynamic
configuration, it is insufficient for scenarios where the system fails
to boot (for example, this has been reported to happen because of the
bogus_nid quirk). The new_id attribute is writable only after the system
has booted and sysfs is mounted.

The `quirks` parameter accepts a list of quirk specifications separated by
a '-' character in the following format:

<VID>:<DID>:<quirk_names>[-<VID>:<DID>:<quirk_names>-..]

Each quirk is represented by its name and can be prefixed with `^` to
indicate that the quirk should be disabled; quirk names are separated by
a ',' character.

Example: enable BOGUS_NID and BROKEN_MSI, disable DEALLOCATE_ZEROES:

   $ modprobe nvme quirks=7170:2210:bogus_nid,broken_msi,^deallocate_zeroes

Tested-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Documentation/admin-guide/kernel-parameters.txt
drivers/nvme/host/pci.c