Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Prathamesh Shete" <pshete@nvidia.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org,
	krzk+dt@kernel.org
Subject: Re: [PATCH 2/2] soc/tegra: pmc: Add Tegra238 support
Date: Thu, 14 May 2026 19:11:33 +0000	[thread overview]
Message-ID: <20260514191134.736C7C2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260514124856.108606-2-pshete@nvidia.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The `tegra238_pmc_regs` struct omits the initialization of `aowake_*` register offsets, causing them to default to 0. This will lead to register collisions and hardware state corruption during wakeup configuration.
--

commit 07ddf2c146f9b5cbae8ba71ab87489c0358d7d6c
Author: Prathamesh Shete <pshete@nvidia.com>

soc/tegra: pmc: Add Tegra238 support

This commit adds support for the PMC on Tegra238. The Tegra238 PMC is
largely similar to earlier chips but not completely compatible.

> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
> index 2ee6539d796a5..4724b98fb1b16 100644
> --- a/drivers/soc/tegra/pmc.c
> +++ b/drivers/soc/tegra/pmc.c
[ ... ]
> @@ -4595,6 +4595,156 @@ static const struct tegra_pmc_soc tegra234_pmc_soc = {
[ ... ]
> +static const struct tegra_pmc_regs tegra238_pmc_regs = {
> +	.scratch0 = 0x2000,
> +	.rst_status = 0x70,
> +	.rst_source_shift = 0x2,
> +	.rst_source_mask = 0xfc,
> +	.rst_level_shift = 0x0,
> +	.rst_level_mask = 0x3,
> +};

Does this omit the initialization of the aowake_* register offsets?

Since fields like aowake_mask_w, aowake_status_w, aowake_status_r, and
aowake_tier2_routing are missing from the structure definition, they
will default to 0.

Looking at tegra238_pmc_soc below, it uses tegra186_pmc_irq_set_wake()
and tegra186_pmc_irq_set_type() for its wake operations. These functions
calculate register addresses based on these offsets.

If the offsets default to 0, wouldn't the wake mask, status, and routing
operations collide with offset 0x0 (which maps to the control register)
and potentially corrupt the hardware PMC state during wakeup
configuration?

> +
> +static const char * const tegra238_reset_sources[] = {
[ ... ]
> +static const struct tegra_pmc_soc tegra238_pmc_soc = {
[ ... ]
> +	.regs = &tegra238_pmc_regs,
> +	.init = tegra186_pmc_init,
> +	.setup_irq_polarity = tegra186_pmc_setup_irq_polarity,
> +	.set_wake_filters = tegra186_pmc_set_wake_filters,
> +	.irq_set_wake = tegra186_pmc_irq_set_wake,
> +	.irq_set_type = tegra186_pmc_irq_set_type,
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260514124856.108606-1-pshete@nvidia.com?part=2

  reply	other threads:[~2026-05-14 19:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-14 12:48 [PATCH 1/2] dt-bindings: tegra: pmc: Add Tegra238 compatible Prathamesh Shete
2026-05-14 12:48 ` [PATCH 2/2] soc/tegra: pmc: Add Tegra238 support Prathamesh Shete
2026-05-14 19:11   ` sashiko-bot [this message]
2026-05-14 18:10 ` [PATCH 1/2] dt-bindings: tegra: pmc: Add Tegra238 compatible Conor Dooley

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=20260514191134.736C7C2BCB3@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=pshete@nvidia.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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