Subject: port-i386/5727: pci_conf_write() writes erroneous i/o ports, this sometimes makes VGA console unusable
To: None <gnats-bugs@gnats.netbsd.org>
From: None <soda@sra.co.jp>
List: netbsd-bugs
Date: 07/10/1998 03:38:49
>Number:         5727
>Category:       port-i386
>Synopsis:       pci_conf_write() writes erroneous i/o ports, this sometimes makes VGA console unusable
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jul  9 11:50:01 1998
>Last-Modified:
>Originator:     Noriyuki SODA
>Organization:
	Software Research Associates, Inc.
>Release:        NetBSD-1.3F, Jul 9, 1998
>Environment:
System: NetBSD james 1.3F NetBSD 1.3F (UVM_PMAPNEW) #0: Sun Jul 5 02:59:55 JST 1998 soda@floyd:/usr/current/src/sys/arch/i386/compile/UVM_PMAPNEW i386

>Description:

On the machines which matches the following conditions,
	1. which have PCI bus
	2. which don't support PCI configuration mechanism #2
pci_conf_write() writes erroneous i/o ports, which sometimes cause
unexpected conditions.

>How-To-Repeat:

Both MOCHIDA Shuji <mochid@yo.rim.or.jp> and Kazushi (Jam) MARUKAWA
<jam@pobox.com> had respectively met this situation.
When they installed SCSI device to their machines, VGA console display
went messy.

>Fix:

Apply the following patch.

BTW, Mochida-san tracked this problem very well, I could not find this
error without his help.

------------------------------------------------------------------------
*** sys/arch/i386/pci/pci_machdep.c~	Wed Jun  3 20:15:38 1998
--- sys/arch/i386/pci/pci_machdep.c	Fri Jul 10 00:14:05 1998
***************
*** 313,318 ****
--- 313,319 ----
  	outl(PCI_MODE1_ADDRESS_REG, tag.mode1 | reg);
  	outl(PCI_MODE1_DATA_REG, data);
  	outl(PCI_MODE1_ADDRESS_REG, 0);
+ 	return;
  #endif
  
  #if !defined(PCI_CONF_MODE) || (PCI_CONF_MODE == 2)
------------------------------------------------------------------------
--
soda@sra.co.jp		Software Research Associates, Inc., Japan
(Noriyuki Soda)			Advanced Technology Group.

>Audit-Trail:
>Unformatted: