[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdU6WmnMFXvdBgFnc91NH2JVET=D9r8Wip07U7KrCwwoig@mail.gmail.com>
Date: Fri, 16 Jun 2017 09:16:56 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Magnus Damm <magnus.damm@...il.com>
Cc: Joerg Roedel <joro@...tes.org>,
Laurent Pinchart <laurent.pinchart+renesas@...asonboard.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Sricharan R <sricharan@...eaurora.org>,
Will Deacon <will.deacon@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Linux-Renesas <linux-renesas-soc@...r.kernel.org>,
iommu@...ts.linux-foundation.org,
Simon Horman <horms+renesas@...ge.net.au>,
Robin Murphy <robin.murphy@....com>,
Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH 02/04] iommu/ipmmu-vmsa: Consistent ->of_xlate() handling
Hi Magnus,
On Thu, Jun 15, 2017 at 12:29 PM, Magnus Damm <magnus.damm@...il.com> wrote:
> From: Magnus Damm <damm+renesas@...nsource.se>
>
> The 32-bit ARM code gets updated to make use of ->of_xlate() and the
> code is shared between 64-bit and 32-bit ARM. The of_device_is_available()
> check gets dropped since it is included in of_iommu_xlate().
>
> Suggested-by: Robin Murphy <robin.murphy@....com>
> Signed-off-by: Magnus Damm <damm+renesas@...nsource.se>
> ---
>
> drivers/iommu/ipmmu-vmsa.c | 51 ++++++++++++++------------------------------
> 1 file changed, 17 insertions(+), 34 deletions(-)
>
> --- 0009/drivers/iommu/ipmmu-vmsa.c
> +++ work/drivers/iommu/ipmmu-vmsa.c 2017-06-15 17:22:27.460607110 +0900
> @@ -680,6 +680,10 @@ static int ipmmu_init_platform_device(st
> int num_utlbs;
> int ret = -ENODEV;
>
> + /* Initialize once - xlate() will call multiple times */
> + if (to_priv(dev))
> + return 0;
I think this is more clear if you move this check to ...
> +
> /* Find the master corresponding to the device. */
>
> num_utlbs = of_count_phandle_with_args(dev->of_node, "iommus",
> @@ -734,6 +738,12 @@ error:
> return ret;
> }
>
> +static int ipmmu_of_xlate(struct device *dev,
> + struct of_phandle_args *spec)
> +{
... here
> + return ipmmu_init_platform_device(dev);
> +}
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists