From patchwork Mon Jan 18 16:36:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapatrao Kulkarni X-Patchwork-Id: 8056531 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 CB7DC9F1CC for ; Mon, 18 Jan 2016 17:24:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03EFB20483 for ; Mon, 18 Jan 2016 17:24:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 142BE20461 for ; Mon, 18 Jan 2016 17:24:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932263AbcARRXP (ORCPT ); Mon, 18 Jan 2016 12:23:15 -0500 Received: from mail-bn1bon0074.outbound.protection.outlook.com ([157.56.111.74]:4338 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755894AbcARRXJ (ORCPT ); Mon, 18 Jan 2016 12:23:09 -0500 X-Greylist: delayed 2770 seconds by postgrey-1.27 at vger.kernel.org; Mon, 18 Jan 2016 12:23:07 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Ganapatrao.Kulkarni@caviumnetworks.com; Received: from mypc.cavium.com.com (111.93.218.67) by BY1PR0701MB1691.namprd07.prod.outlook.com (10.162.110.29) with Microsoft SMTP Server (TLS) id 15.1.365.19; Mon, 18 Jan 2016 16:37:36 +0000 From: Ganapatrao Kulkarni To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH v9 5/6] PCI: generic: Make pci-host-generic driver numa aware Date: Mon, 18 Jan 2016 22:06:04 +0530 Message-ID: <1453134965-6125-6-git-send-email-gkulkarni@caviumnetworks.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1453134965-6125-1-git-send-email-gkulkarni@caviumnetworks.com> References: <1453134965-6125-1-git-send-email-gkulkarni@caviumnetworks.com> MIME-Version: 1.0 X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0010.INDPRD01.PROD.OUTLOOK.COM (25.164.117.17) To BY1PR0701MB1691.namprd07.prod.outlook.com (25.162.110.29) X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1691; 2:mV9VSlwfLGlBABl58VLEVBOGo5vCMkd+h0wjASoAsuTEhhKc0OwIWTCI77f7GJtYTFMQxcABINQGQyQKyPU1l0U1DKq+JZOTszlU4qm6W9D+oiMziy7xEaniPcLD9jnu01qtS2QMiaHd2y4j3+oZjw==; 3:NbSAaorPga73Q0IS0C4mvCATv3SHXVofGZWSpCcl3rgmAU54dG5WSCmonqCxluUD4436BR5eTUwNBX1Eh9lXjQGGaMF3X5HkXt371jjqMxdBGriprW50M4P++ealNEQw; 25:rW/BQkf5pSKX16DDUlsmkabZm8PwarMn+Y6Dp5yQkWV1bOjdLoXlebfWQgq3slfGCMLR6utlHlPYkajg9CdRs8xFcZDz5k5Quv6clZK4v6Gp1OLPTpTi2c6YVfSL0T4vN+14iaKYQLmjvXcjLcuRBKAhdR/tNj3UStpJRS3t20omdR2xnWqZ2O7oncwqUtA83IbKabJGA+gLrscMkvqGWW+nARvuZ2+C22WYSjQXQDXwffvshsZ9GPZhTcBxoeDk X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1691; X-MS-Office365-Filtering-Correlation-Id: 3ff2380a-f25d-45ad-f343-08d32025b25a X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1691; 20:RMr3xW2IMmxv53WAkPyz4I3WNHNLKGQs/aioRVzJkPO0AfF0GYZDnNw8f4XynuUsjtznlaksXKahDNxwgrGr/dr7zoHeQSkXiEdQpPp5rViitobXZq8AF6erfa5U+eeirStujg5xaPswYRvhOlNSohKpiQrSJ3EfP0F5wzL+H8Yq3gxwGSmcNhQnc1qs/EQtwI+9wf/9yGpYjecbNyhMiccnek55U1GeCEUtxn76CiAERej5X/UMymR0jXZiV1df7ncPh2+XvN2yOeQiU8TmfRwlaxBh1SGXMPdmI6PsQnFOhQBO2AUhXqcg9jP/mrP9m9Joiz9sUpfvoswiLFXh9hRuL0d355ouJ12a8y1urnXNECz6NX4XTkNTnx1VTOS77pBAs+CNiASZUFvQTKQLkIDiRqZ5XsFzjUCZMNmnVzsdFJRJVVfTREgZyDYn2P0gher0cMqtSDGOc/WBQohpFmhpwuN58sYq5pnZkQ2tDxA3SwVFwI0D0J0erGexprpqG1m3RsgvY5uycWnTdmtyYRINj0TeJCHvfFRD7sK3fxCPlUrBZBWWFOrocGD4+1t/BsvYuUvEi1AUO4lCbjroXy6+bjoUt6kDp6zc27PtVNs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:BY1PR0701MB1691; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1691; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1691; 4:RA7ie7XQOVMOGLoBwqs4hMQmNIb+yLK73s5BOB+ev9TicKrgqt/s7AWNE41pyNqW7wnbbSkLOjbzxvilYb7aq7aeD4E6hThmjf/ndJGCAVzlY3n5oD9ztNLmw4xpGzCr3r476c+UxMH6kuOMaCDEzTVbFNeqEnwwgVq7NQZSg6rujUFfQrhszD9sa1QujPfneP//u5Bt/BbeFF6LR1hXt2vG+7BVctIqunc/Olie40Gc9iYsKY+J76rP+7EAq9dOePyyEivmA0IuulXeVBs7aCjlZZV+Bj1ymwFz0xkuZm9jBSJpEuvIn+2DfARzuIzrXfcILFyq3b+IcbLTmM7eTFknZjOuTyKreslK1eTuxKAS1oEaGbgoRXa1iahPJlbH X-Forefront-PRVS: 08252193F3 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(230783001)(5009440100003)(87976001)(66066001)(4326007)(6116002)(5008740100001)(2201001)(1096002)(36756003)(3846002)(586003)(189998001)(19580395003)(47776003)(5004730100002)(50466002)(2441003)(50226001)(19580405001)(76176999)(48376002)(97736004)(101416001)(50986999)(5001770100001)(5003940100001)(4001450100002)(33646002)(229853001)(92566002)(2906002)(40100003)(105586002)(42186005)(77096005)(106356001)(122386002)(2950100001)(7099028)(41533002)(921003)(83996005)(1121003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1691; H:mypc.cavium.com.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: caviumnetworks.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0701MB1691; 23:/lIYZHWOOpjoJFfwcsSKp0wHyj3c7qfVxFlxCgk?= =?us-ascii?Q?sVg7u7bxKuOACs8pIKuyvyLwXbpCd0fMqVq9ZFFUieQtjYbUAdQ4r2HXEoju?= =?us-ascii?Q?6MQ6qIE6tfdI9YbHueTtd2thdfeHFl59ESv7SGO1ok2W9/mONP+YEXwCF9AE?= =?us-ascii?Q?H/7zeNKMexLtdYHyU2BSRTSOS9SjCNLzlUdGz92KEegnM3AzthlLNHxy58ic?= =?us-ascii?Q?bv4iE+RACe4rOk4uB4nLDe6tHDp48TYCJzF5Ln8eOkGQkWSH8UqKi3kfbVsv?= =?us-ascii?Q?nryZwZky4cxFBGOT2igPLUz+vZpb84DSAMZjevcnQaOblYWG76PEjgHfQhT8?= =?us-ascii?Q?QoiATFV+L1qpFton3qTObbTzx/wN5+y11dXxLTq/CcJtfOFMMtolNIj4+PkN?= =?us-ascii?Q?fkQUTXtCwF7HbLxyCo2WqfdDRB7QAiePErGy/W7mxJvNO/H9KNybXYQnG8ww?= =?us-ascii?Q?YVK5DKvcmXkr/5G1MuDI8LDdVH3t1a717L3Ap1lyk2SvrRODJQCvsOLmG6oS?= =?us-ascii?Q?QW+HZz94DwMgx1XOTXPUp4I5tPSowVkbuwqpURuNczlbkC0FDuG2ry//P5Ls?= =?us-ascii?Q?1rCi5WbeEiA8LBZB+jOk+V98urN/9BKTrXMZJGOAsquphwkMCtp+4RJ0LpRB?= =?us-ascii?Q?rKiThzT5ZkETvLNOsWq10RLpwpy4evADicAEHUehnUB3WhfkNMA6rL/GTgnN?= =?us-ascii?Q?6Fo9DvjJdTq+Tc6wDPkWdlYy0OpVu1WGTQPaKubT1NuT+BAn8hH1qK/xHgxP?= =?us-ascii?Q?F4ZxTPqwczTDZJ/KTIs1GHqPJOAPoQHsZJOAQiaJtvNC4g4QQdiONMflyQ5d?= =?us-ascii?Q?mddUha2EFDLUJM9fx8rJGWTDTMp911awEGT9EF94duNF1zrCjNGAl/Mp1yTz?= =?us-ascii?Q?Iul6ipicHu9PEM3ik4kYXSWqXHoIarzv47FtOhfDtkhLzXCbhZG3JQQCsbsl?= =?us-ascii?Q?KkBa7nVUcDUN5RVYtqQI72r07riPKF6l69V7cmjrnMEgRbZLPlaTOnuyk5bd?= =?us-ascii?Q?YI7XE4NdDItPAUhgvyrchgqUdPuSVDZd1FnfJCQ3AjrNq5ovoYsWgwQDBN1z?= =?us-ascii?Q?FtbPOi7opqKal28tRQq/IgILz55KucqJJKHjwUk0aedizMpl9+waHf4JYwfW?= =?us-ascii?Q?T1B5/f5nOZOttKHcOn8b7LMbM+MFXp43wBvyCXVGAJBWnXSHhIlm+ZvYwiyC?= =?us-ascii?Q?zjurqpL4+gqmiKEx0TjrbK03PInOtUMyIypqE5aRWctHTp/F9JZFTQKwHig?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1691; 5:pfZs22riM7a8TcA+xsRgTIizgbrKt4xO66HA3FsUGDPxi7MvMx9RxO95s3Q254AB/bvA5UEV0U2qehNjWdfc34/p4dscPVxzXC+ZEh0/PvGenzioSC6ivgdi9pzl07gwiDeNb0faHSRbvr8HtjbmEw==; 24:kllvDiTT/zKAQidJgWFiH+GK1uk1dIYQhxD+QhCW6sqLJmFOI7CNfdDLdMnac4OydBOcdQDakT1iSNBWHDzw6fb+fykRUwydTazvsAeykzE= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2016 16:37:36.9114 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1691 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 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)); + 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);