From: Stephen Boyd <sboyd@kernel.org>
To: Ciprian Costea <ciprianmarian.costea@oss.nxp.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
Maxime Ripard <mripard@kernel.org>
Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>,
linux-can@vger.kernel.org, linux-kernel@vger.kernel.org,
NXP S32 Linux Team <s32@nxp.com>,
imx@lists.linux.dev, Christophe Lizzi <clizzi@redhat.com>,
Alberto Ruiz <aruizrui@redhat.com>,
Enric Balletbo <eballetb@redhat.com>,
Eric Chanudet <echanude@redhat.com>,
Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>,
Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH] can: flexcan: enable PER clock before obtaining its rate
Date: Mon, 14 Apr 2025 17:27:10 -0700 [thread overview]
Message-ID: <e4bd8e47aeab761e409121ac9bc19408@kernel.org> (raw)
In-Reply-To: <20250414-camouflaged-silver-dodo-d0c000-mkl@pengutronix.de>
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@oss.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?
next prev parent reply other threads:[~2025-04-15 0:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-14 7:36 [PATCH] can: flexcan: enable PER clock before obtaining its rate Ciprian Costea
2025-04-14 9:55 ` Marc Kleine-Budde
2025-04-15 0:27 ` Stephen Boyd [this message]
2025-04-15 9:03 ` Marc Kleine-Budde
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=e4bd8e47aeab761e409121ac9bc19408@kernel.org \
--to=sboyd@kernel.org \
--cc=aruizrui@redhat.com \
--cc=ciprianmarian.costea@oss.nxp.com \
--cc=clizzi@redhat.com \
--cc=eballetb@redhat.com \
--cc=echanude@redhat.com \
--cc=ghennadi.procopciuc@nxp.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol.vincent@wanadoo.fr \
--cc=mkl@pengutronix.de \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=s32@nxp.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.