Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix for nvme quirks module parameter
@ 2026-10-23  9:48 Maurizio Lombardi
  2026-10-23  9:48 ` [PATCH 1/2] nvme-pci: fix early boot hang with nvme.quirks parameter Maurizio Lombardi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Maurizio Lombardi @ 2026-10-23  9:48 UTC (permalink / raw)
  To: kbusch; +Cc: linux-nvme, axboe, hch, dwagner

The first patch fixes a boot hang when nvme-pci is built-in in the
kernel, reported by Ramon Jesus Miranda here:
https://lore.kernel.org/linux-nvme/20261018155426.1299676-1-ramonjesusmiranda@gmail.com/

The second patch increases the quirks parameter's buffer.

Maurizio Lombardi (2):
  nvme-pci: fix early boot hang with nvme.quirks= parameter
  nvme-pci: increase quirks_param buffer size to 256 bytes

 drivers/nvme/host/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
2.56.0



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] nvme-pci: fix early boot hang with nvme.quirks parameter
  2026-10-23  9:48 [PATCH 0/2] Fix for nvme quirks module parameter Maurizio Lombardi
@ 2026-10-23  9:48 ` Maurizio Lombardi
  2026-10-23  9:48 ` [PATCH 2/2] nvme-pci: increase quirks_param buffer size to 256 bytes Maurizio Lombardi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Maurizio Lombardi @ 2026-10-23  9:48 UTC (permalink / raw)
  To: kbusch; +Cc: linux-nvme, axboe, hch, dwagner

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")
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 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 77317e5d00f9..6699c7da4b5a 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");
 
-- 
2.56.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] nvme-pci: increase quirks_param buffer size to 256 bytes
  2026-10-23  9:48 [PATCH 0/2] Fix for nvme quirks module parameter Maurizio Lombardi
  2026-10-23  9:48 ` [PATCH 1/2] nvme-pci: fix early boot hang with nvme.quirks parameter Maurizio Lombardi
@ 2026-10-23  9:48 ` Maurizio Lombardi
  2026-10-23 14:01 ` [PATCH 0/2] Fix for nvme quirks module parameter Laurence Oberman
  2026-10-23 22:06 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Maurizio Lombardi @ 2026-10-23  9:48 UTC (permalink / raw)
  To: kbusch; +Cc: linux-nvme, axboe, hch, dwagner

The current 128 byte buffer for the nvme.quirks command line parameter
is a bit too small. If a user needs to specify multiple quirks or use
multiple VID:DID combinations, the configuration string can easily
exceed this limit.

Increase the size of the quirks_param array from 128 to 256 bytes to
comfortably accommodate longer and more complex quirk configurations.

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
---
 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 6699c7da4b5a..d6c8fcc6151a 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -232,7 +232,7 @@ static int quirks_param_set(const char *value, const struct kernel_param *kp)
 	return err;
 }
 
-static char quirks_param[128];
+static char quirks_param[256];
 static const struct kernel_param_ops quirks_param_ops = {
 	.set = quirks_param_set,
 	.get = param_get_string,
-- 
2.56.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Fix for nvme quirks module parameter
  2026-10-23  9:48 [PATCH 0/2] Fix for nvme quirks module parameter Maurizio Lombardi
  2026-10-23  9:48 ` [PATCH 1/2] nvme-pci: fix early boot hang with nvme.quirks parameter Maurizio Lombardi
  2026-10-23  9:48 ` [PATCH 2/2] nvme-pci: increase quirks_param buffer size to 256 bytes Maurizio Lombardi
@ 2026-10-23 14:01 ` Laurence Oberman
  2026-10-23 22:06 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Laurence Oberman @ 2026-10-23 14:01 UTC (permalink / raw)
  To: Maurizio Lombardi, kbusch; +Cc: linux-nvme, axboe, hch, dwagner

On Fri, 2026-10-23 at 11:48 +0200, Maurizio Lombardi wrote:
> The first patch fixes a boot hang when nvme-pci is built-in in the
> kernel, reported by Ramon Jesus Miranda here:
> https://lore.kernel.org/linux-nvme/20261018155426.1299676-1-ramonjesusmiranda@gmail.com/
> 
> The second patch increases the quirks parameter's buffer.
> 
> Maurizio Lombardi (2):
>   nvme-pci: fix early boot hang with nvme.quirks= parameter
>   nvme-pci: increase quirks_param buffer size to 256 bytes
> 
>  drivers/nvme/host/pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Unless I am missing something, this looks good to me and i know it was
already tested.

For the series
Reviewed-by: Laurence Oberman <loberman@redhat.com>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] Fix for nvme quirks module parameter
  2026-10-23  9:48 [PATCH 0/2] Fix for nvme quirks module parameter Maurizio Lombardi
                   ` (2 preceding siblings ...)
  2026-10-23 14:01 ` [PATCH 0/2] Fix for nvme quirks module parameter Laurence Oberman
@ 2026-10-23 22:06 ` Keith Busch
  3 siblings, 0 replies; 5+ messages in thread
From: Keith Busch @ 2026-10-23 22:06 UTC (permalink / raw)
  To: Maurizio Lombardi; +Cc: linux-nvme, axboe, hch, dwagner

On Fri, Oct 23, 2026 at 11:48:04AM +0200, Maurizio Lombardi wrote:
> The first patch fixes a boot hang when nvme-pci is built-in in the
> kernel, reported by Ramon Jesus Miranda here:
> https://lore.kernel.org/linux-nvme/20261018155426.1299676-1-ramonjesusmiranda@gmail.com/
> 
> The second patch increases the quirks parameter's buffer.

Thanks, applied to nvme-7.4.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-10-23 22:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-23  9:48 [PATCH 0/2] Fix for nvme quirks module parameter Maurizio Lombardi
2026-10-23  9:48 ` [PATCH 1/2] nvme-pci: fix early boot hang with nvme.quirks parameter Maurizio Lombardi
2026-10-23  9:48 ` [PATCH 2/2] nvme-pci: increase quirks_param buffer size to 256 bytes Maurizio Lombardi
2026-10-23 14:01 ` [PATCH 0/2] Fix for nvme quirks module parameter Laurence Oberman
2026-10-23 22:06 ` Keith Busch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox