aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-03-20 22:01:18 +0000
committerWarner Losh <imp@FreeBSD.org>2018-03-20 22:01:18 +0000
commit4e96c99bdfb3ec4738c61d189249c280ee1d465b (patch)
tree9952e638e2129ba5988160f5e25e556850c5b25c /sys
parentc176562d38c949403941e9fb18657a4697a78115 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/cardbus/cardbus.c2
-rw-r--r--sys/dev/pccard/pccard.c2
-rw-r--r--sys/dev/pccbb/pccbb.c9
3 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c
index 74dfbf22cb5ac..ae877223ec208 100644
--- a/sys/dev/cardbus/cardbus.c
+++ b/sys/dev/cardbus/cardbus.c
@@ -197,6 +197,7 @@ cardbus_attach_card(device_t cbdev)
domain = pcib_get_domain(cbdev);
bus = pcib_get_bus(cbdev);
slot = 0;
+ mtx_lock(&Giant);
/* For each function, set it up and try to attach a driver to it */
for (func = 0; func <= cardbusfunchigh; func++) {
struct cardbus_devinfo *dinfo;
@@ -230,6 +231,7 @@ cardbus_attach_card(device_t cbdev)
else
pci_cfg_save(dinfo->pci.cfg.dev, &dinfo->pci, 1);
}
+ mtx_unlock(&Giant);
if (cardattached > 0)
return (0);
/* POWER_DISABLE_SOCKET(brdev, cbdev); */
diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c
index 71926d7dca265..11966f76498ff 100644
--- a/sys/dev/pccard/pccard.c
+++ b/sys/dev/pccard/pccard.c
@@ -236,6 +236,7 @@ pccard_attach_card(device_t dev)
DEVPRINTF((dev, "Card has %d functions. pccard_mfc is %d\n", i + 1,
pccard_mfc(sc)));
+ mtx_lock(&Giant);
STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
if (STAILQ_EMPTY(&pf->cfe_head))
continue;
@@ -248,6 +249,7 @@ pccard_attach_card(device_t dev)
pf->dev = child;
pccard_probe_and_attach_child(dev, child, pf);
}
+ mtx_unlock(&Giant);
return (0);
}
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index ab378868a8b57..7957635d21074 100644
--- a/sys/dev/pccbb/pccbb.c
+++ b/sys/dev/pccbb/pccbb.c
@@ -470,14 +470,6 @@ cbb_event_thread(void *arg)
sc->flags |= CBB_KTHREAD_RUNNING;
while ((sc->flags & CBB_KTHREAD_DONE) == 0) {
mtx_unlock(&sc->mtx);
- /*
- * We take out Giant here because we need it deep,
- * down in the bowels of the vm system for mapping the
- * memory we need to read the CIS. In addition, since
- * we are adding/deleting devices from the dev tree,
- * and that code isn't MP safe, we have to hold Giant.
- */
- mtx_lock(&Giant);
status = cbb_get(sc, CBB_SOCKET_STATE);
DPRINTF(("Status is 0x%x\n", status));
if (!CBB_CARD_PRESENT(status)) {
@@ -503,7 +495,6 @@ cbb_event_thread(void *arg)
not_a_card = 0; /* We know card type */
cbb_insert(sc);
}
- mtx_unlock(&Giant);
/*
* First time through we need to tell mountroot that we're