2.5 and 2.4: fix PCI IO BAR flags

2.5 and 2.4: fix PCI IO BAR flags

Post by Russell Kin » Sat, 16 Mar 2002 22:20:10



There is a problem where the resource flags sometimes contain bits from
the address part of the PCI BAR, especially when you have the low address
bit set for an IO BAR.

(bit 3 of a PCI IO BAR is an address bit, and (bar & 0xf) propagates this
to res->flags).

This exists in Ivan Kokshaysky PCI patches, and so far hasn't made it into
the kernel.  It's required for IDE on certain ARM machines to even work.

This patch fixes this.  Please apply.

--- orig/drivers/pci/pci.c      Fri Mar 15 10:13:53 2002

                        l = 0;
                if ((l & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_MEMORY) {
                        res->start = l & PCI_BASE_ADDRESS_MEM_MASK;
+                       res->flags |= l & ~PCI_BASE_ADDRESS_MEM_MASK;
                        sz = pci_size(sz, PCI_BASE_ADDRESS_MEM_MASK);
                } else {
                        res->start = l & PCI_BASE_ADDRESS_IO_MASK;
+                       res->flags |= l & ~PCI_BASE_ADDRESS_IO_MASK;
                        sz = pci_size(sz, PCI_BASE_ADDRESS_IO_MASK & 0xffff);
                }
                res->end = res->start + (unsigned long) sz;
-               res->flags |= (l & 0xf) | pci_calc_resource_flags(l);
+               res->flags |= pci_calc_resource_flags(l);
                if ((l & (PCI_BASE_ADDRESS_SPACE | PCI_BASE_ADDRESS_MEM_TYPE_MASK))
                    == (PCI_BASE_ADDRESS_SPACE_MEMORY | PCI_BASE_ADDRESS_MEM_TYPE_64)) {
                        pci_read_config_dword(dev, reg+4, &l);

--

             http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. 2.4,2.5: fix pci compile without procfs support

pci_proc_* is only there if CONFIG_PROC_FS is defined...

(this should apply to both 2.4 and 2.5 trees)

-Eric

--- /usr/tmp/TmpDir.9804-0/linux/drivers/pci/pci.c_1.48 Wed Mar  6 11:32:23 2002

 EXPORT_SYMBOL(pci_add_new_bus);
 EXPORT_SYMBOL(pci_do_scan_bus);
 EXPORT_SYMBOL(pci_scan_slot);
+#ifdef CONFIG_PROC_FS
 EXPORT_SYMBOL(pci_proc_attach_device);
 EXPORT_SYMBOL(pci_proc_detach_device);
 EXPORT_SYMBOL(pci_proc_attach_bus);
 EXPORT_SYMBOL(pci_proc_detach_bus);
 #endif
+#endif

 EXPORT_SYMBOL(pci_set_power_state);
 EXPORT_SYMBOL(pci_save_state);

--
Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. Q: How to get ip-adr. from pty-name of a telnet session

3. 2.4: Minor build fix for ext3 (2.4 and 2.5)

4. Windows review

5. NFS io errors on transfer from system running 2.4 to system running 2.5

6. Coming from the Linux realm, few questions...

7. PATCH: specialix fix from 2.4 missing in 2.5

8. newbie -- how to use panel and pad together

9. Fix incorrect enablebits for all AMD IDE chips, 2.4 and 2.5

10. 2.4 and 2.5: fix /proc/kcore

11. lowlatency fixes needed in 2.4 and 2.5

12. FIX: pc_keyb.c in >2.2.17 2.4.x 2.5.x

13. [2.4/2.5] Fix ns83820 ioctl oops