Page MenuHomeFreeBSD

D56994.diff
No OneTemporary

D56994.diff

diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c
--- a/sys/dev/nvme/nvme_sim.c
+++ b/sys/dev/nvme/nvme_sim.c
@@ -312,13 +312,20 @@
static int
nvme_sim_probe(device_t dev)
{
+ device_t nvmedev;
+
if (nvme_use_nvd)
return (ENXIO);
/*
* Only do storage devices with CAM. NVMHCI 1.0 interfaces are the only
- * ones that have namespaces with LBA ranges on them.
+ * ones that have namespaces with LBA ranges on them. But to ask the
+ * question, we need to ask the nvme device iif it's attached to the PCI
+ * bus. Otherwise, we assume it's storage (ahci attached nvme devices are,
+ * and any future weird bus topology devices will be).
*/
- if (pci_get_progif(device_get_parent(dev)) !=
+ nvmedev = device_get_parent(dev);
+ if (strcmp(device_get_name(device_get_parent(nvmedev)), "pci") == 0 &&
+ pci_get_progif(nvmedev) !=
PCIP_STORAGE_NVM_ENTERPRISE_NVMHCI_1_0)
return (ENXIO);

File Metadata

Mime Type
text/plain
Expires
Sat, May 23, 7:11 PM (12 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33055362
Default Alt Text
D56994.diff (930 B)

Event Timeline