Subject: port-sparc64/11940: MI PCI device drivers may not work on sparc64
To: None <gnats-bugs@gnats.netbsd.org>
From: Martin Husemann <martin@duskware.de>
List: netbsd-bugs
Date: 01/11/2001 16:05:13
>Number:         11940
>Category:       port-sparc64
>Synopsis:       MI PCI device drivers may not work on sparc64
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 11 16:05:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Martin Husemann
>Release:        1.5Q as of Jan 08, 2001
>Organization:
	
>Environment:
	
System: NetBSD night-porter.duskware.de 1.5Q NetBSD 1.5Q (PORTER) #0: Fri Jan 5 15:25:38 MET 2001 martin@night-porter.duskware.de:/usr/src/sys/arch/i386/compile/PORTER i386
Architecture: i386
Machine: i386
>Description:

Sparc64 disables IO access on PCI busses by default, even if it would be
possible to allow it. Drivers have to explicitly enable IO access before
mapping BARs to IO space. MI drivers generally don't do this, as no other
port requires it.

>How-To-Repeat:

Plug in an arbitray PCI card that has IO BARs with no corespondig memory
BARs (examples: the joystick port on a Forte Media FM-801, which attaches
as 

joy0 at pci0 dev 9 function 1: vendor 0x1319 product 0x0802 (rev 0xb1)
joy0: joystick not connected

on the i386 - this function is defined by the PCI spec as definitively being
an IO space BAR. Or cards with drivers that do only try IO access (probably
many drivers ported from other OSs without appropriate care will fall
into this category).

>Fix:
Set the IO enabled bit in the PCI attach args struct and enable IO the
first time a driver maps an IO space BAR.
>Release-Note:
>Audit-Trail:
>Unformatted: