9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] sdiahci.c on sources broken?
@ 2008-09-25 19:58 cinap_lenrek
  2008-09-26  4:41 ` Lucio De Re
  0 siblings, 1 reply; 3+ messages in thread
From: cinap_lenrek @ 2008-09-25 19:58 UTC (permalink / raw)
  To: 9fans

this is from eriks contrib:

static void
westerndigitalhung(Drive *d)
{
	if((d->portm.feat&Datapi) == 0 && d->active &&
	    TK2MS(Ticks-d->intick) > 5000){
		dprint("%s: drive hung; resetting [%lux] ci=%lux\n",
			d->unit->name, d->port->task, d->port->ci);
		d->state = Dreset;
	}
}

and this is the version on sources:

static void
westerndigitalhung(Drive *d)
{
	if((d->portm.feat&Datapi) == 0 && d->active && TK2MS(d->intick) > 5000){
		dprint("%s: drive hung; resetting [%lux] ci %lx\n",
			d->unit->name, d->port->task, d->port->ci);
		d->state = Dreset;
	}
}

if i understand it right, d->intick is just the point in time it started some
io request. it does:

p->intick = MACHP(0)->ticks;
p->active++;

so it seems the version on sources is wrong, and eriks version does the right thing.
(calculating the time the operation takes (current time - time of request start))

can somebody confirm this?

--
cinap




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-09-26  6:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-25 19:58 [9fans] sdiahci.c on sources broken? cinap_lenrek
2008-09-26  4:41 ` Lucio De Re
2008-09-26  6:37   ` Uriel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).