9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Weird error.
@ 2003-01-19 21:30 Dan Cross
  2003-01-19 21:32 ` Russ Cox
  2003-01-19 21:34 ` Dan Cross
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Cross @ 2003-01-19 21:30 UTC (permalink / raw)
  To: 9fans

I ran into this error trying to open /dev/eia1.  Has anyone else seen
it?  I haven't investigated it further, but it shows up after the first
either the first read or write from/to the serial port after the
following sequence of events:

(1) boot
(2) open the serial port
(3) read and write from it
(4) close it
(5) reopen it

Any ideas?

	- Dan C.



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

* Re: [9fans] Weird error.
  2003-01-19 21:30 [9fans] Weird error Dan Cross
@ 2003-01-19 21:32 ` Russ Cox
  2003-01-19 21:34 ` Dan Cross
  1 sibling, 0 replies; 5+ messages in thread
From: Russ Cox @ 2003-01-19 21:32 UTC (permalink / raw)
  To: 9fans

what is the error?



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

* Re: [9fans] Weird error.
  2003-01-19 21:30 [9fans] Weird error Dan Cross
  2003-01-19 21:32 ` Russ Cox
@ 2003-01-19 21:34 ` Dan Cross
  2003-01-20 11:20   ` Richard Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Cross @ 2003-01-19 21:34 UTC (permalink / raw)
  To: 9fans

> I ran into this error trying to open /dev/eia1.  Has anyone else seen
> it?  I haven't investigated it further, but it shows up after the first
> either the first read or write from/to the serial port after the
> following sequence of events:
> 
> (1) boot
> (2) open the serial port
> (3) read and write from it
> (4) close it
> (5) reopen it
> 
> Any ideas?

Whoops.  It would help if I included the error.

Sun Jan 19 12:45:36: mpintrenable: multiple botch irq3, tbdf 5000000, lo 00000979, n 00000979
Sun Jan 19 12:45:36: intrenable: couldn't enable irq 3, tbdf 0xFFFFFFFF for COM2

That's from my clog's.  I stripped out some carriage returns, though.  Thanks!

	- Dan C.



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

* Re: [9fans] Weird error.
  2003-01-19 21:34 ` Dan Cross
@ 2003-01-20 11:20   ` Richard Miller
  2003-01-20 20:50     ` Dan Cross
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Miller @ 2003-01-20 11:20 UTC (permalink / raw)
  To: 9fans

> Sun Jan 19 12:45:36: mpintrenable: multiple botch irq3, tbdf 5000000, lo 00000979, n 00000979

It's a benign error message resulting from the interaction of three
mostly harmless bugs:

1.  intdisable() on x86 MP architecture doesn't actually disable
interrupts.  The comment says:
	 * For now, none of this will work with the APIC code,

2.  i8250disable() marks the UART disabled after calling intdisable(),
without checking whether the disable succeeded.  So the next time the
UART device is opened the interrupt is enabled again.

3.  mpintrenablex() doesn't distinguish correctly between enabling a
device twice and enabling multiple devices (or multifunction devices)
which share an interrupt.

I think 2.  would be the easiest to fix, for example as follows:

/sys/src/9/pc/fns.h:61 c fns.h:61
< void	intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
---
> int	intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
/sys/src/9/pc/trap.c:67 c trap.c:67
< void
---
> int
/sys/src/9/pc/trap.c:79 c trap.c:79
< 		return;
---
> 		return -1;
/sys/src/9/pc/trap.c:95 a trap.c:96
> 	return 0;
/sys/src/9/pc/uarti8250.c:530,531 c uarti8250.c:530,531
< 		intrdisable(ctlr->irq, i8250interrupt, uart, ctlr->tbdf, uart->name);
< 		ctlr->iena = 0;
---
> 		if(intrdisable(ctlr->irq, i8250interrupt, uart, ctlr->tbdf, uart->name) == 0)
> 			ctlr->iena = 0;



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

* Re: [9fans] Weird error.
  2003-01-20 11:20   ` Richard Miller
@ 2003-01-20 20:50     ` Dan Cross
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Cross @ 2003-01-20 20:50 UTC (permalink / raw)
  To: 9fans

> It's a benign error message resulting from the interaction of three
> mostly harmless bugs:

Cool.  Thanks for the great explanation, Richard.

	- Dan C.



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

end of thread, other threads:[~2003-01-20 20:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-19 21:30 [9fans] Weird error Dan Cross
2003-01-19 21:32 ` Russ Cox
2003-01-19 21:34 ` Dan Cross
2003-01-20 11:20   ` Richard Miller
2003-01-20 20:50     ` Dan Cross

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).