lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250227085148.ulqc2n7xvc2fa745@DEN-DL-M31836.microchip.com>
Date: Thu, 27 Feb 2025 09:51:48 +0100
From: Horatiu Vultur <horatiu.vultur@...rochip.com>
To: Philipp Zabel <p.zabel@...gutronix.de>
CC: <Steen.Hegelund@...rochip.com>, <daniel.machon@...rochip.com>,
	<UNGLinuxDriver@...rochip.com>, <herve.codina@...tlin.com>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] reset: mchp: sparx5: Fix for lan966x

The 02/26/2025 17:32, Philipp Zabel wrote:

Hi,

> 
> On Mi, 2025-02-26 at 15:46 +0100, Horatiu Vultur wrote:
> > With the blamed commit it seems that lan966x doesn't seem to boot
> > anymore when the internal CPU is used.
> > The reason seems to be the usage of the devm_of_iomap, if we replace
> > this with of_iomap, this seems to fix the issue as we use the same
>             ^^^^^^^^
> The is not accurate anymore.

Good catch. I will update in the next version.

> 
> > region also for other devices.
> >
> > Fixes: 0426a920d6269c ("reset: mchp: sparx5: Map cpu-syscon locally in case of LAN966x")
> > Reviewed-by: Herve Codina <herve.codina@...tlin.com>
> > Tested-by: Herve Codina <herve.codina@...tlin.com>
> 
> Is this still correct?
> 
> > Signed-off-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
> > ---
> > v2->v3:
> > - forward error from of_address_to_resource
> > - use devm_ioremap instead of_iomap
> > v1->v2:
> > - make sure to use iounmap when driver is removed
> > ---
> >  drivers/reset/reset-microchip-sparx5.c | 16 +++++++++++-----
> >  1 file changed, 11 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/reset/reset-microchip-sparx5.c b/drivers/reset/reset-microchip-sparx5.c
> > index aa5464be7053b..176b3f46e9243 100644
> > --- a/drivers/reset/reset-microchip-sparx5.c
> > +++ b/drivers/reset/reset-microchip-sparx5.c
> > @@ -8,6 +8,7 @@
> >   */
> >  #include <linux/mfd/syscon.h>
> >  #include <linux/of.h>
> > +#include <linux/of_address.h>
> >  #include <linux/module.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/property.h>
> > @@ -72,14 +73,19 @@ static struct regmap *mchp_lan966x_syscon_to_regmap(struct device *dev,
> >                                                   struct device_node *syscon_np)
> >  {
> >       struct regmap_config regmap_config = mchp_lan966x_syscon_regmap_config;
> > -     resource_size_t size;
> > +     struct resource res;
> >       void __iomem *base;
> > +     int err;
> > +
> > +     err = of_address_to_resource(syscon_np, 0, &res);
> > +     if (err)
> > +             return ERR_PTR(err);
> >
> > -     base = devm_of_iomap(dev, syscon_np, 0, &size);
> > -     if (IS_ERR(base))
> > -             return ERR_CAST(base);
> 
> It would be nice to add a comment here that devm_of_iomap() can't be
> used because the resource is shared with other devices. Do you know
> which ones?

Yes, I will add a comment in the next version.
Looking at the device trees (lan966x.dtsi), it looks like it is shared
with the clock driver (clks).

> 
> Otherwise, this looks good to me.
> 
> 
> regards
> Philipp

-- 
/Horatiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ