Subject: Re: LKMized SBUS driver
To: Pete Zaitcev <zaitcev@redhat.com>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: port-sparc
Date: 11/27/2001 04:07:18
On Mon, Nov 26, 2001 at 18:46:04 -0500, Pete Zaitcev wrote:

> > FWIW, I have a very strange problem with com @ ebus in Krups
> > JavaStation.  When comstart is called with fewer than 8 bytes, I
> > receive an interrupt from com, but the IIR register denies any
> > knowledge of ever sending one (IIR_NOPEND) - thus making it a stray
> > interrupt (since comintr sees IIR_NOPEND and returns 0 immediately).
> > The work-around I came up with is to modify comstart to send the chunk
> > of data first and enable TX interrupts only after that.  This might be
> > a chip glitch, but I mention it here to give you an example of a stray
> > interrupt in a situation where you wouldn't expect (from reading the
> > source) to have one.
> 
> I never saw anything like that on Krups, its serial always
> worked perfectly for me. 

Well, that's beause the protocol is slightly different in NetBSD and
Linux, it seems.

A very casual glance at su.c shows that su_start simply enables TX
buffer empty interrupts and, I assume, sends the first chunk of data
when the interrupt is serviced.

OTOH, our comstart (syssrc/dev/ic/com.c) sends the first chunk of data
right away.  An alternative fix I tested is to only enable the
interrupt in comstart just like Linux does (as I can see now).

I talked briefly with Charles Hannum and he said that it *might* be a
bug in the protocol, but that a lot of testing is required since the
com driver is machine independent and is used by almost all the ports.
Unfortunately I lack any hardware skills to check if the behavior I
observe is a hardware glitch of the Krups or not.


> MrCoffee, on the other hand...
> 
> static inline void
> su_outb(struct su_struct *info, unsigned long offset, int value)
> {
> #ifndef __sparc_v9__
>         /*
>          * MrCoffee has weird schematics: IRQ4 & P10(?) pins of SuperIO are
>          * connected with a gate then go to SlavIO. When IRQ4 goes tristated
>          * gate outputs a logical one. Since we use level triggered interrupts
>          * we have lockup and watchdog reset. We cannot mask IRQ because
>          * keyboard shares IRQ with us (Word has it as Bob Smelik's design).
>          * This problem is similar to what Alpha people suffer, see serial.c.
>          */
>         if (offset == UART_MCR) value |= UART_MCR_OUT2;
> #endif
>         outb(value, info->port + offset);
> }

Our driver sets this bit (MCR_IENABLE) by default unless MD glue tells
it not to during autoconfiguration, so I never had a chance to observe
the problem described in the comment above.


SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen