summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Altherr <rick@oxidecomputer.com>2022-06-21 09:15:28 -0700
committerRichard Lowe <richlowe@richlowe.net>2022-06-29 20:22:44 -0500
commitda37308cbe221e77b90426b63bf79a8b67c490b0 (patch)
tree663c66747ca0cc94517f0b23c5ad6c04635e37e2
parentd5d1522f61a203e5d41826580ab94c4ffe4c8a37 (diff)
downloadillumos-joyent-da37308cbe221e77b90426b63bf79a8b67c490b0.tar.gz
14747 pcieb_attach: race between pcie_init_root_port_mps and hotplug events
Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org> Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r--usr/src/uts/common/io/pciex/pcie.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/src/uts/common/io/pciex/pcie.c b/usr/src/uts/common/io/pciex/pcie.c
index 81b31790e6..ce81339ea2 100644
--- a/usr/src/uts/common/io/pciex/pcie.c
+++ b/usr/src/uts/common/io/pciex/pcie.c
@@ -22,7 +22,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2019 Joyent, Inc.
- * Copyright 2021 Oxide Computer Company
+ * Copyright 2022 Oxide Computer Company
*/
#include <sys/sysmacros.h>
@@ -2254,9 +2254,12 @@ pcie_init_root_port_mps(dev_info_t *dip)
{
pcie_bus_t *bus_p = PCIE_DIP2BUS(dip);
int rp_cap, max_supported = pcie_max_mps;
+ int circular_count;
+ ndi_devi_enter(dip, &circular_count);
(void) pcie_get_fabric_mps(ddi_get_parent(dip),
ddi_get_child(dip), &max_supported);
+ ndi_devi_exit(dip, circular_count);
rp_cap = PCI_CAP_GET16(bus_p->bus_cfg_hdl, 0,
bus_p->bus_pcie_off, PCIE_DEVCAP) &