[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251013073209.GA3585900@ragnatech.se>
Date: Mon, 13 Oct 2025 09:32:09 +0200
From: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
To: Wolfram Sang <wsa+renesas@...g-engineering.com>
Cc: Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-kernel@...r.kernel.org, linux-renesas-soc@...r.kernel.org
Subject: Re: [RFC] clocksource/drivers/sh_cmt: Always leave device running
after probe
Hi Wolfram,
On 2025-10-13 09:22:17 +0200, Wolfram Sang wrote:
> Hi Niklas,
>
> thanks for your work on these timers!
>
> > For non-PREEMPT_RT builds this is not really an issue, but for
> > PREEMPT_RT builds where normal spinlocks can sleep this might be an
> > issue. Be cautious and always leave the power and clock running after
> > probe.
>
> I am not a super-duper PM expert but this sounds pretty reasonable to
> me. Only minor comments:
>
> > ret = -ETIMEDOUT;
> > - goto err1;
> > + return ret;
>
> return -ETIMEDOUT;
Wops, indeed. Thanks for spotting it. Will wait for feedback on the
general idea and fix this in v2.
>
> > if (!(ch->flags & (FLAG_CLOCKEVENT | FLAG_CLOCKSOURCE))) {
> > - pm_runtime_get_sync(&ch->cmt->pdev->dev);
> > ret = sh_cmt_enable(ch);
> > }
>
> Curly braces can go.
>
> > if (f && !(ch->flags & (FLAG_CLOCKEVENT | FLAG_CLOCKSOURCE))) {
> > sh_cmt_disable(ch);
> > - pm_runtime_put(&ch->cmt->pdev->dev);
> > }
>
> ditto.
>
> And I don't if this is a seperate patch or not, but we could simplify
> probe a little by using 'clk_prepare_enable()'...
This is a good idea, I would prefer to it in a separate patch. I'm
always a bit scared touching this driver and making finding issues with
bisect easier is always a good idea :-)
>
> Happy hacking,
>
> Wolfram
>
--
Kind Regards,
Niklas Söderlund
Powered by blists - more mailing lists