Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: More pci alignment fallout?



On Sun, Feb 10, 2008 at 02:38:08PM -0500, Thor Lancelot Simon wrote:
> viapcib0 at pci0 dev 17 function 0panic: kernel diagnostic assertion "(reg &
> 0x3) == 0" failed: file "/home/tls/folsom/sys/arch/x86/pci/pci_machdep.c",
> line 379

Please try the attached patch and check that the SMBus revision is
correct afterwards.

Joerg
Index: viapcib.c
===================================================================
RCS file: /data/repo/netbsd/src/sys/arch/i386/pci/viapcib.c,v
retrieving revision 1.7
diff -u -p -r1.7 viapcib.c
--- viapcib.c   4 Jan 2008 21:17:42 -0000       1.7
+++ viapcib.c   11 Feb 2008 13:19:19 -0000
@@ -180,7 +180,7 @@ viapcib_attach(struct device *parent, st
        simple_lock_init(&sc->sc_lock);
 
        val = pci_conf_read(pa->pa_pc, pa->pa_tag, SMB_HOST_CONFIG);
-       if ((val & 1) == 0) {
+       if ((val & 0x10000) == 0) {
                printf(": SMBus is disabled\n");
                addr = 0;
                /* XXX We can enable the SMBus here by writing 1 to
@@ -204,7 +204,7 @@ viapcib_attach(struct device *parent, st
 #endif /* !VIAPCIB_DEBUG */
 
        val = pci_conf_read(pa->pa_pc, pa->pa_tag, SMB_REVISION);
-       sc->sc_revision = val;
+       sc->sc_revision = val >> 16;
 
 core_pcib:
        pcibattach(parent, self, opaque);
Index: viapcibreg.h
===================================================================
RCS file: /data/repo/netbsd/src/sys/arch/i386/pci/viapcibreg.h,v
retrieving revision 1.1
diff -u -p -r1.1 viapcibreg.h
--- viapcibreg.h        17 Mar 2006 12:19:49 -0000      1.1
+++ viapcibreg.h        11 Feb 2008 13:18:46 -0000
@@ -36,7 +36,7 @@
 #define        SMB_BASE2               0x80
 #define        SMB_BASE3               0xd0
 
-#define        SMB_HOST_CONFIG         0xd2
+#define        SMB_HOST_CONFIG         0xd0
 #define        SMB_REVISION            (SMB_HOST_CONFIG + 4)
 
 /* SMBus register offsets; from Linux and FreeBSD */


Home | Main Index | Thread Index | Old Index