linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
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 7/8] Split out the ioid fetching/checking logic
Date: Tue, 05 Feb 2008 11:27:15 +1100	[thread overview]
Message-ID: <1202171235.7079.42.camel@pasglop> (raw)
In-Reply-To: <aa11f5302486ba8b922828b78af1f124b38c9671.1201616038.git.michael@ellerman.id.au>


On Wed, 2008-01-30 at 01:14 +1100, Michael Ellerman wrote:
> Split out the ioid fetching and checking logic so we can use it elsewhere
> in a subsequent patch.
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> ---
>  arch/powerpc/platforms/cell/iommu.c |   23 +++++++++++++++++------
>  1 files changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
> index 7779dbf..3baade1 100644
> --- a/arch/powerpc/platforms/cell/iommu.c
> +++ b/arch/powerpc/platforms/cell/iommu.c
> @@ -443,25 +443,36 @@ static struct iommu_window *find_window(struct cbe_iommu *iommu,
>  }
>  #endif
>  
> +static inline u32 cell_iommu_get_ioid(struct device_node *np)
> +{
> +	const u32 *ioid;
> +
> +	ioid = of_get_property(np, "ioid", NULL);
> +	if (ioid == NULL) {
> +		printk(KERN_WARNING "iommu: missing ioid for %s using 0\n",
> +		       np->full_name);
> +		return 0;
> +	}
> +
> +	return *ioid;
> +}
> +
>  static struct iommu_window * __init
>  cell_iommu_setup_window(struct cbe_iommu *iommu, struct device_node *np,
>  			unsigned long offset, unsigned long size,
>  			unsigned long pte_offset)
>  {
>  	struct iommu_window *window;
> -	const unsigned int *ioid;
> +	u32 ioid;
>  
> -	ioid = of_get_property(np, "ioid", NULL);
> -	if (ioid == NULL)
> -		printk(KERN_WARNING "iommu: missing ioid for %s using 0\n",
> -		       np->full_name);
> +	ioid = cell_iommu_get_ioid(np);
>  
>  	window = kmalloc_node(sizeof(*window), GFP_KERNEL, iommu->nid);
>  	BUG_ON(window == NULL);
>  
>  	window->offset = offset;
>  	window->size = size;
> -	window->ioid = ioid ? *ioid : 0;
> +	window->ioid = ioid;
>  	window->iommu = iommu;
>  	window->pte_offset = pte_offset;
>  

  reply	other threads:[~2008-02-05  0:27 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 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 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 7/8] Split out the ioid fetching/checking logic Michael Ellerman
2008-02-05  0:27   ` Benjamin Herrenschmidt [this message]
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=1202171235.7079.42.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).