Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - make agp_amd64_attach() also checks AMD64 Fami...



details:   https://anonhg.NetBSD.org/src/rev/ffa64ce61f38
branches:  trunk
changeset: 777619:ffa64ce61f38
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Feb 25 21:21:09 2012 +0000

description:
- make agp_amd64_attach() also checks AMD64 Family 10h CPU's
  misc configuration devices
- print proper error message if no misc configuration device is found

Fixes kernel crash right after starting Xserver with radeondrm
on ASRock AM2NF3-VSTA (AM2 + nForce3 250 AGP) with Athlon II X2 CPU.

diffstat:

 sys/dev/pci/agp_amd64.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r f79fecf0896c -r ffa64ce61f38 sys/dev/pci/agp_amd64.c
--- a/sys/dev/pci/agp_amd64.c   Sat Feb 25 20:03:58 2012 +0000
+++ b/sys/dev/pci/agp_amd64.c   Sat Feb 25 21:21:09 2012 +0000
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: agp_amd64.c,v 1.6 2010/11/13 13:52:04 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agp_amd64.c,v 1.7 2012/02/25 21:21:09 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -224,13 +224,16 @@
                tag = pci_make_tag(pa->pa_pc, 0, i, 3);
                id = pci_conf_read(pa->pa_pc, tag, PCI_ID_REG);
                if (PCI_VENDOR(id) == PCI_VENDOR_AMD &&
-                   PCI_PRODUCT(id) == PCI_PRODUCT_AMD_AMD64_MISC) {
+                   (PCI_PRODUCT(id) == PCI_PRODUCT_AMD_AMD64_MISC ||
+                    PCI_PRODUCT(id) == PCI_PRODUCT_AMD_AMD64_F10_MISC)) {
                        asc->mctrl_tag[n] = tag;
                        n++;
                }
        }
-       if (n == 0)
+       if (n == 0) {
+               aprint_error(": No Miscellaneous Control unit found.\n");
                return ENXIO;
+       }
        asc->n_mctrl = n;
 
        aprint_normal(": %d Miscellaneous Control unit(s) found.\n",



Home | Main Index | Thread Index | Old Index