[openib-general] Re: mthca and LinuxBIOS

yhlu yhlu.kernel at gmail.com
Fri Aug 5 13:28:04 PDT 2005


please check the patch for fix overwrite upper 32bit 

YH

--- drivers/pci/setup-res.c.orig        2005-08-05 10:08:45.000000000 -0700
+++ drivers/pci/setup-res.c     2005-08-05 13:25:06.000000000 -0700
@@ -33,6 +33,18 @@
        u32 new, check, mask;
        int reg;

+        if (resno < 6) {
+                reg = PCI_BASE_ADDRESS_0 + 4 * resno;
+                if((resno & 1)==1) {
+                        /* check if previous reg is 64 mem */
+                        pci_read_config_dword(dev, reg-4, &check );
+                        if ((check &
(PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
+                           
(PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64))
+                                return;
+                }
+
+        }
+
        pcibios_resource_to_bus(dev, &region, res);

        pr_debug("  got res [%lx:%lx] bus [%lx:%lx] flags %lx for "
@@ -67,7 +79,7 @@

        if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) ==
            (PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) {
-               new = 0; /* currently everyone zeros the high address */
+               new = region.start >> 32 ;
                pci_write_config_dword(dev, reg + 4, new);
                pci_read_config_dword(dev, reg + 4, &check);
                if (check != new) {



More information about the general mailing list