lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1453134965-6125-6-git-send-email-gkulkarni@caviumnetworks.com>
Date:	Mon, 18 Jan 2016 22:06:04 +0530
From:	Ganapatrao Kulkarni <gkulkarni@...iumnetworks.com>
To:	<linux-arm-kernel@...ts.infradead.org>,
	<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-pci@...r.kernel.org>, <linux-ia64@...r.kernel.org>,
	<linux-metag@...r.kernel.org>, <linuxppc-dev@...ts.ozlabs.org>,
	<linux-s390@...r.kernel.org>, <linux-sh@...r.kernel.org>,
	<linux-arch@...r.kernel.org>, <Will.Deacon@....com>,
	<catalin.marinas@....com>, <grant.likely@...aro.org>,
	<leif.lindholm@...aro.org>, <rfranz@...ium.com>,
	<ard.biesheuvel@...aro.org>, <msalter@...hat.com>,
	<robh+dt@...nel.org>, <steve.capper@...aro.org>,
	<hanjun.guo@...aro.org>, <al.stone@...aro.org>, <arnd@...db.de>,
	<pawel.moll@....com>, <mark.rutland@....com>,
	<ijc+devicetree@...lion.org.uk>, <galak@...eaurora.org>,
	<rjw@...ysocki.net>, <lenb@...nel.org>, <marc.zyngier@....com>,
	<lorenzo.pieralisi@....com>, <bhelgaas@...gle.com>,
	<tony.luck@...el.com>, <fenghua.yu@...el.com>,
	<james.hogan@...tec.com>, <benh@...nel.crashing.org>,
	<tglx@...utronix.de>, <mingo@...hat.com>, <hpa@...or.com>,
	<x86@...nel.org>, <jonathan@...masters.org>, <rrichter@...ium.com>,
	<Prasun.Kapoor@...iumnetworks.com>
CC:	<gpkulkarni@...il.com>
Subject: [PATCH v9 5/6] PCI: generic: Make pci-host-generic driver numa aware

update numa_node of device associated with pci bus.
moved down devm_kzalloc to allocate from node memory.

Signed-off-by: Ganapatrao Kulkarni <gkulkarni@...iumnetworks.com>
---
 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);
-- 
1.8.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ