linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH v2 00/18] add PCI bus-to-resource offset support in core
Date: Fri, 10 Feb 2012 09:20:22 -0800	[thread overview]
Message-ID: <CAE9FiQVqKZGacZYqXETVVaqzobiw01OyCmASUfxwZ075rdX7XA@mail.gmail.com> (raw)
In-Reply-To: <CAErSpo6zHhpz+N6y3ybDVp-oabVWAYeTt9pPJS3nz+nD2C8xkg@mail.gmail.com>

On Fri, Feb 10, 2012 at 8:55 AM, Bjorn Helgaas <bhelgaas@google.com> 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
...

Yinghai

  reply	other threads:[~2012-02-10 17:20 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10  2:36 [PATCH v2 00/18] add PCI bus-to-resource offset support in core Bjorn Helgaas
2012-02-10  2:36 ` [PATCH v2 01/18] PCI: don't publish new root bus until it's fully initialized Bjorn Helgaas
2012-02-10  2:36 ` [PATCH v2 02/18] PCI: add struct pci_host_bridge and a list of all bridges found Bjorn Helgaas
2012-02-10  3:47   ` Yinghai Lu
2012-02-10  3:47     ` Yinghai Lu
2012-02-10  4:16     ` Bjorn Helgaas
2012-02-10  2:36 ` [PATCH v2 03/18] PCI: add struct pci_host_bridge_window with CPU/bus address offset Bjorn Helgaas
2012-02-10  2:36   ` Bjorn Helgaas
2012-02-10  3:49   ` Yinghai Lu
2012-02-10  4:37     ` Bjorn Helgaas
2012-02-10  2:36 ` [PATCH v2 04/18] PCI: convert bus addresses to resource when reading BARs Bjorn Helgaas
2012-02-10  2:36 ` [PATCH v2 05/18] PCI: add generic pcibios_resource_to_bus() Bjorn Helgaas
2012-02-10  2:36 ` [PATCH v2 06/18] alpha/PCI: get rid of device resource fixups Bjorn Helgaas
2012-02-10  2:36 ` [PATCH v2 07/18] arm/PCI: " Bjorn Helgaas
2012-02-10  2:36   ` Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 08/18] ia64/PCI: SN: convert to pci_scan_root_bus() for correct root bus resources Bjorn Helgaas
2012-02-10  2:46   ` Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 09/18] ia64/PCI: get rid of device resource fixups Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 10/18] microblaze/PCI: " Bjorn Helgaas
2012-02-10  2:37   ` Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 11/18] mips/PCI: " Bjorn Helgaas
2012-02-10  2:37   ` Bjorn Helgaas
2012-02-10  2:43   ` Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 12/18] mn10300/PCI: " Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 13/18] parisc/PCI: " Bjorn Helgaas
2012-02-10  2:37   ` Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 14/18] powerpc/PCI: " Bjorn Helgaas
2012-02-10  2:37   ` Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 15/18] sh/PCI: " Bjorn Helgaas
2012-02-10  2:37   ` Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 16/18] sparc/PCI: " Bjorn Helgaas
2012-02-10  2:37   ` Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 17/18] xtensa/PCI: " Bjorn Helgaas
2012-02-10  2:37 ` [PATCH v2 18/18] PCI: collapse pcibios_resource_to_bus Bjorn Helgaas
2012-02-10  2:37   ` Bjorn Helgaas
2012-02-10  4:03 ` [PATCH v2 00/18] add PCI bus-to-resource offset support in core Yinghai Lu
2012-02-10  4:34   ` Bjorn Helgaas
2012-02-10  4:50     ` Yinghai Lu
2012-02-10 16:55       ` Bjorn Helgaas
2012-02-10 17:20         ` Yinghai Lu [this message]
2012-02-10 17:24           ` Bjorn Helgaas
2012-02-10 20:25             ` Yinghai Lu
2012-02-10 20:25               ` Yinghai Lu
2012-02-10 22:37               ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE9FiQVqKZGacZYqXETVVaqzobiw01OyCmASUfxwZ075rdX7XA@mail.gmail.com \
    --to=yinghai@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).