Messages in this thread |  | | From | Anson Huang <> | Subject | RE: [PATCH RESEND 1/2] soc: imx: Add SCU SoC info driver support | Date | Tue, 14 May 2019 08:45:55 +0000 |
| |
> -----Original Message----- > From: Daniel Baluta [mailto:daniel.baluta@gmail.com] > Sent: Tuesday, May 14, 2019 4:39 PM > To: Anson Huang <anson.huang@nxp.com> > Cc: catalin.marinas@arm.com; will.deacon@arm.com; > shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de; > festevam@gmail.com; maxime.ripard@bootlin.com; agross@kernel.org; > olof@lixom.net; horms+renesas@verge.net.au; > jagan@amarulasolutions.com; bjorn.andersson@linaro.org; Leonard Crestez > <leonard.crestez@nxp.com>; marc.w.gonzalez@free.fr; > dinguyen@kernel.org; enric.balletbo@collabora.com; Aisheng Dong > <aisheng.dong@nxp.com>; robh@kernel.org; Abel Vesa > <abel.vesa@nxp.com>; l.stach@pengutronix.de; linux-arm- > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; dl-linux-imx > <linux-imx@nxp.com>; Daniel Baluta <daniel.baluta@nxp.com> > Subject: Re: [PATCH RESEND 1/2] soc: imx: Add SCU SoC info driver support > > On Tue, May 14, 2019 at 2:34 AM Anson Huang <anson.huang@nxp.com> > wrote: > > > > Hi, Daniel > > > > > -----Original Message----- > > > From: Daniel Baluta [mailto:daniel.baluta@gmail.com] > > > Sent: Monday, May 13, 2019 10:30 PM > > > To: Anson Huang <anson.huang@nxp.com> > > > Cc: catalin.marinas@arm.com; will.deacon@arm.com; > > > shawnguo@kernel.org; s.hauer@pengutronix.de; > kernel@pengutronix.de; > > > festevam@gmail.com; maxime.ripard@bootlin.com; agross@kernel.org; > > > olof@lixom.net; horms+renesas@verge.net.au; > > > jagan@amarulasolutions.com; bjorn.andersson@linaro.org; Leonard > > > Crestez <leonard.crestez@nxp.com>; marc.w.gonzalez@free.fr; > > > dinguyen@kernel.org; enric.balletbo@collabora.com; Aisheng Dong > > > <aisheng.dong@nxp.com>; robh@kernel.org; Abel Vesa > > > <abel.vesa@nxp.com>; l.stach@pengutronix.de; linux-arm- > > > kernel@lists.infradead.org; linux-kernel@vger.kernel.org; > > > dl-linux-imx <linux-imx@nxp.com>; Daniel Baluta > > > <daniel.baluta@nxp.com> > > > Subject: Re: [PATCH RESEND 1/2] soc: imx: Add SCU SoC info driver > > > support > > > > > > <snip> > > > > > > > + > > > > +static u32 imx8qxp_soc_revision(void) { > > > > + struct imx_sc_msg_misc_get_soc_id msg; > > > > + struct imx_sc_rpc_msg *hdr = &msg.hdr; > > > > + u32 rev = 0; > > > > + int ret; > > > > + > > > > + hdr->ver = IMX_SC_RPC_VERSION; > > > > + hdr->svc = IMX_SC_RPC_SVC_MISC; > > > > + hdr->func = IMX_SC_MISC_FUNC_GET_CONTROL; > > > > + hdr->size = 3; > > > > + > > > > + msg.data.send.control = IMX_SC_C_ID; > > > > + msg.data.send.resource = IMX_SC_R_SYSTEM; > > > > + > > > > + ret = imx_scu_call_rpc(soc_ipc_handle, &msg, true); > > > > + if (ret) { > > > > + dev_err(&imx_scu_soc_pdev->dev, > > > > + "get soc info failed, ret %d\n", ret); > > > > + return rev; > > > > > > So you return 0 (rev = 0) here in case of error? This doesn't seem to be > right. > > > Maybe return ret? > > > > This is intentional, similar with current i.MX8MQ soc info driver, > > when getting revision failed, just return 0 as revision info and it will show > "unknown" in sysfs. > > Ok, I understand. Lets make this clear from the source code. > > ret = imx_scu_call_rpc(soc_ipc_handle, &msg, true); > + if (ret) { > + dev_err(&imx_scu_soc_pdev->dev, > + "get soc info failed, ret %d\n", ret); > /* returning 0 means getting revision failed */ > + return 0; > + }
OK, will add a comment in V2.
Anson.
|  |