NetBSD-Bugs archive

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

Re: kern/38380: cbb disable (bad Vcc request)



Sorry, I invert my two files in the patch. Here is the right patch:


--- pccbb.c_1.167       2008-04-07 12:54:18.000000000 +0200
+++ pccbb.c     2008-04-07 12:55:45.000000000 +0200
@@ -393,6 +393,7 @@
        bus_addr_t sockbase;
        char devinfo[256];
        int flags;
+       int pwrmgt_offs;

 #ifdef __HAVE_PCCBB_ATTACH_HOOK
        pccbb_attach_hook(parent, self, pa);
@@ -426,6 +427,21 @@

        sc->sc_flags &= ~CBB_MEMHMAPPED;

+       /* power management: set D0 state */
+       if (pci_get_capability(pc, pa->pa_tag, PCI_CAP_PWRMGMT,
+           &pwrmgt_offs, 0)) {
+ reg = pci_conf_read(pc, pa->pa_tag, pwrmgt_offs + PCI_PMCSR);
+               if ((reg & PCI_PMCSR_STATE_MASK) != PCI_PMCSR_STATE_D0 ||
+                   reg & 0x100 /* PCI_PMCSR_PME_EN */) {
+                       reg &= ~PCI_PMCSR_STATE_MASK;
+                       reg |= PCI_PMCSR_STATE_D0;
+                       reg &= ~(0x100 /* PCI_PMCSR_PME_EN */);
+                       pci_conf_write(pc, pa->pa_tag,
+                           pwrmgt_offs + PCI_PMCSR, reg);
+               }
+
+       }
+
        /*
         * MAP socket registers and ExCA registers on memory-space
         * When no valid address is set on socket base registers (on pci


Home | Main Index | Thread Index | Old Index