summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-10-27 20:00:12 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2018-10-27 20:00:12 +0200
commit2ee4c089741823aae794eaa2eb53780f65019981 (patch)
treea3e3df439b462a3dc3274fb038a1e0ed8dd96bf6
parentd81f4d4866ac6084d8268880fa36bec3ece460c1 (diff)
devuart: don't sleep in uartdrainoutput() when called splhi or without a process
uartdrainoutput() might be called in early initialization from uartctl() without a process.
-rw-r--r--sys/src/9/port/devuart.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/src/9/port/devuart.c b/sys/src/9/port/devuart.c
index 197e695f4..6cc9c46d8 100644
--- a/sys/src/9/port/devuart.c
+++ b/sys/src/9/port/devuart.c
@@ -318,9 +318,8 @@ uartdrained(void* arg)
static void
uartdrainoutput(Uart *p)
{
- if(!p->enabled)
+ if(!p->enabled || up == nil || !islo())
return;
-
p->drain = 1;
if(waserror()){
p->drain = 0;