From: jiang.liu@linux.intel.com (Jiang Liu)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC v2 5/7] PCI/ACPI: Consolidate common PCI host bridge code into ACPI core
Date: Wed, 13 May 2015 13:36:08 +0800 [thread overview]
Message-ID: <5552E2C8.70307@linux.intel.com> (raw)
In-Reply-To: <5550B056.2080608@linaro.org>
On 2015/5/11 21:36, Hanjun Guo wrote:
> Hi Jiang,
>
> I have comments inline.
>
> On 2015?05?05? 10:46, Jiang Liu wrote:
>> Introduce common interface acpi_pci_root_create() and related data
>> structures to create PCI root bus for ACPI PCI host bridges. It will
>> be used to kill duplicated arch specific code for IA64 and x86. It may
>> also help ARM64 in future.
>>
>> Tested-by: Tony Luck <tony.luck@intel.com>
>> Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
>> ---
>> +struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
>> + struct acpi_pci_root_ops *ops,
>> + size_t extra_size)
>> +{
>> + int ret, busnum = root->secondary.start;
>> + struct acpi_device *device = root->device;
>> + struct acpi_pci_root_info_common *info;
>> + struct pci_bus *bus;
>> +
>> + info = kzalloc(sizeof(*info) + extra_size, GFP_KERNEL);
>
> For x86, the memory is allocated on its local numa node if memory
> is available by using kzalloc_node(), and if
> node = acpi_get_node(device->handle) is NUMA_NO_NODE, the code will
> get the numa node info by using x86_pci_root_bus_node() (which you
> consolidate them as a function pci_acpi_root_get_node() in later
> patch).
>
> but the code here just ignore that information, so the code
> here has functional change for x86 code since you didn't use numa
> information.
>
> I'm not sure how frequently used for the info after init, so
> not sure about the performance impact, but I think we should
> keep consistence with the code behavior as before.
Hi Hanjun,
Good catch, will change code to respect NUMA node
info when allocating memory.
>
> Further more, there is a implicit cast for
> struct acpi_pci_root_info_common *info to arch specific
> struct pci_root_info *info by using extra size, it's not
> easy to understand (at least for me :) ), so how about
> alloc the memory in arch specific function, and pass
> struct acpi_pci_root_info_common *info fr this function?
Good suggestion.
Thanks!
Gerry
> other than that, this code is pretty good, I reworked ARM64
> ACPI based PCI host bridge init code, and this patch simplified
> the coed a lot, will have a test tomorrow and let you know
> the result.
>
> Thanks
> Hanjun
next prev parent reply other threads:[~2015-05-13 5:36 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-05 2:46 [RFC v2 0/7] Consolidate ACPI PCI root common code into ACPI core Jiang Liu
2015-05-05 2:46 ` [RFC v2 1/7] ACPI/PCI: Enhance ACPI core to support sparse IO space Jiang Liu
2015-05-11 13:01 ` Hanjun Guo
2015-05-05 2:46 ` [RFC v2 2/7] ia64/PCI/ACPI: Use common ACPI resource parsing interface for host bridge Jiang Liu
2015-05-11 13:04 ` Hanjun Guo
2015-05-05 2:46 ` [RFC v2 3/7] ia64/PCI: Use common struct resource_entry to replace struct iospace_resource Jiang Liu
2015-05-05 2:46 ` [RFC v2 4/7] x86/PCI: Rename struct pci_sysdata as struct pci_controller Jiang Liu
2015-05-05 2:46 ` [RFC v2 5/7] PCI/ACPI: Consolidate common PCI host bridge code into ACPI core Jiang Liu
2015-05-11 13:36 ` Hanjun Guo
2015-05-13 5:36 ` Jiang Liu [this message]
2015-05-13 9:29 ` Hanjun Guo
2015-05-13 12:24 ` Jiang Liu
2015-05-13 13:25 ` Hanjun Guo
2015-05-14 1:09 ` Jiang Liu
2015-05-14 4:05 ` Hanjun Guo
2015-05-14 4:42 ` Jiang Liu
2015-05-05 2:46 ` [RFC v2 6/7] x86/PCI/ACPI: Use common interface to support PCI host bridge Jiang Liu
2015-05-12 12:19 ` Hanjun Guo
2015-05-13 5:38 ` Jiang Liu
2015-05-05 2:46 ` [RFC v2 7/7] ia64/PCI/ACPI: " Jiang Liu
2015-05-05 3:10 ` [RFC v2 0/7] Consolidate ACPI PCI root common code into ACPI core Hanjun Guo
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=5552E2C8.70307@linux.intel.com \
--to=jiang.liu@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.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).