From patchwork Tue Jan 19 05:58:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 8058241 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B78399F96D for ; Tue, 19 Jan 2016 05:59:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E372D20357 for ; Tue, 19 Jan 2016 05:59:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0426C20411 for ; Tue, 19 Jan 2016 05:59:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752141AbcASF7t (ORCPT ); Tue, 19 Jan 2016 00:59:49 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35714 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751109AbcASF67 (ORCPT ); Tue, 19 Jan 2016 00:58:59 -0500 Received: by mail-wm0-f65.google.com with SMTP id 123so13670370wmz.2; Mon, 18 Jan 2016 21:58:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=E8m47l5Bsdkoyo/NcoWoGC+rUyxOX1EUDF2UzXL5fvY=; b=OzoRGRwaSE/fBBXFr4az8j/sIDXkWKw341lfXYZwsrSTkA6yi3HtkazW3iQ7LoZvUz JIrePmaRNMa8IDP7vYQ7pJbA6ruj93AE19Ih1C5yJAFgv4fL5RgmU6P7fLgc1anRCHoN S/zBx9EEA+HblMUoEkTPL1ZaasOjrRGh8rGckRvrJ8rRp0fXYz+2yltW4jAGcNCCRF1O bdbH4Z0vZ9VSGrLdGjKK2j4+br/BW7vaSkaYcjSiMXyM8uojRHnFGraZVJiUvgrKezvL w3y3RbN1/nHpNmf95hpOkrsH4UW2M8hel/7oe54VQtGXLuM36y1kgg+MlnriPf5a3JSt sYhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=E8m47l5Bsdkoyo/NcoWoGC+rUyxOX1EUDF2UzXL5fvY=; b=m/pLi9aMNNitOOrhSWU1pvfKo8/1C8d9jTlysl6u3XSsE83AZ5DZZvSewMlfwZ6dOL 0YCr8T0xcxnffwCzKXgTNJ5fYb4Suxn0sTyOpg8errDO5oXlU97Wyrk4fx+MGUKvA4cV AdUkkpBje7YeWYE3m3p7DKP5F+ALZZm0+0vPMgGlSOKnMT1CjuNeNrK26FQt3XGO8kNp dS3bVFdJvWyF/NYYUT2lONM0g36W2OlxW+r+UbnlamrBpeOyDrHWWaU6aWu8eUlKW91e 0FHvS+Fix9tL34CDIEN2OlQmo7eu8CKdfE5p1VPnF2tWKE6assN/Qe/wHwlF/Znyl1Jz qzGw== X-Gm-Message-State: AG10YOQCEr1PL+JFRhv0Q0r/Dy3X0VuEL2+fK3jc9uqQ2bfLUU2vtXeq2yjdpU8f3rjjRIuafKapX1aUqnYfyg== MIME-Version: 1.0 X-Received: by 10.28.184.76 with SMTP id i73mr16058741wmf.43.1453183136939; Mon, 18 Jan 2016 21:58:56 -0800 (PST) Received: by 10.27.10.26 with HTTP; Mon, 18 Jan 2016 21:58:56 -0800 (PST) In-Reply-To: <569D23AF.9050503@gmail.com> References: <1453134965-6125-1-git-send-email-gkulkarni@caviumnetworks.com> <1453134965-6125-6-git-send-email-gkulkarni@caviumnetworks.com> <569D23AF.9050503@gmail.com> Date: Tue, 19 Jan 2016 11:28:56 +0530 Message-ID: Subject: Re: [PATCH v9 5/6] PCI: generic: Make pci-host-generic driver numa aware From: Ganapatrao Kulkarni To: David Daney , Will Deacon , Bjorn Helgaas Cc: Ganapatrao Kulkarni , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-pci@vger.kernel.org, linux-ia64@vger.kernel.org, linux-metag@vger.kernel.org, linuxppc-dev , linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-arch@vger.kernel.org, Catalin Marinas , Grant Likely , Leif Lindholm , rfranz@cavium.com, Ard Biesheuvel , "msalter@redhat.com" , Rob Herring , Steve Capper , Hanjun Guo , Al Stone , Arnd Bergmann , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , "Rafael J. Wysocki" , Len Brown , Marc Zyngier , Lorenzo Pieralisi , tony.luck@intel.com, fenghua.yu@intel.com, james.hogan@imgtec.com, Benjamin Herrenschmidt , "tglx@linutronix.de" , mingo@redhat.com, hpa@zytor.com, x86@kernel.org, Jon Masters , Robert Richter , Prasun Kapoor Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Jan 18, 2016 at 11:11 PM, David Daney 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 >> --- >> 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 ? > > > >> + pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL); >> + if (!pci) >> + return -ENOMEM; >> + >> pci->cfg.ops = (struct gen_pci_cfg_bus_ops *)of_id->data; >> pci->host.dev.parent = dev; >> INIT_LIST_HEAD(&pci->host.windows); >> > thanks Ganapat --- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/pci/host/pci-host-generic.c +++ b/drivers/pci/host/pci-host-generic.c @@ -24,6 +24,7 @@ #include #include #include +#include struct gen_pci; @@ -466,7 +467,7 @@ 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)); + of_platform_device_create(np, NULL, NULL); pci = devm_kzalloc(dev, sizeof(*pci), GFP_KERNEL); if (!pci) return -ENOMEM;