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 3/8] Split out the logic that allocates struct iommus
Date: Tue, 05 Feb 2008 11:23:51 +1100 [thread overview]
Message-ID: <1202171031.7079.36.camel@pasglop> (raw)
In-Reply-To: <7bef68137a3a6f5e75b0b54db4b8af8705344f42.1201616038.git.michael@ellerman.id.au>
On Wed, 2008-01-30 at 01:13 +1100, Michael Ellerman wrote:
> Split out the logic that allocates a struct iommu into a separate
> function. This can fail however the calling code has never cared - so
> just return if we can't allocate an iommu.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> arch/powerpc/platforms/cell/iommu.c | 20 ++++++++++++++++----
> 1 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
> index 9223559..4f1ca43 100644
> --- a/arch/powerpc/platforms/cell/iommu.c
> +++ b/arch/powerpc/platforms/cell/iommu.c
> @@ -565,10 +565,9 @@ static int __init cell_iommu_get_window(struct device_node *np,
> return 0;
> }
>
> -static void __init cell_iommu_init_one(struct device_node *np, unsigned long offset)
> +static struct cbe_iommu * __init cell_iommu_alloc(struct device_node *np)
> {
> struct cbe_iommu *iommu;
> - unsigned long base, size;
> int nid, i;
>
> /* Get node ID */
> @@ -576,7 +575,7 @@ static void __init cell_iommu_init_one(struct device_node *np, unsigned long off
> if (nid < 0) {
> printk(KERN_ERR "iommu: failed to get node for %s\n",
> np->full_name);
> - return;
> + return NULL;
> }
> pr_debug("iommu: setting up iommu for node %d (%s)\n",
> nid, np->full_name);
> @@ -592,7 +591,7 @@ static void __init cell_iommu_init_one(struct device_node *np, unsigned long off
> if (cbe_nr_iommus >= NR_IOMMUS) {
> printk(KERN_ERR "iommu: too many IOMMUs detected ! (%s)\n",
> np->full_name);
> - return;
> + return NULL;
> }
>
> /* Init base fields */
> @@ -603,6 +602,19 @@ static void __init cell_iommu_init_one(struct device_node *np, unsigned long off
> snprintf(iommu->name, sizeof(iommu->name), "iommu%d", i);
> INIT_LIST_HEAD(&iommu->windows);
>
> + return iommu;
> +}
> +
> +static void __init cell_iommu_init_one(struct device_node *np,
> + unsigned long offset)
> +{
> + struct cbe_iommu *iommu;
> + unsigned long base, size;
> +
> + iommu = cell_iommu_alloc(np);
> + if (!iommu)
> + return;
> +
> /* Obtain a window for it */
> cell_iommu_get_window(np, &base, &size);
>
next prev parent reply other threads:[~2008-02-05 0:23 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 3/8] Split out the logic that allocates struct iommus Michael Ellerman
2008-02-05 0:23 ` Benjamin Herrenschmidt [this message]
2008-01-29 14:13 ` [PATCH 2/8] Allocate the hash table under 1G on cell Michael Ellerman
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
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=1202171031.7079.36.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).