mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Brian Norris <briannorris@chromium.org>
Cc: "Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Brian Masney" <bmasney+clk@redhat.com>,
	"Jerome Brunet" <jbrunet+clk@baylibre.com>,
	"Thomas Gleixner" <tglx@kernel.org>,
	"Ulf Hansson" <ulfh@kernel.org>,
	"Peter Griffin" <peter.griffin@linaro.org>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"André Draszik" <andre.draszik@linaro.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, "Radu Rendec" <radu@rendec.net>,
	"Jakub Głowacki" <jglow@google.com>,
	linux-clk@vger.kernel.org,
	"Douglas Anderson" <dianders@chromium.org>,
	devicetree@vger.kernel.org, linux-pm@vger.kernel.org,
	"Mariano Marciello" <mmarciello@google.com>,
	google-soc@lists.linux.dev
Subject: Re: [PATCH v2 5/9] reset: google: Add CPM reset driver
Date: Thu, 26 Nov 2026 11:00:27 +0100	[thread overview]
Message-ID: <66d5a395e692387ff39669b60f803cde8f97affe.camel@pengutronix.de> (raw)
In-Reply-To: <awcz1aP6xcL6G2t4@google.com>

On Mi, 2026-11-25 at 11:15 -0800, Brian Norris wrote:
> On Wed, Nov 25, 2026 at 09:48:04AM +0100, Philipp Zabel wrote:
> > On Di, 2026-11-24 at 16:03 -0800, Brian Norris wrote:
> > > Google Tensor SoCs (used on Pixel phones) manage many resources
> > > (including resets) using a Central Power Manager (CPM) co-processor. We
> > > communicate with CPM using mailboxes, abstracted in the
> > > devm_cpm_get_handle(), etc., API.
> > > 
> > > For posterity, I list a summary of changes made relative to the
> > > downstream Pixel driver:
> > > 
> > > * Switch to auxiliary bus, as a child of a CPM device
> > > 
> > > * Use devm more heavily
> > > 
> > > * Avoid representing each reset as its own Device Tree node.
> > > 
> > > Signed-off-by: Brian Norris <briannorris@chromium.org>
> > > ---
> > > 
> > > Changes in v2:
> > >  * Rename symbols from goog_cpm_rst_* to cpm_reset_*
> > >  * Moved shared protocol details to CPM driver
> > >  * Remove custom reset debugfs interface and .remove callback.
> > >  * Remove per-SoC table; we only need naive translation of firmware IDs
> > > 
> > >  drivers/reset/Kconfig            |   1 +
> > >  drivers/reset/Makefile           |   1 +
> > >  drivers/reset/google/Kconfig     |  11 +++
> > >  drivers/reset/google/Makefile    |   2 +
> > >  drivers/reset/google/reset-cpm.c | 154 +++++++++++++++++++++++++++++++
> > >  5 files changed, 169 insertions(+)
> > >  create mode 100644 drivers/reset/google/Kconfig
> > >  create mode 100644 drivers/reset/google/Makefile
> > >  create mode 100644 drivers/reset/google/reset-cpm.c
> > > 
[...]
> > > diff --git a/drivers/reset/google/reset-cpm.c b/drivers/reset/google/reset-cpm.c
> > > new file mode 100644
> > > index 000000000000..ef0863f25cac
> > > --- /dev/null
> > > +++ b/drivers/reset/google/reset-cpm.c
> > > @@ -0,0 +1,154 @@
[...]
> > > +	if (lpcm_id > CPM_RST_ID_MAX)
> > 
> > This looks a bit weird.
> > 
> > Maybe add a CPM_LPCM_ID_MAX, directly use U8_MAX here, or rename the
> > constant to not include RST_ID?
> 
> How about these (with the masks made 8-bit as they should be)?
> 
>   FIELD_MAX(CPM_RST_LPCM_ID_MASK))
>   FIELD_MAX(CPM_RST_ID_MASK))

Even better. I just got tripped up by the comparison between lpcm_id
and what looked like the limit for rst_id.

regards
Philipp

  reply	other threads:[~2026-11-26 10:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  0:03 [PATCH v2 0/9] google: Add support for Laguna CPM Brian Norris
2026-11-25  0:03 ` [PATCH v2 1/9] dt-bindings: power: google: Add Google Tensor CPM Brian Norris
2026-11-25  0:03 ` [PATCH v2 2/9] soc: google: Add CPM over MailBox Array driver Brian Norris
2026-11-25  0:03 ` [PATCH v2 3/9] pmdomain: google: Add CPM power-domain driver Brian Norris
2026-11-25  0:03 ` [PATCH v2 4/9] clk: google: Add CPM clock driver Brian Norris
2026-11-25  0:03 ` [PATCH v2 5/9] reset: google: Add CPM reset driver Brian Norris
2026-11-25  8:48   ` Philipp Zabel
2026-11-25 11:43     ` Uwe Kleine-König
2026-11-25 19:19       ` Brian Norris
2026-11-25 23:12         ` Uwe Kleine-König
2026-11-25 19:15     ` Brian Norris
2026-11-26 10:00       ` Philipp Zabel [this message]
2026-11-25  0:03 ` [PATCH v2 6/9] irqchip/google-cpm: Add CPM IRQ driver Brian Norris
2026-11-25  0:03 ` [PATCH v2 7/9] arm64: dts: google: Add Laguna CPM mailbox array Brian Norris
2026-11-25  0:03 ` [PATCH v2 8/9] arm64: dts: google: Add Laguna CPM node Brian Norris
2026-11-25  0:03 ` [PATCH v2 9/9] MAINTAINERS: Add entries for CPM drivers used on Tensor SoCs Brian Norris

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=66d5a395e692387ff39669b60f803cde8f97affe.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=andre.draszik@linaro.org \
    --cc=bmasney+clk@redhat.com \
    --cc=briannorris@chromium.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=google-soc@lists.linux.dev \
    --cc=jbrunet+clk@baylibre.com \
    --cc=jglow@google.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mmarciello@google.com \
    --cc=peter.griffin@linaro.org \
    --cc=radu@rendec.net \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tglx@kernel.org \
    --cc=tudor.ambarus@linaro.org \
    --cc=ulfh@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

all inboxes | Powered by JetHome®