[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVQgdZyn0YGYCWEwnhvkxKMGG_T0vDL5ir=vC-pvLOY6A@mail.gmail.com>
Date: Wed, 8 Mar 2017 14:58:51 +0100
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>,
"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 v3 09/09] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code
Hi Magnus,
On Wed, Mar 8, 2017 at 12:02 PM, Magnus Damm <magnus.damm@...il.com> wrote:
> From: Magnus Damm <damm+renesas@...nsource.se>
>
> Tie in r8a7795 features and update the IOMMU_OF_DECLARE
> compat string to include the updated compat string.
>
> TODO:
> - Consider making use of iommu_fwspec_add_ids() for uTLB handling
> Needed to coexist with non-OF R-Car Gen2 somehow...
> - Break out stuff useful for R-Car Gen2 from this series
> Fix up the Gen2 IPMMU support code
> and/or
> Fold more stuff into the multi-arch series
> - Add support for sysfs and iommu_device_link()/unlink()
>
> Signed-off-by: Magnus Damm <damm+renesas@...nsource.se>
> --- 0018/drivers/iommu/ipmmu-vmsa.c
> +++ work/drivers/iommu/ipmmu-vmsa.c 2017-03-08 19:11:53.600607110 +0900
> @@ -1043,6 +1048,17 @@ static struct iommu_group *ipmmu_find_gr
> return group;
> }
>
> +static bool ipmmu_slave_whitelist(struct device *dev)
> +{
> + /* By default, do not allow use of IPMMU */
> + return false;
> +}
> +
> +static const struct soc_device_attribute soc_r8a7795[] = {
> + { .soc_id = "r8a7795", },
If/when the whitelist is/becomes device/revision specific, you probably want
to store a pointer to the *_slave_whitelist() function in the .data member?
> + { /* sentinel */ }
> +};
> +
> static int ipmmu_of_xlate_dma(struct device *dev,
> struct of_phandle_args *spec)
> {
> @@ -1053,6 +1069,18 @@ static int ipmmu_of_xlate_dma(struct dev
> if (!of_device_is_available(spec->np))
> return -ENODEV;
>
> + /* Failing in ->attach_device() results in a hang, so make
> + * sure the root device is installed before going there
> + */
> + if (!__ipmmu_find_root()) {
> + dev_info(dev, "Unable to locate IPMMU root device\n");
dev_err?
> + return -ENODEV;
> + }
> +
> + /* For R-Car Gen3 use a white list to opt-in slave devices */
> + if (soc_device_match(soc_r8a7795) && !ipmmu_slave_whitelist(dev))
> + return -ENODEV;
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