RE: [PATCH V2 1/2] soc: imx: Add SCU SoC info driver support

From: Anson Huang
Date: Wed May 15 2019 - 08:07:49 EST


Hi, Leonard

> -----Original Message-----
> From: Leonard Crestez
> Sent: Wednesday, May 15, 2019 6:05 PM
> To: Anson Huang <anson.huang@xxxxxxx>
> Cc: catalin.marinas@xxxxxxx; will.deacon@xxxxxxx;
> shawnguo@xxxxxxxxxx; s.hauer@xxxxxxxxxxxxxx; kernel@xxxxxxxxxxxxxx;
> festevam@xxxxxxxxx; agross@xxxxxxxxxx; maxime.ripard@xxxxxxxxxxx;
> olof@xxxxxxxxx; horms+renesas@xxxxxxxxxxxx;
> jagan@xxxxxxxxxxxxxxxxxxxx; bjorn.andersson@xxxxxxxxxx;
> marc.w.gonzalez@xxxxxxx; dinguyen@xxxxxxxxxx;
> enric.balletbo@xxxxxxxxxxxxx; l.stach@xxxxxxxxxxxxxx; Abel Vesa
> <abel.vesa@xxxxxxx>; robh@xxxxxxxxxx; linux-arm-
> kernel@xxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; dl-linux-imx
> <linux-imx@xxxxxxx>; Aisheng Dong <aisheng.dong@xxxxxxx>
> Subject: Re: [PATCH V2 1/2] soc: imx: Add SCU SoC info driver support
>
> On 15.05.2019 11:32, Anson Huang wrote:
> > Add i.MX SCU SoC info driver to support i.MX8QXP SoC, introduce driver
> > dependency into Kconfig as CONFIG_IMX_SCU must be selected to support
> > i.MX SCU SoC driver, also need to use platform driver model to make
> > sure IMX_SCU driver is probed before i.MX SCU SoC driver.
> >
> > With this patch, SoC info can be read from sysfs:
>
> > + id = of_match_node(imx_scu_soc_match, root);
> > + if (!id) {
> > + of_node_put(root);
> > + return -ENODEV;
> > + }
>
> Perhaps this check should be moved from imx_scu_soc_probe to
> imx_scu_soc_init? As far as I can tell this "probe" function will be attempted
> on all SOCs (even non-imx). Better to check if we're on a SCU-based soc early
> and avoid temporary allocations.

Make sense, I will move this check block into imx_scu_soc_init() function and
ONLY register platform driver when check passed.

>
> > +module_init(imx_scu_soc_init);
> > +module_exit(imx_scu_soc_exit);
>
> Please don't make this a module

OK, will fix it in V3.

Thanks,
Anson.

>
> --
> Regards,
> Leonard