[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e4bd8e47aeab761e409121ac9bc19408@kernel.org>
Date: Mon, 14 Apr 2025 17:27:10 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Ciprian Costea <ciprianmarian.costea@....nxp.com>, Marc Kleine-Budde <mkl@...gutronix.de>, Maxime Ripard <mripard@...nel.org>
Cc: Vincent Mailhol <mailhol.vincent@...adoo.fr>, linux-can@...r.kernel.org, linux-kernel@...r.kernel.org, NXP S32 Linux Team <s32@....com>, imx@...ts.linux.dev, Christophe Lizzi <clizzi@...hat.com>, Alberto Ruiz <aruizrui@...hat.com>, Enric Balletbo <eballetb@...hat.com>, Eric Chanudet <echanude@...hat.com>, Ghennadi Procopciuc <ghennadi.procopciuc@....com>, Michael Turquette <mturquette@...libre.com>, linux-clk@...r.kernel.org, kernel@...gutronix.de
Subject: Re: [PATCH] can: flexcan: enable PER clock before obtaining its rate
Quoting Marc Kleine-Budde (2025-04-14 02:55:34)
> On 14.04.2025 10:36:46, Ciprian Costea wrote:
> > From: Ciprian Marian Costea <ciprianmarian.costea@....nxp.com>
> >
> > The FlexCan driver assumes that the frequency of the 'per' clock can be
> > obtained even on disabled clocks, which is not always true.
> >
> > According to 'clk_get_rate' documentation, it is only valid once the clock
> > source has been enabled.
>
> In commit bde8870cd8c3 ("clk: Clarify clk_get_rate() expectations")
> Maxime Ripard changed the documentation of the of the function in clk.c
> to say it's allowed. However clk.h states "This is only valid once the
> clock source has been enabled.".
>
> I've added the common clock maintainers to Cc.
>
> Which documentation is correct? Is the clk.h correct for archs not using
> the common clock framework?
>
I don't know what arches not using the common clk framework (CCF) do so
I can't comment there. If you want something to work on an architecture
that doesn't use the CCF then follow the header file, but in all
practical cases _some_ rate will be returned from clk_get_rate() and
we're not going to BUG_ON() or crash the system in the CCF
implementation for this case. Enabling the clk is good hygiene though,
so is it really a problem to enable it here?
Powered by blists - more mailing lists