[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PAXPR04MB8459E92CDCE9AE6EE7BDA95188072@PAXPR04MB8459.eurprd04.prod.outlook.com>
Date: Fri, 20 Dec 2024 00:11:05 +0000
From: Peng Fan <peng.fan@....com>
To: Frank Li <frank.li@....com>, "Peng Fan (OSS)" <peng.fan@....nxp.com>
CC: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>, Rob Herring
<robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>, Sascha Hauer
<s.hauer@...gutronix.de>, Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, "devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 2/2] nvmem: imx-ocotp-ele: Support accessing controller
for i.MX9
> Subject: Re: [PATCH v3 2/2] nvmem: imx-ocotp-ele: Support accessing
> controller for i.MX9
>
> On Thu, Dec 19, 2024 at 10:25:18PM +0800, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@....com>
> >
> > i.MX9 OCOTP supports a specific peripheral or function being fused
> > which means disabled, so
> > - Introduce ocotp_access_gates to be container of efuse gate info
> > - Iterate each node under '/soc' to check accessing permission. If
> > not
>
> Nit: Iterate all nodes to ....
>
> > allowed to be accessed, detach the node
> >
> > Signed-off-by: Peng Fan <peng.fan@....com>
> > ---
> > drivers/nvmem/imx-ocotp-ele.c | 183
> > +++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 182 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/nvmem/imx-ocotp-ele.c
> > b/drivers/nvmem/imx-ocotp-ele.c index
> >
> ca6dd71d8a2e29888c6e556aaea116c1a967cb5f..173863b1fd7de1505
> 76b78f03c25
> > 6a151b174389 100644
> > --- a/drivers/nvmem/imx-ocotp-ele.c
> > +++ b/drivers/nvmem/imx-ocotp-ele.c
> > @@ -5,6 +5,8 @@
> > * Copyright 2023 NXP
> > */
> >
> [...]
> > +
> > + for_each_available_child_of_node_scoped(parent, child) {
> > + struct of_phandle_iterator it;
> > + int err;
> > + u32 id;
> > +
> > + of_for_each_phandle(&it, err, child, "access-
> controllers",
> > + "#access-controller-cells", 0) {
> > + struct of_phandle_args provider_args;
> > + struct device_node *provider = it.node;
> > +
> > + if (err) {
> > + dev_err(dev, "Unable to get access-
> controllers property for node %s\n, err: %d",
> > + child->full_name, err);
> > + of_node_put(provider);
> > + return err;
> > + }
> > +
> > + /* Only support one cell */
> > + if (of_phandle_iterator_args(&it,
> provider_args.args, 1) != 1) {
> > + dev_err(dev, "wrong args count\n");
>
> you call of_node_put(provider) in above err branch.
> why not call it here?
Good catch. I will fix in v4.
Thanks,
Peng.
>
> Frank
> > + return -EINVAL;
> > + }
> > +
> > + id = provider_args.args[0];
> > +
> > + dev_dbg(dev, "Checking node: %s gate: %d\n",
> child->full_name,
> > +id);
> > +
> > + if (imx_ele_ocotp_check_access(pdev, id)) {
> > + of_detach_node(child);
> > + dev_err(dev, "%s: Not granted,
> device driver will not be probed\n",
> > + child->full_name);
> > + }
> > + }
> > +
> > + imx_ele_ocotp_grant_access(pdev, child);
> > + }
> > +
> > + return 0;
> > +}
> > +
>
> [...]
>
> >
> > --
> > 2.37.1
> >
Powered by blists - more mailing lists