summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/sdiahci.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-02-23 14:05:01 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2020-02-23 14:05:01 +0100
commitb7089d66ad5a26a2b39c1c1e17a4761cd1670728 (patch)
tree4de09ccb592cb93dc4681baad87fb7f76b677a6f /sys/src/9/pc/sdiahci.c
parent68f15d65942da7e30cf9cbae7362f778fe5da1d2 (diff)
sdiahci, sdodin: avoid calling kproc() while holding ilock()
Diffstat (limited to 'sys/src/9/pc/sdiahci.c')
-rw-r--r--sys/src/9/pc/sdiahci.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/sys/src/9/pc/sdiahci.c b/sys/src/9/pc/sdiahci.c
index 053fafa70..d474f6209 100644
--- a/sys/src/9/pc/sdiahci.c
+++ b/sys/src/9/pc/sdiahci.c
@@ -1546,21 +1546,25 @@ iaenable(SDev *s)
c = s->ctlr;
ilock(c);
- if(!c->enabled){
- if(once == 0)
- kproc("iasata", satakproc, 0);
- if(c->ndrive == 0)
- panic("iaenable: zero s->ctlr->ndrive");
- pcisetbme(c->pci);
- snprint(name, sizeof name, "%s (%s)", s->name, s->ifc->name);
- intrenable(c->pci->intl, iainterrupt, c, c->pci->tbdf, name);
- /* supposed to squelch leftover interrupts here. */
- ahcienable(c->hba);
- c->enabled = 1;
- if(++once == niactlr)
- kproc("ialed", ledkproc, 0);
+ if(c->enabled){
+ iunlock(c);
+ return 1;
}
+ if(c->ndrive == 0)
+ panic("iaenable: zero s->ctlr->ndrive");
+ pcisetbme(c->pci);
+ snprint(name, sizeof name, "%s (%s)", s->name, s->ifc->name);
+ intrenable(c->pci->intl, iainterrupt, c, c->pci->tbdf, name);
+ /* supposed to squelch leftover interrupts here. */
+ ahcienable(c->hba);
+ c->enabled = 1;
iunlock(c);
+
+ if(once == 0)
+ kproc("iasata", satakproc, 0);
+ if(++once == niactlr)
+ kproc("ialed", ledkproc, 0);
+
return 1;
}