make hangck work. (this is debatable, since it may always be an indication of another, more serious problem.) Reference: /n/atom/patch/applied/fsiasata Date: Mon Apr 14 07:13:10 CES 2014 Signed-off-by: quasntro@quanstro.net --- /sys/src/fs/amd64/iasata.c Mon Apr 14 07:12:47 2014 +++ /sys/src/fs/amd64/iasata.c Mon Apr 14 07:12:48 2014 @@ -996,8 +996,10 @@ { if((d->portm.feat & Datapi) == 0 && d->active && d->totick != 0 && (long)(Ticks - d->totick) > 0){ - print("%s: drive hung; resetting [%ux] ci %ux\n", - dnam(d), d->port->task, d->port->ci); + print("%s: drive hung; resetting [%ux] ci %ux %ld %ld\n", + dnam(d), d->port->task, d->port->ci, Ticks, d->totick); + clearci(d->port); + wakeup(&d->portm); d->state = Dreset; } } @@ -1146,7 +1148,7 @@ int i; for(;;){ - xtsleep(&kprocr, no, 0, Nms); + tsleep(&kprocr, no, 0, Nms); for(i = 0; i < niadrive; i++) checkdrive(iadrive[i], i); } @@ -1268,6 +1270,7 @@ xsleep(&d->portm, ahciclear, &as); d->active--; +assert(d->active == 0); ilock(d); flag = d->portm.flag; task = d->port->task;