From ed75528c095bc7760a3cf34a3f3e2ec7a59eb285 Mon Sep 17 00:00:00 2001 From: Maurizio Lombardi Date: Fri, 23 Oct 2026 11:48:05 +0200 Subject: [PATCH] nvme-pci: fix early boot hang with nvme.quirks parameter Passing nvme.quirks on the kernel command line causes a silent boot hang when the NVMe driver is compiled as a built-in module. This happens because the parameter is currently registered using module_param_cb(). For built-in modules, this macro flags the parameter to be evaluated at initcall level -1. Consequently, quirks_param_set() is called before the memory allocators are initialized. Fix this by replacing module_param_cb() with device_param_cb(). This defers the parameter parsing to initcall level 6, guaranteeing that the system memory allocators are fully functional before the quirk string is parsed and allocated. Fixes: 7bb8c40f5ad8 ("nvme: add support for dynamic quirk configuration via module parameter") Reviewed-by: Laurence Oberman Signed-off-by: Maurizio Lombardi Signed-off-by: Keith Busch --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 82e308fe4f4c..1ea98647062e 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -243,7 +243,7 @@ static struct kparam_string quirks_param_string = { .string = quirks_param, }; -module_param_cb(quirks, &quirks_param_ops, &quirks_param_string, 0444); +device_param_cb(quirks, &quirks_param_ops, &quirks_param_string, 0444); MODULE_PARM_DESC(quirks, "Enable/disable NVMe quirks by specifying " "quirks=VID:DID:quirk_names");