linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Claudiu.Beznea@microchip.com>
To: <clement.leger@bootlin.com>, <mturquette@baylibre.com>,
	<sboyd@kernel.org>, <Nicolas.Ferre@microchip.com>,
	<alexandre.belloni@bootlin.com>,
	<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 13:38:50 +0000	[thread overview]
Message-ID: <eab2960b-a7b2-ac85-3b11-d94902eba035@microchip.com> (raw)
In-Reply-To: <20210913082633.110168-1-clement.leger@bootlin.com>

On 13.09.2021 11:26, Clément Léger wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> 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>

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>

> ---
>  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
> 


  parent reply	other threads:[~2021-09-13 13:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13  8:26 [PATCH] clk: at91: check pmc node status before registering syscore ops Clément Léger
2021-09-13 10:06 ` Nicolas Ferre
2021-09-13 13:38 ` Claudiu.Beznea [this message]
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=eab2960b-a7b2-ac85-3b11-d94902eba035@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=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=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;
as well as URLs for NNTP newsgroup(s).