On Fri, Feb 10, 2012 at 9:20 AM, Yinghai Lu <yinghai@xxxxxxxxxx> wrote: > On Fri, Feb 10, 2012 at 8:55 AM, Bjorn Helgaas <bhelgaas@xxxxxxxxxx> wrote: > ... >>> >>> I mean, we can unify sysdata usuage, make them all most the same. >>> >>> and for some sysdata, already acting like host_bridge struct with >>> domain, numa_node, and resources. >>> >>>> If you can show an example of what you mean, maybe it will help me understand. >>> >>> just looked the sys_data of different arch, >>> >>> looks like pci_sys_data for arm already include the io offset >>> >>> arch/arm/include/asm/mach/pci.h:: >>> >>> struct pci_sys_data { >>> #ifdef CONFIG_PCI_DOMAINS >>> int domain; >>> #endif >>> struct list_head node; >>> int busnr; /* primary bus number >>> */ >>> u64 mem_offset; /* bus->cpu memory mapping >>> offset */ >>> unsigned long io_offset; /* bus->cpu IO mapping offset >>> */ >>> struct pci_bus *bus; /* PCI bus >>> */ >>> struct list_head resources; /* root bus resources (apertures) >> >> Let me try again. Maybe your idea is that we should create something >> like "struct pcibios_sysdata" and require every arch to define a >> struct with that name. Every arch's struct would contain some members >> such as "domain," "mem_offset," "io_offset," and "resources." These >> would have standard names & types across all arches and would be >> referenced by the PCI core. In addition, the struct could include >> arch-specific data such as "acpi_handle," "iommu," etc. >> >> That way, the core could implement things like pci_domain_nr() and >> pci_bus_to_resource() by using the data in struct pcibios_sysdata. >> The current "void *sysdata" parameters to pci_scan_bus() and friends >> would become "struct pcibios_sysdata *sysdata". >> >> I like the idea of unifying the sysdata struct name and changing from >> a "void *" to something like "struct pcibios_sysdata *". That might >> be worth doing. > > what i am mean: > 1. make every arch to use same name for the struct, but could have > different contents. > struct pci_sys_data. > 2. unify member field name, by changing name > pci_first_busno ==> first_busno > pci_last_busno ==> last_busno > or adding > first_busno > last_busno > 3. changing more filed like domain, node > and io_offset, mem_offset > ... That's exactly what I said above, isn't it? (In the paragraph starting "Let me try again.") As I said, the reason I don't like that approach is that I don't want a dozen copies of first_busno, last_busno, domain, node, io_offset, mem_offset, etc. That information is not architecture-specific, so we shouldn't keep it in an architecture-specific struct. Bjorn -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html