Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* irq 7 on AlphaBIOS machines
@ 2000-03-22 17:31 Ivan Kokshaysky
  2000-03-22 18:24 ` Maciej W. Rozycki
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Kokshaysky @ 2000-03-22 17:31 UTC (permalink / raw)
  To: axp-list

I have no idea what the code below was intended to do, but it
effectively freezes XT-PIC and all devices on it (keyboard,
mouse, IDE etc.) with the first parport interrupt.
[For 2.2.x arch/alpha/kernel/irq.c must be fixed]

Ivan.

--- linux-2.3.99-pre3/arch/alpha/kernel/irq_i8259.c	Thu Mar  2 22:35:12 2000
+++ linux/arch/alpha/kernel/irq_i8259.c	Wed Mar 22 19:36:50 2000
@@ -146,12 +146,6 @@
 	 */
 	int j = *(vuip) IACK_SC;
 	j &= 0xff;
-	if (j == 7) {
-		if (!(inb(0x20) & 0x80)) {
-			/* It's only a passive release... */
-			return;
-		}
-	}
 	handle_irq(j, regs);
 }
 #endif


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

* Re: irq 7 on AlphaBIOS machines
  2000-03-22 17:31 irq 7 on AlphaBIOS machines Ivan Kokshaysky
@ 2000-03-22 18:24 ` Maciej W. Rozycki
  2000-03-24 15:54   ` Ivan Kokshaysky
  0 siblings, 1 reply; 4+ messages in thread
From: Maciej W. Rozycki @ 2000-03-22 18:24 UTC (permalink / raw)
  To: axp-list

On Wed, 22 Mar 2000, Ivan Kokshaysky wrote:

> I have no idea what the code below was intended to do, but it
> effectively freezes XT-PIC and all devices on it (keyboard,
> mouse, IDE etc.) with the first parport interrupt.

 It looks like a spurious 8259A interrupt detection, i.e. it checks if bit
7 of ISR is set.  An 8259A feeds a default IRQ 7 to the host whenever no
IRQ is active upon receipt of an interrupt acknowledge.  No ISR bit is set
in this case. 

 The code looks right provided the 8259A is configured to return the
contents of ISR (Interrupt Service Register) on read by default.  If it's
configured for IRR (Interrupt Request Register), then the code needs to be
fixed.  Basically you need to outb(0x0b, 0x20) in the 8259A setup code to
switch to ISR or outb(0x0a, 0x20) to switch to IRR. 

 I can't see any of these statements in the current Alpha code.  So the
8259A retains whatever setup the console left over.  I think an 8259A
defaults to IRR after initialization (but I'll have to lookup the
datasheet to be sure). 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


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

* Re: irq 7 on AlphaBIOS machines
  2000-03-22 18:24 ` Maciej W. Rozycki
@ 2000-03-24 15:54   ` Ivan Kokshaysky
  2000-03-24 18:31     ` Maciej W. Rozycki
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Kokshaysky @ 2000-03-24 15:54 UTC (permalink / raw)
  To: axp-list; +Cc: Richard Henderson

On Wed, Mar 22, 2000 at 07:24:33PM +0100, Maciej W. Rozycki wrote:
>  It looks like a spurious 8259A interrupt detection, i.e. it checks if bit
> 7 of ISR is set.  An 8259A feeds a default IRQ 7 to the host whenever no
> IRQ is active upon receipt of an interrupt acknowledge.  No ISR bit is set
> in this case. 
> 
Anyway, it won't detect spurious interrupts from PIC 2 (IRQ 15).

>  The code looks right provided the 8259A is configured to return the
> contents of ISR (Interrupt Service Register) on read by default.

It _is_ configured to IRR at least on lx164 and sx164, so that
code is wrong. And a generic kernel code seems to be relying
on the status read returning IRR - see isa_no_iack_sc_device_interrupt().

So I think the patch I posted is correct because
- spurious interrupts should be harmless for current kernels
- duplicating i386 code for spurious interrupt detection
  would buy nothing except the warning about broken hardware
- it would be a pain checking such code on an each possible
  platform/firmware/kernel combination

Ivan.


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

* Re: irq 7 on AlphaBIOS machines
  2000-03-24 15:54   ` Ivan Kokshaysky
@ 2000-03-24 18:31     ` Maciej W. Rozycki
  0 siblings, 0 replies; 4+ messages in thread
From: Maciej W. Rozycki @ 2000-03-24 18:31 UTC (permalink / raw)
  To: axp-list; +Cc: Richard Henderson

On Fri, 24 Mar 2000, Ivan Kokshaysky wrote:

> Anyway, it won't detect spurious interrupts from PIC 2 (IRQ 15).

 Right.

> It _is_ configured to IRR at least on lx164 and sx164, so that
> code is wrong. And a generic kernel code seems to be relying
> on the status read returning IRR - see isa_no_iack_sc_device_interrupt().

 Hmm, I don't have 2.3.99 handy and 2.3.42 have no such function.  But why
would generic code handle 8259A -- the chip is not generic at all.  Oh
well...

 I checked docs meanwhile and IRR is really the default state, BTW. 

> So I think the patch I posted is correct because
> - spurious interrupts should be harmless for current kernels

 Correct.

> - duplicating i386 code for spurious interrupt detection
>   would buy nothing except the warning about broken hardware

 I am not the one to decide whether it's useful or not.  You asked for an
explanation for the code, so I provided it.

 Warnings of broken hardware can prove useful as the recent BP6 (that's a
dual-Celeron board) case showed.  Enabling of APIC error interrupts let us
know the board works under marginal conditions, probably due to a design
error.  We can now safely assume any strange behaviour of such systems is
not a Linux's fault. 

 On the other hand current Alpha hardware is of better quality than PC one
and the situation isn't going to change any soon, I suppose (i.e. prices
will remain high). 

> - it would be a pain checking such code on an each possible
>   platform/firmware/kernel combination

 Why would it?

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


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

end of thread, other threads:[~2000-03-24 18:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-22 17:31 irq 7 on AlphaBIOS machines Ivan Kokshaysky
2000-03-22 18:24 ` Maciej W. Rozycki
2000-03-24 15:54   ` Ivan Kokshaysky
2000-03-24 18:31     ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox