From: Brian Masney <masneyb@kernel.org>
To: Drew Fustini <fustini@kernel.org>
Cc: Lee Jones <lee@kernel.org>,
Joel Stanley <jms@oss.tenstorrent.com>,
Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] clk: tenstorrent: Use prepare/unprepare ops for Atlantis PLL
Date: Sun, 29 Nov 2026 16:43:53 -0500 [thread overview]
Message-ID: <awycmXTyaNYNlVPJ@x1g10> (raw)
In-Reply-To: <awu9rfdD9BpYDGVX@thelio>
Hey Drew,
On Sat, Nov 28, 2026 at 09:52:45PM -0800, Drew Fustini wrote:
> On Fri, Nov 27, 2026 at 01:29:36PM +0000, Lee Jones wrote:
> > The Common Clock Framework invokes .enable callbacks in atomic context
> > with interrupts disabled and enable_lock held. In atlantis_clk_pll_ops,
> > atlantis_clk_pll_enable() is registered as the .enable callback yet
> > waits for PLL lock using regmap_read_poll_timeout() with a 500 us sleep
> > interval, triggering a sleep-in-atomic bug via usleep_range().
> >
> > Convert atlantis_clk_pll_ops to use .prepare, .unprepare, and
> > .is_prepared instead of .enable, .disable, and .is_enabled so that the
> > PLL lock wait executes under the sleeping prepare_lock rather than
> > atomic enable_lock.
> >
> > Fixes: 23c8ebc95284 ("clk: tenstorrent: Add Atlantis clock controller driver")
> > Closes: https://sashiko.dev/#/bug/linux-980395a6-f282-478a-bf18-b5695a725735
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Lee Jones <lee@kernel.org>
> > ---
> > v1 => v2:
> > - Switch from .enable/.disable/.is_enabled to .prepare/.unprepare/.is_prepared so PLL lock polling runs under the sleeping prepare_lock instead of enable_lock, per Brian Masney's review.
> > - Keep regmap_read_poll_timeout() rather than switching to the atomic variant.
> > - Drop Anirudh Srinivasan's v1 Reviewed-by tag due to the implementation change.
> > - Drop the other patches from v1 that were already applied or superseded.
>
> Reviewed-by: Drew Fustini <fustini@kernel.org>
>
> Brian - should I take this through tenstorrent-clk-for-next, or are you
> planning to apply it?
I'm fine either way. Let me know what you prefer.
Brian
WARNING: multiple messages have this Message-ID (diff)
From: Brian Masney <masneyb@kernel.org>
To: Drew Fustini <fustini@kernel.org>
Cc: Lee Jones <lee@kernel.org>,
Joel Stanley <jms@oss.tenstorrent.com>,
Anirudh Srinivasan <asrinivasan@oss.tenstorrent.com>,
Stephen Boyd <sboyd@kernel.org>,
Brian Masney <bmasney+clk@redhat.com>,
Jerome Brunet <jbrunet+clk@baylibre.com>,
linux-riscv@lists.infradead.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v2] clk: tenstorrent: Use prepare/unprepare ops for Atlantis PLL
Date: Sun, 29 Nov 2026 16:43:53 -0500 [thread overview]
Message-ID: <awycmXTyaNYNlVPJ@x1g10> (raw)
In-Reply-To: <awu9rfdD9BpYDGVX@thelio>
Hey Drew,
On Sat, Nov 28, 2026 at 09:52:45PM -0800, Drew Fustini wrote:
> On Fri, Nov 27, 2026 at 01:29:36PM +0000, Lee Jones wrote:
> > The Common Clock Framework invokes .enable callbacks in atomic context
> > with interrupts disabled and enable_lock held. In atlantis_clk_pll_ops,
> > atlantis_clk_pll_enable() is registered as the .enable callback yet
> > waits for PLL lock using regmap_read_poll_timeout() with a 500 us sleep
> > interval, triggering a sleep-in-atomic bug via usleep_range().
> >
> > Convert atlantis_clk_pll_ops to use .prepare, .unprepare, and
> > .is_prepared instead of .enable, .disable, and .is_enabled so that the
> > PLL lock wait executes under the sleeping prepare_lock rather than
> > atomic enable_lock.
> >
> > Fixes: 23c8ebc95284 ("clk: tenstorrent: Add Atlantis clock controller driver")
> > Closes: https://sashiko.dev/#/bug/linux-980395a6-f282-478a-bf18-b5695a725735
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Lee Jones <lee@kernel.org>
> > ---
> > v1 => v2:
> > - Switch from .enable/.disable/.is_enabled to .prepare/.unprepare/.is_prepared so PLL lock polling runs under the sleeping prepare_lock instead of enable_lock, per Brian Masney's review.
> > - Keep regmap_read_poll_timeout() rather than switching to the atomic variant.
> > - Drop Anirudh Srinivasan's v1 Reviewed-by tag due to the implementation change.
> > - Drop the other patches from v1 that were already applied or superseded.
>
> Reviewed-by: Drew Fustini <fustini@kernel.org>
>
> Brian - should I take this through tenstorrent-clk-for-next, or are you
> planning to apply it?
I'm fine either way. Let me know what you prefer.
Brian
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2026-11-29 21:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 13:29 [PATCH v2] clk: tenstorrent: Use prepare/unprepare ops for Atlantis PLL Lee Jones
2026-11-27 13:29 ` Lee Jones
2026-11-28 18:28 ` Anirudh Srinivasan
2026-11-28 18:28 ` Anirudh Srinivasan
2026-11-29 5:52 ` Drew Fustini
2026-11-29 5:52 ` Drew Fustini
2026-11-29 21:43 ` Brian Masney [this message]
2026-11-29 21:43 ` Brian Masney
2026-11-30 5:53 ` Drew Fustini
2026-11-30 5:53 ` Drew Fustini
2026-11-30 17:12 ` Brian Masney
2026-11-30 17:12 ` Brian Masney
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=awycmXTyaNYNlVPJ@x1g10 \
--to=masneyb@kernel.org \
--cc=asrinivasan@oss.tenstorrent.com \
--cc=bmasney+clk@redhat.com \
--cc=fustini@kernel.org \
--cc=jbrunet+clk@baylibre.com \
--cc=jms@oss.tenstorrent.com \
--cc=lee@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=sboyd@kernel.org \
--cc=stable@vger.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 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.