From: markn@au1•ibm.com
To: paulus@samba•org
Cc: Mark Nelson <markn@au1•ibm.com>, linuxppc-dev@ozlabs•org
Subject: [PATCH 4/6] [POWERPC] Make cell_dma_dev_setup_iommu() return the iommu table
Date: Thu, 01 May 2008 14:29:53 +1000 [thread overview]
Message-ID: <20080501043737.435450599@au1.ibm.com> (raw)
In-Reply-To: 20080501042949.237603158@au1.ibm.com
Make cell_dma_dev_setup_iommu() return a pointer to the struct iommu_table
(or NULL if no table can be found) rather than putting this pointer into
dev->archdata.dma_data (let the caller do that), and rename this function
to cell_get_iommu_table() to reflect this change.
This will allow us to get the iommu table for a device that doesn't have
the table in the archdata.
Signed-off-by: Mark Nelson <markn@au1•ibm.com>
---
arch/powerpc/platforms/cell/iommu.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: upstream/arch/powerpc/platforms/cell/iommu.c
===================================================================
--- upstream.orig/arch/powerpc/platforms/cell/iommu.c
+++ upstream/arch/powerpc/platforms/cell/iommu.c
@@ -541,7 +541,7 @@ static unsigned long cell_dma_direct_off
static unsigned long dma_iommu_fixed_base;
struct dma_mapping_ops dma_iommu_fixed_ops;
-static void cell_dma_dev_setup_iommu(struct device *dev)
+static struct iommu_table *cell_get_iommu_table(struct device *dev)
{
struct iommu_window *window;
struct cbe_iommu *iommu;
@@ -556,11 +556,11 @@ static void cell_dma_dev_setup_iommu(str
printk(KERN_ERR "iommu: missing iommu for %s (node %d)\n",
archdata->of_node ? archdata->of_node->full_name : "?",
archdata->numa_node);
- return;
+ return NULL;
}
window = list_entry(iommu->windows.next, struct iommu_window, list);
- archdata->dma_data = &window->table;
+ return &window->table;
}
static void cell_dma_dev_setup_fixed(struct device *dev);
@@ -573,7 +573,7 @@ static void cell_dma_dev_setup(struct de
if (get_dma_ops(dev) == &dma_iommu_fixed_ops)
cell_dma_dev_setup_fixed(dev);
else if (get_pci_dma_ops() == &dma_iommu_ops)
- cell_dma_dev_setup_iommu(dev);
+ archdata->dma_data = cell_get_iommu_table(dev);
else if (get_pci_dma_ops() == &dma_direct_ops)
archdata->dma_data = (void *)cell_dma_direct_offset;
else
--
next prev parent reply other threads:[~2008-05-01 4:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-01 4:29 [PATCH 0/6] [POWERPC] Implement dma_*map*_attrs() and DMA_ATTR_WEAK_ORDERING, use on Cell markn
2008-05-01 4:29 ` [PATCH 1/6] [POWERPC] Add struct iommu_table argument to iommu_map_sg() markn
2008-05-01 4:29 ` [PATCH 2/6] [POWERPC] dma: implement new dma_*map*_attrs() interfaces markn
2008-05-01 4:29 ` [PATCH 3/6] [POWERPC] dma: use the struct dma_attrs in iommu code markn
2008-05-01 4:29 ` markn [this message]
2008-05-01 4:29 ` [PATCH 5/6] [POWERPC] Move device_to_mask() to dma-mapping.h markn
2008-05-01 9:04 ` Segher Boessenkool
2008-05-01 23:47 ` Mark Nelson
2008-05-02 0:32 ` Segher Boessenkool
2008-05-02 1:38 ` Mark Nelson
2008-05-01 4:29 ` [PATCH 6/6] [POWERPC] Add DMA_ATTR_WEAK_ORDERING dma attribute and use in Cell IOMMU code markn
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=20080501043737.435450599@au1.ibm.com \
--to=markn@au1$(echo .)ibm.com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=paulus@samba$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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