diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-05-24 02:11:37 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-05-24 02:11:37 +0200 |
commit | 3869d7a8437e2a9902529cd68915dddcb43e6782 (patch) | |
tree | 2f8f1cd9fb7f50822289e604ed1720702984cc9d | |
parent | a54804ed24165e4d9e3d433149f8535f6ce01058 (diff) |
usbehci: avoid kproc() while holding poll lock
-rw-r--r-- | sys/src/9/port/usbehci.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/src/9/port/usbehci.c b/sys/src/9/port/usbehci.c index 470e1f2a6..5ac7486cf 100644 --- a/sys/src/9/port/usbehci.c +++ b/sys/src/9/port/usbehci.c @@ -2278,12 +2278,15 @@ pollcheck(Hci *hp) if(poll->must != 0 && poll->does == 0){ lock(poll); - if(poll->must != 0 && poll->does == 0){ - poll->does++; - print("ehci %#p: polling\n", ctlr->capio); - kproc("ehcipoll", ehcipoll, hp); + if(poll->must == 0 || poll->does != 0) { + unlock(poll); + return; } + poll->does++; unlock(poll); + + print("ehci %#p: polling\n", ctlr->capio); + kproc("ehcipoll", ehcipoll, hp); } } |