Skip to contentSkip to conversation

NVMe quirk needed for multiple Micron MTFDKBA2T0TFH SSDs

PATCH In review Leo Savernik 3 participants 7 messages Jun 20, 2022 – Jun 22, 2022 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NVMe quirk needed for multiple Micron MTFDKBA2T0TFH SSDs

Hello

As suggested by Keith Busch, I'm posting a patch to make multiple Micron MTFDKBA2T0TFH devices work to the mailing list for inclusion in the latest kernel versions.

This patch applies cleanly against 5.15.48 and 5.19-rc1

Please see bug 216147 [1] for details.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=216147

Leo

drivers/nvme/host/pci.c +0 -0
index b925a5f4afc3..2e5c33f3b868 100644
@@ -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, }
};
maintainer
#1 lore raw
Quoted 6 lines · Leo Savernik

Hello

As suggested by Keith Busch, I'm posting a patch to make multiple Micron MTFDKBA2T0TFH devices work to the mailing list for inclusion in the latest kernel versions.

Quoted 7 lines

This patch applies cleanly against 5.15.48 and 5.19-rc1

Please see bug 216147 [1] for details.

[1] https://bugzilla.kernel.org/show_bug.cgi?id=216147

Leo

The diff looks fine, but we need a better commit message for the change log. :)

Specifically, sections "Describe your changes" and "Sign your work", described here:

https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Quoted 15 lines
drivers/nvme/host/pci.c +0 -0
index b925a5f4afc3..2e5c33f3b868 100644
@@ -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, },

drivers/nvme/host/pci.c +2 -0
+	{ 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, }
};
#2 lore raw

PATCH 1/1 Introduce NVMe quirk for multiple Micron MTFDKBA2T0TFH SSDs

Longterm kernel 5.15 recognises only first of three installed 2TB Micron MTFDKBA2T0TFH SSDs.

lspci:
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

dmesg:

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: nvme nvme0: 16/0/0 default/read/poll queues
Jun 09 03:33:08 kubuntu kernel:  nvme0n1: p1 p2 p3

...

Effectively, only the first NVMe device is recognised. The NVMe driver supports a quirks flag NVME_QUIRK_IGNORE_DEV_SUBNQN that when applied to the kernel makes all Micron MTFDKBA2T0TFH devices accessible.

I've applied this patch to Ubuntu kernel 5.15.0-25 as well as latest longterm 5.15.48 and have been using the three NVMe devices in an LVM array since without flaws. The patch also applies cleanly against mainline 5.19-rc1.

See https://bugzilla.kernel.org/show_bug.cgi?id=216147 for additional details.

Lenovo seems to equip its Notebooks with Micron NVMe in quantity, therefore, this patch would make multiple Micron MTFDKBA2T0TFH model devices work out of the box.

---

drivers/nvme/host/pci.c +0 -0
index b925a5f4afc3..2e5c33f3b868 100644
@@ -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, }
};
#4 lore raw

Re: [PATCH] Introduce NVMe quirk for multiple Micron MTFDKBA2T0TFH SSDs

In reply to Leo Savernik

The patch seemed whitespace damaged. I've manually applied it and use that opportunity to shorten the commit log a bit.

#5 lore raw

Re: [PATCH] Introduce NVMe quirk for multiple Micron MTFDKBA2T0TFH SSDs

Am Mittwoch, 22. Juni 2022 12:21:41 CEST schrieb Christoph Hellwig:

Quoted 4 lines

The patch seemed whitespace damaged. I've manually applied it and use that opportunity to shorten the commit log a bit.

Oh, I'm sorry! I took care to send it as 7-bit ASCII but apparently it still got mangled. Thank you everybody for reviewing and your efforts!

mfg
Leo

maintainer
#6 lore raw

Re: [PATCH] Introduce NVMe quirk for multiple Micron MTFDKBA2T0TFH SSDs

Quoted 6 lines · Leo Savernik

Am Mittwoch, 22. Juni 2022 12:21:41 CEST schrieb Christoph Hellwig:

Quoted 2 lines

The patch seemed whitespace damaged. I've manually applied it and use that opportunity to shorten the commit log a bit.

Oh, I'm sorry! I took care to send it as 7-bit ASCII but apparently it still got mangled. Thank you everybody for reviewing and your efforts!

It's no problem, sometimes the code diff is the easiest part to a commit. :)

Christoph,

You may want to force-push an update since it looks like this patch is missing your committer Sign-off (the bots may flag you without it!).

http://git.infradead.org/nvme.git/commit/aa5f8f971c1c159ec444bcdcf6a5ec07a8d10d2c