Re: [PATCH 2/2] iommu/ipmmu-vmsa: add an array of slave devices whitelist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Shimoda-san,

On Wed, Nov 28, 2018 at 7:10 AM Yoshihiro Shimoda
<yoshihiro.shimoda.uh@xxxxxxxxxxx> wrote:
> To avoid adding copy and pasted strcmp codes in the future,
> this patch adds an array "rcar_gen3_slave_whitelist" to check
> whether the device can work with the IPMMU or not.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@xxxxxxxxxxx>

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

One small comment below.

> --- a/drivers/iommu/ipmmu-vmsa.c
> +++ b/drivers/iommu/ipmmu-vmsa.c
> @@ -773,8 +773,13 @@ static int ipmmu_init_platform_device(struct device *dev,
>         { /* sentinel */ }
>  };
>
> +static const char * const rcar_gen3_slave_whitelist[] = {
> +};
> +
>  static bool ipmmu_slave_whitelist(struct device *dev)
>  {
> +       int i;

unsigned int

> +
>         /*
>          * For R-Car Gen3 use a white list to opt-in slave devices.
>          * For Other SoCs, this returns true anyway.
> @@ -786,7 +791,13 @@ static bool ipmmu_slave_whitelist(struct device *dev)
>         if (!soc_device_match(soc_rcar_gen3_whitelist))
>                 return false;
>
> -       /* By default, do not allow use of IPMMU */
> +       /* Check whether this slave device can work with the IPMMU */
> +       for (i = 0; i < ARRAY_SIZE(rcar_gen3_slave_whitelist); i++) {
> +               if (!strcmp(dev_name(dev), rcar_gen3_slave_whitelist[i]))
> +                       return true;
> +       }
> +
> +       /* Otherwise, do not allow use of IPMMU */
>         return false;
>  }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux