Re: [PATCH v9 5/6] PCI: generic: Make pci-host-generic driver numa aware
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Ganapatrao Kulkarni <gpkulkarni@xxxxxxxxx>
- Subject: Re: [PATCH v9 5/6] PCI: generic: Make pci-host-generic driver numa aware
- From: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
- Date: Tue, 19 Jan 2016 09:41:50 +0000
- Cc: David Daney <ddaney.cavm@xxxxxxxxx>, Will Deacon <Will.Deacon@xxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>, Ganapatrao Kulkarni <gkulkarni@xxxxxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "devicetree@xxxxxxxxxxxxxxx" <devicetree@xxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, linux-pci@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-metag@xxxxxxxxxxxxxxx, linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, Catalin Marinas <catalin.marinas@xxxxxxx>, Grant Likely <grant.likely@xxxxxxxxxx>, Leif Lindholm <leif.lindholm@xxxxxxxxxx>, rfranz@xxxxxxxxxx, Ard Biesheuvel <ard.biesheuvel@xxxxxxxxxx>, "msalter@xxxxxxxxxx" <msalter@xxxxxxxxxx>, Rob Herring <robh+dt@xxxxxxxxxx>, Steve Capper <steve.capper@xxxxxxxxxx>, Hanjun Guo <hanjun.guo@xxxxxxxxxx>, Al Stone <al.stone@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Pawel Moll <pawel.moll@xxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, Ian Campbell <ijc+devicetree@xxxxxxxxxxxxxx>, Kumar Gala <galak@xxxxxxxxxxxxxx>, "Rafael J. Wysocki" <rjw@xxxxxxxxxxxxx>, Len Brown <lenb@xxxxxxxxxx>, Marc Zyngier <marc.zyngier@xxxxxxx>, tony.luck@xxxxxxxxx, fenghua.yu@xxxxxxxxx, james.hogan@xxxxxxxxxx, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, "tglx@xxxxxxxxxxxxx" <tglx@xxxxxxxxxxxxx>, mingo@xxxxxxxxxx, hpa@xxxxxxxxx, x86@xxxxxxxxxx, Jon Masters <jonathan@xxxxxxxxxxxxxx>, Robert Richter <rrichter@xxxxxxxxxx>, Prasun Kapoor <Prasun.Kapoor@xxxxxxxxxxxxxxxxxx>
- In-reply-to: <CAFpQJXXESn1EA5kotVOH2oLbRUSpOLf6+MeWG1pY_GhUP+4vVQ@mail.gmail.com>
- List-id: <linux-ia64.vger.kernel.org>
- References: <1453134965-6125-1-git-send-email-gkulkarni@caviumnetworks.com> <1453134965-6125-6-git-send-email-gkulkarni@caviumnetworks.com> <569D23AF.9050503@gmail.com> <CAFpQJXXESn1EA5kotVOH2oLbRUSpOLf6+MeWG1pY_GhUP+4vVQ@mail.gmail.com>
- User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Jan 19, 2016 at 11:28:56AM +0530, Ganapatrao Kulkarni wrote:
> On Mon, Jan 18, 2016 at 11:11 PM, David Daney <ddaney.cavm@xxxxxxxxx> wrote:
> > On 01/18/2016 08:36 AM, Ganapatrao Kulkarni wrote:
> >>
> >> update numa_node of device associated with pci bus.
> >> moved down devm_kzalloc to allocate from node memory.
> >>
> >> Signed-off-by: Ganapatrao Kulkarni <gkulkarni@xxxxxxxxxxxxxxxxxx>
> >> ---
> >> drivers/pci/host/pci-host-generic.c | 9 ++++++---
> >> 1 file changed, 6 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/pci/host/pci-host-generic.c
> >> b/drivers/pci/host/pci-host-generic.c
> >> index 5434c90..0e1ce06 100644
> >> --- a/drivers/pci/host/pci-host-generic.c
> >> +++ b/drivers/pci/host/pci-host-generic.c
> >> @@ -215,11 +215,9 @@ static int gen_pci_probe(struct platform_device
> >> *pdev)
> >> const struct of_device_id *of_id;
> >> struct device *dev = &pdev->dev;
> >> struct device_node *np = dev->of_node;
> >> - struct gen_pci *pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL);
> >> + struct gen_pci *pci;
> >> struct pci_bus *bus, *child;
> >>
> >> - if (!pci)
> >> - return -ENOMEM;
> >>
> >> type = of_get_property(np, "device_type", NULL);
> >> if (!type || strcmp(type, "pci")) {
> >> @@ -230,6 +228,11 @@ static int gen_pci_probe(struct platform_device
> >> *pdev)
> >> of_pci_check_probe_only();
> >>
> >> of_id = of_match_node(gen_pci_of_match, np);
> >> + set_dev_node(dev, of_node_to_nid(np));
> >
> >
> > This shouldn't be done in individual platform_drivers, but instead in the
> > device probing code.
> >
> > There is code that does this in drivers/of/platform.c and
> > drivers/of/device.c Is that not being called for the pci-host-gweneric
> > devices? If not, we should figure out why, and perhaps attempt to fix it
> > rather than doing it here.
> is it more appropriate to call of_platform_device_create ?
That's already done to create the platform device by OF core when
populating devices from DT, what David suggested is that you should
add set_dev_node() to core OF code instead of adding it specifically
to the PCI host generic code.
Lorenzo
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]