Subject: Re: port-alpha/21472 and kern/16379 (ohci/USB problems on Alpha)
To: NetBSD/alpha Discussion List <port-alpha@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: port-alpha
Date: 09/23/2004 16:16:27
Re: kern/16379: Serious problems with the ohci driver on a DEC PWS 500au (Alpha)
Re: port-alpha/21472: USB device interferes with IDE device; interrupt lossage

OK, so removing the USB devices from the kernel doesn't solve the
problem well enough, at least not for 1.6.x on the ES40.

Something like this appears when trying to do bulk data reads from the
CD-ROM, e.g. when trying to unpack the binary/sets files from the
INSTALL kernel (which has no ohci* driver and no other USB device
drivers):

	pciide0:0:0: lost interrupt
		type: atapi tc_bcount: 65536 tc_skip: 0
	pciide0:0:0: bus-master DMA error: missing interrupt, status=0x21
	cd0: transfer error, downgrading to PIO mode 4
	cd0(pciide0:0:0): using PIO mode 4
	pciide0:0:0: lost interrupt
		type: atapi tc_bcount: 0 tc_skip: 65536
	[[ ... ]]
	pciide0:0:0: lost interrupt
		type: atapi tc_bcount: 0 tc_skip: 65536
	[[ ... ]]
	pciide0:0:0: lost interrupt
		type: atapi tc_bcount: 0 tc_skip: 8192

This seems to almost exactly match what was reported in PR#16379 and the
thread that lead up to that PR, except that I don't seem to see any
corresponding "stray IRQ" messages.

I find the following in sys/arch/alpha/pci/pci_6600.c:

revision 1.2
date: 2000/03/19 02:25:29;  author: thorpej;  state: Exp;  lines: +69 -26
branches:  1.2.2;
Add support for mapping the OHCI USB controller interrupt (which is wired toan ISA IRQ because it's in the same package as the PCI-ISA bridge).

However on the ES40 the device probes as follows:

	ohci0 at pci0 dev 19 function 0: Acer Labs M5237 USB Host Controller (rev. 0x03)
	ohci0: interrupting at isa irq 10
	ohci0: OHCI version 1.0, legacy support

So is it really on an ISA IRQ when it probes as a PCI device?

According to the SRM's "show config" the only thing that actually seems
to be on the ISA bus is the floppy (of the things it knows about):

P00>>>show config
                           hp AlphaServer ES40

Firmware
SRM Console:    V6.7-1
ARC Console:    v5.71
PALcode:        OpenVMS PALcode V1.98-104, Tru64 UNIX PALcode V1.92-105
Serial ROM:     V2.12-F  
RMC ROM:        V1.0
RMC Flash ROM:  V2.8

Processors
CPU 0           Alpha EV67 pass 2.6 666 MHz  8MB Bcache
CPU 1           Alpha EV67 pass 2.6 666 MHz  8MB Bcache
CPU 2           Alpha EV67 pass 2.6 666 MHz  8MB Bcache
CPU 3           Alpha EV67 pass 2.6 666 MHz  8MB Bcache

Core Logic
Cchip           DECchip 21272-CA Rev 9(C4)
Dchip           DECchip 21272-DA Rev 2
Pchip 0         DECchip 21272-EA Rev 2
Pchip 1         DECchip 21272-EA Rev 2
TIG             Rev 10

Memory
  Array       Size       Base Address    Intlv Mode
---------  ----------  ----------------  ----------
    0       4096Mb     0000000000000000    4-Way
    1       4096Mb     0000000100000000    4-Way
    2       4096Mb     0000000200000000    4-Way
    3       4096Mb     0000000300000000    4-Way

     16384 MB of System Memory

 Slot   Option                  Hose 0, Bus 0, PCI
   1    47551002                                    
   2/0  Adaptec AIC-7899        pkb0.7.0.2.0            SCSI Bus ID 7
                                dkb0.0.0.2.0            COMPAQ BF01864663
                                dkb100.1.0.2.0          COMPAQ BF01864663
   2/1  Adaptec AIC-7899        pkc0.7.0.102.0          SCSI Bus ID 7
   3    23121077/01001077                           
   4    DE500-BA Network Con    ewb0.0.0.4.0            08-00-2B-C4-B5-26
   7    Acer Labs M1543C                                Bridge to Bus 1, ISA
  15    Acer Labs M1543C IDE    dqa.0.0.15.0        
                                dqb.0.1.15.0        
                                dqa0.0.0.15.0           COMPAQ CDR-8435
  19    Acer Labs M1543C USB                        

        Option                  Hose 0, Bus 1, ISA
        Floppy                  dva0.0.0.1000.0     

 Slot   Option                  Hose 1, Bus 0, PCI
   1    DE500-BA Network Con    ewa0.0.0.1.1            08-00-2B-C4-7A-70
   2    23121077/01001077                           
   4    NCR 53C895              pka0.7.0.4.1            SCSI Bus ID 7
   6    DEGXA-TA Gigabit Eth    ega0.0.0.6.1            00-08-02-91-89-AE
P00>>>

Once a long time ago Ross Harvey posted about the PWS500au USB problems:
> 
> Sigh, look at line 147 of alpha/pci/pci_6600.c. When I did the EV6             
> port the USB host bridge had 0xea in its PCI LINE register as well.            

Does this suggest that Nathan's  patches for USB on PWS500au to
pci_550.c still also need to be made to pci_6600.c?

Shall I build a PCI_CONFIG_DUMP kernel?

I still don't know how to ask the SRM for info about interrupts (or to
interpret what it may already have told me).

Maybe I should just toss out the stupid IDE CD-ROM and install a SCSI
one so that I can turn off the IDE controller too?  I have no problem
accessing SCSI disks -- at least not so far with labeling and newfs....

A post long ago (mail-index.netbsd.org/port-alpha/2002/08/06/0000.html)
suggests that upgrading the firmware helped get 1.5.3 to recognize the
USB devices on a DS10.  Does anyone know if it might also solve the
"lost interrupt" problem?

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>