Subject: kern/20710: pciide is broken on SiS745
To: None <gnats-bugs@gnats.netbsd.org>
From: None <toshii@netbsd.org>
List: netbsd-bugs
Date: 03/15/2003 19:15:51
>Number:         20710
>Category:       kern
>Synopsis:       pciide is broken SiS745
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 15 02:16:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     IWAMOTO Toshihiro
>Release:        NetBSD 1.6P
>Organization:
	
>Environment:
System: NetBSD pepper.my.domain 1.6P NetBSD 1.6P (PEPPER) #128: Sat Mar 15 15:42:12 JST 2003 root@pepper.my.domain:/sys/arch/i386/compile/PEPPER i386
Architecture: i386
Machine: i386
>Description:
	Recent change in pciide broke DMA support of SiS745 chipset.

	pciide0 at pci0 dev 2 function 5Silicon Integrated System 745 IDE controller (rev. 0x01)
	pciide0: bus-master DMA support presentpci_mem_find: void region
	, but unused (couldn't map registers)
	pciide0: primary channel wired to compatibility mode

>How-To-Repeat:
	Boot with a current kernel.
>Fix:
	pa shouldn't be overwritten at least on SiS745 systems,
	because doing this would change pa to the attach arg of
	PCI host bridge, which isn't a IDE device.

	As I'm not sure how this patch affects other chipsets,
	I'm sending this PR instead of just committing.

Index: pciide.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pciide.c,v
retrieving revision 1.182
diff -u -r1.182 pciide.c
--- pciide.c	2003/03/14 22:46:05	1.182
+++ pciide.c	2003/03/15 10:01:15
@@ -3233,7 +3233,7 @@
 	if (pciide_chipen(sc, pa) == 0)
 		return;
 	printf("Silicon Integrated System ");
-	pci_find_device(pa, sis_hostbr_match);
+	pci_find_device(NULL, sis_hostbr_match);
 	if (sis_hostbr_type_match) {
 		if (sis_hostbr_type_match->type == SIS_TYPE_SOUTH) {
 			pciide_pci_write(sc->sc_pc, sc->sc_tag, SIS_REG_57,
@@ -3247,7 +3247,7 @@
 				sc->sc_wdcdev.UDMA_cap =
 			    	    sis_hostbr_type_match->udma_mode;
 			} else {
-				if (pci_find_device(pa, sis_south_match)) {
+				if (pci_find_device(NULL, sis_south_match)) {
 					sc->sis_type = SIS_TYPE_133OLD;
 					sc->sc_wdcdev.UDMA_cap =
 				    	    sis_hostbr_type_match->udma_mode;
>Release-Note:
>Audit-Trail:
>Unformatted: