nvme-pci: Remove NVME_QUIRK_BOGUS_NID for device vendors
PATCH 1/1 nvme-pci: Remove NVME_QUIRK_BOGUS_NID for device vendors
After commit ac522fc6c316 ("nvme: don't reject probe due to duplicate IDs for single-ported PCIe devices") merged, vendors no longer need to use quirks in the PCI ID entry to work around the issue of duplicate IDs. The NVME_QUIRK_BOGUS_NID flag changes the format of device attribute file names under /dev/disk/by-id/.
For example, /dev/disk/by-id/nvme-eui.xxx -> /dev/disk/by-id/nvme-nvme.xxx.
Considering that naming formats need to have high stability and recognizability, it is more prudent to make changes only for rare, sporadic cases rather than implementing comprehensive changes. Therefore, this patch remove default setting of NVME_QUIRK_BOGUS_NID flag for vendors, and the flag is added dynamically only when duplicate IDs is detected, as implemented in ac522fc6c3165f.
--- drivers/nvme/host/pci.c | 63 +++++------------------------------------ 1 file changed, 7 insertions(+), 56 deletions(-)
drivers/nvme/host/pci.c +7 -56
@@ -3592,8 +3592,7 @@ static const struct pci_device_id nvme_id_table[] = { NVME_QUIRK_DEALLOCATE_ZEROES, }, { PCI_VDEVICE(INTEL, 0x0a54), /* Intel P4500/P4600 */ .driver_data =NVME_QUIRK_STRIPE_SIZE | -NVME_QUIRK_IGNORE_DEV_SUBNQN | - NVME_QUIRK_BOGUS_NID, }, + NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_VDEVICE(INTEL, 0x0a55), /* Dell Express Flash P4600 */ .driver_data = NVME_QUIRK_STRIPE_SIZE, }, { PCI_VDEVICE(INTEL, 0xf1a5), /* Intel 600P/P3100 */
@@ -3612,11 +3611,9 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_DEVICE(0x1217, 0x8760), /* O2 Micro 64GB Steam Deck */ .driver_data = NVME_QUIRK_DMAPOOL_ALIGN_512, }, { PCI_DEVICE(0x126f, 0x2262), /* Silicon Motion generic */ - .driver_data = NVME_QUIRK_NO_DEEPEST_PS | - NVME_QUIRK_BOGUS_NID, }, + .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, { PCI_DEVICE(0x126f, 0x2263), /* Silicon Motion unidentified */ - .driver_data = NVME_QUIRK_NO_NS_DESC_LIST | - NVME_QUIRK_BOGUS_NID, }, + .driver_data = NVME_QUIRK_NO_NS_DESC_LIST, }, { PCI_DEVICE(0x1bb1, 0x0100), /* Seagate Nytro Flash Storage */ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY | NVME_QUIRK_NO_NS_DESC_LIST, },
@@ -3634,11 +3631,8 @@ static const struct pci_device_id nvme_id_table[] = { NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x15b7, 0x5008), /* Sandisk SN530 */ .driver_data = NVME_QUIRK_BROKEN_MSI }, - { PCI_DEVICE(0x1987, 0x5012), /* Phison E12 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1987, 0x5016), /* Phison E16 */ - .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN | - NVME_QUIRK_BOGUS_NID, }, + .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x1987, 0x5019), /* phison E19 */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_DEVICE(0x1987, 0x5021), /* Phison E21 */
@@ -3646,24 +3640,15 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_DEVICE(0x1b4b, 0x1092), /* Lexar 256 GB SSD */ .driver_data =NVME_QUIRK_NO_NS_DESC_LIST | NVME_QUIRK_IGNORE_DEV_SUBNQN, }, - { PCI_DEVICE(0x1cc1, 0x33f8), /* ADATA IM2P33F8ABR1 1 TB */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x10ec, 0x5762), /* ADATA SX6000LNP */ - .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN | - NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x10ec, 0x5763), /* ADATA SX6000PNP */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, + .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(0x1cc1, 0x8201), /* ADATA SX8200PNP 512GB */ .driver_data = 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(0x1344, 0x6001), /* Micron Nitro NVMe */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1c5c, 0x1504), /* SK Hynix PC400 */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, - { PCI_DEVICE(0x1c5c, 0x174a), /* SK Hynix P31 SSD */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1c5c, 0x1D59), /* SK Hynix BC901 */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_DEVICE(0x15b7, 0x2001), /* Sandisk Skyhawk */
@@ -3671,12 +3656,9 @@ static const struct pci_device_id nvme_id_table[] = { { PCI_DEVICE(0x1d97, 0x2263), /* SPCC */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_DEVICE(0x144d, 0xa80b), /* Samsung PM9B1 256G and 512G */ - .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES | - NVME_QUIRK_BOGUS_NID, }, + .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_DEVICE(0x144d, 0xa809), /* Samsung MZALQ256HBJD 256G */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, - { PCI_DEVICE(0x144d, 0xa802), /* Samsung SM953 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1cc4, 0x6303), /* UMIS RPJTJ512MGE1QDY 512G */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_DEVICE(0x1cc4, 0x6302), /* UMIS RPJTJ256MGE1QDY 256G */
@@ -3697,43 +3679,12 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, { PCI_DEVICE(0x2646, 0x501E), /* KINGSTON OM3PGP4xxxxQ OS21011 NVMe SSD */ .driver_data = NVME_QUIRK_DISABLE_WRITE_ZEROES, }, - { PCI_DEVICE(0x1f40, 0x1202), /* Netac Technologies Co. NV3000 NVMe SSD */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1f40, 0x5236), /* Netac Technologies Co. NV7000 NVMe SSD */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1e4B, 0x1001), /* MAXIO MAP1001 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1e4B, 0x1002), /* MAXIO MAP1002 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1e4B, 0x1202), /* MAXIO MAP1202 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1e4B, 0x1602), /* MAXIO MAP1602 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1cc1, 0x5350), /* ADATA XPG GAMMIX S50 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1dbe, 0x5216), /* Acer/INNOGRIT FA100/5216 NVMe SSD */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1dbe, 0x5236), /* ADATA XPG GAMMIX S70 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1e49, 0x0021), /* ZHITAI TiPro5000 NVMe SSD */ .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, { PCI_DEVICE(0x1e49, 0x0041), /* ZHITAI TiPro7000 NVMe SSD */ .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, - { PCI_DEVICE(0xc0a9, 0x540a), /* Crucial P2 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1d97, 0x2263), /* Lexar NM610 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1d97, 0x1d97), /* Lexar NM620 */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(0x1d97, 0x2269), /* Lexar NM760 */ - .driver_data = NVME_QUIRK_BOGUS_NID | - NVME_QUIRK_IGNORE_DEV_SUBNQN, }, - { PCI_DEVICE(0x10ec, 0x5763), /* TEAMGROUP T-FORCE CARDEA ZERO Z330 SSD */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x1e4b, 0x1602), /* HS-SSD-FUTURE 2048G */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, - { PCI_DEVICE(0x10ec, 0x5765), /* TEAMGROUP MP33 2TB SSD */ - .driver_data = NVME_QUIRK_BOGUS_NID, }, + .driver_data = NVME_QUIRK_IGNORE_DEV_SUBNQN, }, { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061), .driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, }, { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0065),
Signature · 1 line
2.34.1
Keith Busch
maintainerQuoted 7 lines · Jianlin Lv
After commit
ac522fc6c316("nvme: don't reject probe due to duplicate IDs for single-ported PCIe devices") merged, vendors no longer need to use quirks in the PCI ID entry to work around the issue of duplicate IDs. TheNVME_QUIRK_BOGUS_NIDflag changes the format of device attribute file names under/dev/disk/by-id/.
For example,/dev/disk/by-id/nvme-eui.xxx->/dev/disk/by-id/nvme-nvme.xxx.
Quoted 6 lines
Considering that naming formats need to have high stability and recognizability, it is more prudent to make changes only for rare, sporadic cases rather than implementing comprehensive changes. Therefore, this patch remove default setting of
NVME_QUIRK_BOGUS_NIDflag for vendors, and the flag is added dynamically only when duplicate IDs is detected, as implemented inac522fc6c3165f.
Setting the quirk on demand lets the first scanned namespace export the "unique" identifiers as their own. Scanning isn't deterministic if you have more than one, so you wouldn't readily know which actual namespace a particular /dev/disk/by-id/ link points to.
Christoph Hellwig
maintainerQuoted 4 lines · Keith Busch
Setting the quirk on demand lets the first scanned namespace export the "unique" identifiers as their own. Scanning isn't deterministic if you have more than one, so you wouldn't readily know which actual namespace a particular
/dev/disk/by-id/link points to.
Agreed. The fact that we even allow the devices through is just to bow down to the greast Linux dictator. It's still a very bad idea for all the same reasons as it was before.