Bug 216147 - NVMe quirk needed for multiple Micron MTFDKBA2T0TFH SSDs
Summary: NVMe quirk needed for multiple Micron MTFDKBA2T0TFH SSDs
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCI (show other bugs)
Hardware: AMD Linux
: P1 normal
Assignee: drivers_pci@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-19 08:58 UTC by Leo Savernik
Modified: 2022-07-12 14:26 UTC (History)
1 user (show)

See Also:
Kernel Version: 5.15.48
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Adding NVME_QUIRK_IGNORE_DEV_SUBNQN for Micron MTFDKBA2T0TFH (530 bytes, patch)
2022-06-19 08:58 UTC, Leo Savernik
Details | Diff

Description Leo Savernik 2022-06-19 08:58:10 UTC
Created attachment 301221 [details]
Adding NVME_QUIRK_IGNORE_DEV_SUBNQN for Micron MTFDKBA2T0TFH

Even though first noticed on an Ubuntu kernel, I dare to report this against upstream as this hardware combination malfunction seems not to be known yet (I did not find distribution-specific patches for this issue). Therefore, IMHO, the fix should be included upstream to make these devices work on every kernel deployment.

My brand new Lenovo Notebook contains three NVMe 2T disks. When booting with Kernel 5.15.0, I receive the following dmesg output:

...
Jun 09 03:33:08 kubuntu kernel: nvme 0000:04:00.0: platform quirk: setting simple suspend
Jun 09 03:33:08 kubuntu kernel: nvme nvme0: pci function 0000:04:00.0
Jun 09 03:33:08 kubuntu kernel: nvme 0000:06:00.0: platform quirk: setting simple suspend
Jun 09 03:33:08 kubuntu kernel: nvme nvme1: pci function 0000:06:00.0
Jun 09 03:33:08 kubuntu kernel: nvme 0000:05:00.0: platform quirk: setting simple suspend
Jun 09 03:33:08 kubuntu kernel: nvme nvme2: pci function 0000:05:00.0
...
Jun 09 03:33:08 kubuntu kernel: nvme nvme1: Duplicate cntlid 0 with nvme0, rejecting
Jun 09 03:33:08 kubuntu kernel: nvme nvme1: Removing after probe failure status: -22
Jun 09 03:33:08 kubuntu kernel: nvme nvme2: Duplicate cntlid 0 with nvme0, rejecting
Jun 09 03:33:08 kubuntu kernel: nvme nvme2: Removing after probe failure status: -22
Jun 09 03:33:08 kubuntu kernel: pps pps0: new PPS source ptp0
Jun 09 03:33:08 kubuntu kernel: igc 0000:0b:00.0 (unnamed net_device) (uninitialized): PHC added
Jun 09 03:33:08 kubuntu kernel: nvme nvme0: 16/0/0 default/read/poll queues
Jun 09 03:33:08 kubuntu kernel:  nvme0n1: p1 p2 p3
...

nvme0 is properly detected, however nvme1 and nvme2 are both rejected with "Duplicate cntlid 0 with nvme0" error message.

lspci properly enumerates all of the 3 devices:
04:00.0 Non-Volatile memory controller: Micron Technology Inc Device 5407
05:00.0 Non-Volatile memory controller: Micron Technology Inc Device 5407
06:00.0 Non-Volatile memory controller: Micron Technology Inc Device 5407

Consequentially, I cannot make use of nvme1 and nvme2. A quirk setting was proposed for a Samsung device [1] which was finally applied to the kernel [2].

[1] https://lkml.kernel.org/lkml/20210118113356.833556252@linuxfoundation.org/
[2] https://lkml.org/lkml/2021/1/18/1172

I wrote up a modified patch for Micron MTFDKBA2T0TFH devices, tested the patch and could make all three NVMe devices work flawlessly under Linux 5.15.0.

I also checked this patch against 5.15.48, it applies cleanly.

I suggest this patch be applied to latest longterm 5.15.x as well as latest Mainline as only one device has been added to the quirk table since, and the format of the quirktable was not changed in the meantime.

The proposed patch itself (also see attachment):

diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index b925a5f4afc3..2e5c33f3b868 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -3372,5 +3372,7 @@ static const struct pci_device_id nvme_id_table[] = { NVME_QUIRK_128_BYTES_SQES |
 				NVME_QUIRK_NO_DEEPEST_PS |
 				NVME_QUIRK_IGNORE_DEV_SUBNQN, },
+	{ PCI_DEVICE(0x1344, 0x5407), /* Micron Technology Inc NVMe SSD */
+		.driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN },
 	{ PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) },
 	{ 0, }
 };
Comment 1 Mario Limonciello (AMD) 2022-07-11 23:46:13 UTC
Thanks for coming up with a fix!
Would you mind to submit the patch to the NVME mailing list?

http://lists.infradead.org/mailman/listinfo/linux-nvme
Comment 2 Leo Savernik 2022-07-12 14:24:16 UTC
You're welcome! Someone did already. Patch seems to be included in Kernels

[PATCH AUTOSEL 5.4 26/27] nvme: add a bogus subsystem NQN quirk for Micron MTFDKBA2T0TFH
[PATCH AUTOSEL 5.10 32/34] nvme: add a bogus subsystem NQN quirk for Micron MTFDKBA2T0TFH
[PATCH AUTOSEL 5.15 39/41] nvme: add a bogus subsystem NQN quirk for Micron MTFDKBA2T0TFH
[PATCH AUTOSEL 5.18 51/53] nvme: add a bogus subsystem NQN quirk for Micron MTFDKBA2T0TFH

So from my point of view it's fixed.
Comment 3 Mario Limonciello (AMD) 2022-07-12 14:26:14 UTC
Great!

Note You need to log in before you can comment on or make changes to this bug.