summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2017-12-19 00:40:27 +0000
committerRobert Mustacchi <rm@joyent.com>2019-01-15 01:29:11 +0000
commit0de99a4637b946f1cd1c7d9fb5949112e1afb82f (patch)
treedf9cd73c299dd98f4b8aa4d91b15960289057e65
parent9d76a618dbc5cbfb6e7905939f771b01eb62bb55 (diff)
downloadillumos-joyent-0de99a4637b946f1cd1c7d9fb5949112e1afb82f.tar.gz
OS-7494 PCI hotplug probe doesn't properly handle ARI devices
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Approved by: Jordan Hendricks <jordan.hendricks@joyent.com>
-rw-r--r--usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c b/usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c
index 09cf261d9b..b482117c7c 100644
--- a/usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c
+++ b/usr/src/uts/intel/io/hotplug/pcicfg/pcicfg.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, Joyent, Inc.
*/
/*
@@ -557,7 +558,7 @@ pcicfg_configure(dev_info_t *devi, uint_t device, uint_t function,
pci_bus_range_t pci_bus_range;
int rv;
int circ;
- uint_t highest_bus;
+ uint_t highest_bus, visited = 0;
int ari_mode = B_FALSE;
int max_function = PCI_MAX_FUNCTIONS;
int trans_device;
@@ -669,6 +670,11 @@ pcicfg_configure(dev_info_t *devi, uint_t device, uint_t function,
goto cleanup;
}
+ /*
+ * Note that we've successfully gone through and visited at
+ * least one node.
+ */
+ visited++;
next:
/*
* Determine if ARI Forwarding should be enabled.
@@ -696,7 +702,7 @@ next:
goto cleanup;
/*
- * Check if there are more fucntions to probe.
+ * Check if there are more functions to probe.
*/
if (next_function == 0) {
DEBUG0("Next Function - "
@@ -712,7 +718,7 @@ next:
ndi_devi_exit(devi, circ);
- if (func == 0)
+ if (visited == 0)
return (PCICFG_FAILURE); /* probe failed */
else
return (PCICFG_SUCCESS);