linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: <p.zabel@pengutronix.de>, <Steen.Hegelund@microchip.com>,
	<daniel.machon@microchip.com>, <UNGLinuxDriver@microchip.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] reset: mchp: sparx5: Fix for lan966x
Date: Wed, 26 Feb 2025 11:14:06 +0100	[thread overview]
Message-ID: <20250226111406.2751ebce@bootlin.com> (raw)
In-Reply-To: <20250225105329.3037853-1-horatiu.vultur@microchip.com>

Hi Horatiu,

On Tue, 25 Feb 2025 11:53:29 +0100
Horatiu Vultur <horatiu.vultur@microchip.com> 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
> region also for other devices.
> 
> Fixes: 0426a920d6269c ("reset: mchp: sparx5: Map cpu-syscon locally in case of LAN966x")
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
> v1->v2:
> - make sure to use iounmap when driver is removed
> ---
>  drivers/reset/reset-microchip-sparx5.c | 40 +++++++++++++++++++-------
>  1 file changed, 29 insertions(+), 11 deletions(-)
> 

...

>  static struct regmap *mchp_lan966x_syscon_to_regmap(struct device *dev,
> -						    struct device_node *syscon_np)
> +						    struct device_node *syscon_np,
> +						    struct mchp_reset_context *ctx)
>  {
>  	struct regmap_config regmap_config = mchp_lan966x_syscon_regmap_config;
> -	resource_size_t size;
> -	void __iomem *base;
> +	struct resource res;
>  
> -	base = devm_of_iomap(dev, syscon_np, 0, &size);
> -	if (IS_ERR(base))
> -		return ERR_CAST(base);
> +	if (of_address_to_resource(syscon_np, 0, &res))
> +		return ERR_PTR(-ENOMEM);

Why not forwarding the error returned by of_address_to_resource() ?

Other than that:

Reviewed-by: Herve Codina <herve.codina@bootlin.com>

Also, I tested the patch successfully on my LAN966x PCI device.

Tested-by: Herve Codina <herve.codina@bootlin.com>

Best regards,
Hervé


  reply	other threads:[~2025-02-26 10:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 10:53 [PATCH v2] reset: mchp: sparx5: Fix for lan966x Horatiu Vultur
2025-02-26 10:14 ` Herve Codina [this message]
2025-02-26 10:27 ` Philipp Zabel
2025-02-26 14:32   ` Horatiu Vultur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250226111406.2751ebce@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=Steen.Hegelund@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=daniel.machon@microchip.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).