mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: "Clément Léger" <clement.leger@bootlin.com>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Ludovic Desroches" <ludovic.desroches@microchip.com>
Cc: <linux-clk@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] clk: at91: check pmc node status before registering syscore ops
Date: Mon, 13 Sep 2021 12:06:38 +0200	[thread overview]
Message-ID: <531a3155-42a8-d31b-a611-80c1c56a93e3@microchip.com> (raw)
In-Reply-To: <20210913082633.110168-1-clement.leger@bootlin.com>

On 13/09/2021 at 10:26, Clément Léger wrote:
> Currently, at91 pmc driver always register the syscore_ops whatever
> the status of the pmc node that has been found. When set as secure
> and disabled, the pmc should not be accessed or this will generate
> abort exceptions.
> To avoid this, add a check on node availability before registering
> the syscore operations.
> 
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>

Yes, indeed,
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>

Thanks, best regards,
   Nicolas

> ---
>   drivers/clk/at91/pmc.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/clk/at91/pmc.c b/drivers/clk/at91/pmc.c
> index 20ee9dccee78..b40035b011d0 100644
> --- a/drivers/clk/at91/pmc.c
> +++ b/drivers/clk/at91/pmc.c
> @@ -267,6 +267,11 @@ static int __init pmc_register_ops(void)
>          if (!np)
>                  return -ENODEV;
> 
> +       if (!of_device_is_available(np)) {
> +               of_node_put(np);
> +               return -ENODEV;
> +       }
> +
>          pmcreg = device_node_to_regmap(np);
>          of_node_put(np);
>          if (IS_ERR(pmcreg))
> --
> 2.33.0
> 


-- 
Nicolas Ferre

  reply	other threads:[~2021-09-13 10:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  8:26 Clément Léger
2021-09-13 10:06 ` Nicolas Ferre [this message]
2021-09-13 13:38 ` Claudiu.Beznea
2021-09-14 22:03 ` Stephen Boyd
2021-09-15  6:15   ` Clément Léger
2021-10-08  3:48 ` Stephen Boyd

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=531a3155-42a8-d31b-a611-80c1c56a93e3@microchip.com \
    --to=nicolas.ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=clement.leger@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@microchip.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /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

all inboxes | Powered by JetHome®