From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
Subject: Re: [PATCH 5/8] Split out the IOMMU logic from cell_dma_dev_setup()
Date: Tue, 05 Feb 2008 11:26:33 +1100 [thread overview]
Message-ID: <1202171193.7079.40.camel@pasglop> (raw)
In-Reply-To: <b328031747602deeac6827c054b7986734a9c322.1201616038.git.michael@ellerman.id.au>
On Wed, 2008-01-30 at 01:14 +1100, Michael Ellerman wrote:
> Split the IOMMU logic out from cell_dma_dev_setup() into a separate
> function. If we're not using dma_direct_ops or dma_iommu_ops we don't
> know what the hell's going on, so BUG.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> arch/powerpc/platforms/cell/iommu.c | 19 +++++++++++++------
> 1 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
> index a86e5bb..e9769fc 100644
> --- a/arch/powerpc/platforms/cell/iommu.c
> +++ b/arch/powerpc/platforms/cell/iommu.c
> @@ -507,17 +507,12 @@ static struct cbe_iommu *cell_iommu_for_node(int nid)
>
> static unsigned long cell_dma_direct_offset;
>
> -static void cell_dma_dev_setup(struct device *dev)
> +static void cell_dma_dev_setup_iommu(struct device *dev)
> {
> struct iommu_window *window;
> struct cbe_iommu *iommu;
> struct dev_archdata *archdata = &dev->archdata;
>
> - if (get_pci_dma_ops() == &dma_direct_ops) {
> - archdata->dma_data = (void *)cell_dma_direct_offset;
> - return;
> - }
> -
> /* Current implementation uses the first window available in that
> * node's iommu. We -might- do something smarter later though it may
> * never be necessary
> @@ -534,6 +529,18 @@ static void cell_dma_dev_setup(struct device *dev)
> archdata->dma_data = &window->table;
> }
>
> +static void cell_dma_dev_setup(struct device *dev)
> +{
> + struct dev_archdata *archdata = &dev->archdata;
> +
> + if (get_pci_dma_ops() == &dma_iommu_ops)
> + cell_dma_dev_setup_iommu(dev);
> + else if (get_pci_dma_ops() == &dma_direct_ops)
> + archdata->dma_data = (void *)cell_dma_direct_offset;
> + else
> + BUG();
> +}
> +
> static void cell_pci_dma_dev_setup(struct pci_dev *dev)
> {
> cell_dma_dev_setup(&dev->dev);
next prev parent reply other threads:[~2008-02-05 0:26 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-29 14:13 [PATCH 1/8] Add set_dma_ops() to match get_dma_ops() Michael Ellerman
2008-01-29 14:13 ` [PATCH 2/8] Allocate the hash table under 1G on cell Michael Ellerman
2008-01-29 14:13 ` [PATCH 3/8] Split out the logic that allocates struct iommus Michael Ellerman
2008-02-05 0:23 ` Benjamin Herrenschmidt
2008-01-29 14:14 ` [PATCH 4/8] Split cell_iommu_setup_hardware() into two parts Michael Ellerman
2008-01-29 14:14 ` [PATCH 6/8] Add support to cell_iommu_setup_page_tables() for multiple windows Michael Ellerman
2008-02-05 0:26 ` Benjamin Herrenschmidt
2008-01-29 14:14 ` [PATCH 5/8] Split out the IOMMU logic from cell_dma_dev_setup() Michael Ellerman
2008-02-05 0:26 ` Benjamin Herrenschmidt [this message]
2008-01-29 14:14 ` [PATCH 7/8] Split out the ioid fetching/checking logic Michael Ellerman
2008-02-05 0:27 ` Benjamin Herrenschmidt
2008-01-29 14:14 ` [PATCH 8/8] Cell IOMMU fixed mapping support Michael Ellerman
2008-01-29 15:15 ` Olof Johansson
2008-01-29 15:13 ` Michael Ellerman
2008-01-29 15:50 ` Olof Johansson
2008-01-30 0:54 ` Arnd Bergmann
2008-01-30 0:58 ` Olof Johansson
2008-01-29 21:18 ` Benjamin Herrenschmidt
2008-01-29 21:36 ` Olof Johansson
2008-01-29 23:56 ` Michael Ellerman
2008-01-30 0:03 ` Michael Ellerman
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=1202171193.7079.40.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=cbe-oss-dev@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
/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).