linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Becky Bruce <becky.bruce@freescale.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH 3/4] POWERPC: Drop archdata numa_node
Date: Mon,  8 Sep 2008 14:09:54 -0500	[thread overview]
Message-ID: <1220900995-11928-4-git-send-email-becky.bruce@freescale.com> (raw)
In-Reply-To: <1220900995-11928-3-git-send-email-becky.bruce@freescale.com>

Use the struct device's numa_node instead; use accessor functions
to get/set numa_node.

Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
---
64-bit folks: Please test when you get a moment.  I've build-tested this,
but I do not have the ability to actually boot it on anything.  Yes, I know
this fundamentally doesn't have much relation to the dma merge, except that
doing this saves me some ifdeffing in the code in a later patch.  Also,
since I've renamed dma_64.c to dma.c, I wanted to do this after the rename
so it's easier to see the history in git.

Thanks!
-Becky

 arch/powerpc/include/asm/device.h       |    3 ---
 arch/powerpc/kernel/dma-iommu.c         |    2 +-
 arch/powerpc/kernel/dma.c               |    2 +-
 arch/powerpc/kernel/of_device.c         |    2 +-
 arch/powerpc/kernel/pci_64.c            |    7 ++-----
 arch/powerpc/kernel/vio.c               |    2 +-
 arch/powerpc/platforms/cell/iommu.c     |    6 +++---
 arch/powerpc/platforms/ps3/system-bus.c |    2 +-
 8 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/include/asm/device.h b/arch/powerpc/include/asm/device.h
index 228ab2a..dfd504c 100644
--- a/arch/powerpc/include/asm/device.h
+++ b/arch/powerpc/include/asm/device.h
@@ -16,9 +16,6 @@ struct dev_archdata {
 	/* DMA operations on that device */
 	struct dma_mapping_ops	*dma_ops;
 	void			*dma_data;
-
-	/* NUMA node if applicable */
-	int			numa_node;
 };
 
 #endif /* _ASM_POWERPC_DEVICE_H */
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index 01091f1..49248f8 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -20,7 +20,7 @@ static void *dma_iommu_alloc_coherent(struct device *dev, size_t size,
 {
 	return iommu_alloc_coherent(dev, dev->archdata.dma_data, size,
 				    dma_handle, device_to_mask(dev), flag,
-				    dev->archdata.numa_node);
+				    dev_to_node(dev));
 }
 
 static void dma_iommu_free_coherent(struct device *dev, size_t size,
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index 44e3486..124f867 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -29,7 +29,7 @@ static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
 {
 	struct page *page;
 	void *ret;
-	int node = dev->archdata.numa_node;
+	int node = dev_to_node(dev);
 
 	page = alloc_pages_node(node, flag, get_order(size));
 	if (page == NULL)
diff --git a/arch/powerpc/kernel/of_device.c b/arch/powerpc/kernel/of_device.c
index e9be908..93ae5b1 100644
--- a/arch/powerpc/kernel/of_device.c
+++ b/arch/powerpc/kernel/of_device.c
@@ -78,7 +78,7 @@ struct of_device *of_device_alloc(struct device_node *np,
 	dev->dev.parent = parent;
 	dev->dev.release = of_release_dev;
 	dev->dev.archdata.of_node = np;
-	dev->dev.archdata.numa_node = of_node_to_nid(np);
+	set_dev_node(&dev->dev, of_node_to_nid(np));
 
 	if (bus_id)
 		strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE);
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 30eedfc..1f75bf0 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -558,11 +558,8 @@ void __devinit pcibios_setup_new_device(struct pci_dev *dev)
 	    sd->of_node ? sd->of_node->full_name : "<none>");
 
 	sd->dma_ops = pci_dma_ops;
-#ifdef CONFIG_NUMA
-	sd->numa_node = pcibus_to_node(dev->bus);
-#else
-	sd->numa_node = -1;
-#endif
+	set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
+
 	if (ppc_md.pci_dma_dev_setup)
 		ppc_md.pci_dma_dev_setup(dev);
 }
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 2750fba..434c92a 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1232,7 +1232,7 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
 	else
 		viodev->dev.archdata.dma_ops = &dma_iommu_ops;
 	viodev->dev.archdata.dma_data = vio_build_iommu_table(viodev);
-	viodev->dev.archdata.numa_node = of_node_to_nid(of_node);
+	set_dev_node(&viodev->dev, of_node_to_nid(of_node));
 
 	/* init generic 'struct device' fields: */
 	viodev->dev.parent = &vio_bus_device.dev;
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index e06420a..ef92e71 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -556,11 +556,11 @@ static struct iommu_table *cell_get_iommu_table(struct device *dev)
 	 * node's iommu. We -might- do something smarter later though it may
 	 * never be necessary
 	 */
-	iommu = cell_iommu_for_node(archdata->numa_node);
+	iommu = cell_iommu_for_node(dev_to_node(dev));
 	if (iommu == NULL || list_empty(&iommu->windows)) {
 		printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
 		       archdata->of_node ? archdata->of_node->full_name : "?",
-		       archdata->numa_node);
+		       dev_to_node(dev));
 		return NULL;
 	}
 	window = list_entry(iommu->windows.next, struct iommu_window, list);
@@ -577,7 +577,7 @@ static void *dma_fixed_alloc_coherent(struct device *dev, size_t size,
 		return iommu_alloc_coherent(dev, cell_get_iommu_table(dev),
 					    size, dma_handle,
 					    device_to_mask(dev), flag,
-					    dev->archdata.numa_node);
+					    dev_to_node(dev));
 	else
 		return dma_direct_ops.alloc_coherent(dev, size, dma_handle,
 						     flag);
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c
index 280ee88..a789bf5 100644
--- a/arch/powerpc/platforms/ps3/system-bus.c
+++ b/arch/powerpc/platforms/ps3/system-bus.c
@@ -762,7 +762,7 @@ int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)
 	};
 
 	dev->core.archdata.of_node = NULL;
-	dev->core.archdata.numa_node = 0;
+	set_dev_node(&dev->core, 0);
 
 	pr_debug("%s:%d add %s\n", __func__, __LINE__, dev->core.bus_id);
 
-- 
1.5.5.1

  reply	other threads:[~2008-09-08 19:10 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08 19:09 [PATCH 0/4] POWERPC: 32/64-bit DMA code merge and cleanup Becky Bruce
2008-09-08 19:09 ` [PATCH 1/4] POWERPC: Rename dma_64.c to dma.c Becky Bruce
2008-09-08 19:09   ` [PATCH 2/4] POWERPC: Move iommu dma ops from dma.c to dma-iommu.c Becky Bruce
2008-09-08 19:09     ` Becky Bruce [this message]
2008-09-08 19:09       ` [PATCH 4/4] POWERPC: Merge 32 and 64-bit dma code Becky Bruce
2008-09-08 22:03         ` Christoph Hellwig
2008-09-09 10:54           ` Benjamin Herrenschmidt
2008-09-09 14:39           ` Becky Bruce
2008-09-09 20:45             ` Christoph Hellwig
2008-09-09 22:10               ` Benjamin Herrenschmidt
2008-09-09 22:13                 ` Christoph Hellwig
2008-09-09 22:17                   ` Becky Bruce
2008-09-12 20:34         ` [PATCH V2 " Becky Bruce
2008-10-13 14:49           ` Josh Boyer
2008-10-13 15:41             ` Josh Boyer
2008-10-13 18:06               ` Kumar Gala
2008-10-13 18:21                 ` Josh Boyer
2008-10-13 18:22                   ` Kumar Gala
2008-10-13 23:30                     ` Benjamin Herrenschmidt
2008-10-14  1:52                       ` Kumar Gala
2008-10-14 10:24                         ` Josh Boyer
2008-10-14 12:05                           ` Benjamin Herrenschmidt
2008-10-14 15:45                             ` Becky Bruce
2008-10-13 23:30                   ` Benjamin Herrenschmidt
2008-09-08 21:57     ` [PATCH 2/4] POWERPC: Move iommu dma ops from dma.c to dma-iommu.c Christoph Hellwig
2008-09-12 15:32       ` Becky Bruce
2008-09-08 19:18   ` [PATCH 1/4] POWERPC: Rename dma_64.c to dma.c Scott Wood
2008-09-08 21:27     ` git apply vs. renamed files index mismatch (was: Re: [PATCH 1/4] POWERPC: Rename dma_64.c to dma.c) Anton Vorontsov
2008-09-08 21:38       ` git apply vs. renamed files index mismatch Scott Wood
2008-09-08 21:54         ` Anton Vorontsov
2008-09-09  0:55           ` Junio C Hamano
2008-09-09  9:06           ` Geert Uytterhoeven
2008-09-08 21:58       ` git apply vs. renamed files index mismatch (was: Re: [PATCH 1/4] POWERPC: Rename dma_64.c to dma.c) Christoph Hellwig
2008-09-09  0:53       ` git apply vs. renamed files index mismatch Junio C Hamano
2008-09-09 10:06         ` Anton Vorontsov
2008-09-09 14:45           ` Junio C Hamano
2008-09-09 15:14             ` Anton Vorontsov
2008-09-10  3:31               ` Junio C Hamano
2008-09-08 21:56 ` [PATCH 0/4] POWERPC: 32/64-bit DMA code merge and cleanup Christoph Hellwig

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=1220900995-11928-4-git-send-email-becky.bruce@freescale.com \
    --to=becky.bruce@freescale.com \
    --cc=linuxppc-dev@ozlabs.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).