All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Judith Mendez" <jm@ti.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [RFC PATCH 3/3] nvmem: uniphier-efuse: Add ti,am62p-efuse compatible
Date: Wed, 12 Aug 2026 15:56:48 +0000	[thread overview]
Message-ID: <20260812155648.C4A531F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812154442.3379851-4-jm@ti.com>

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] Using byte-wise register reads (`readb()`) on TI K3 AM62p efuse registers will cause a synchronous external abort (bus fault).
- [Medium] Reusing a vendor-specific driver (Socionext Uniphier) for an unrelated vendor's SoC (Texas Instruments AM62p) purely for simple MMIO reads is a design anti-pattern.
- [Medium] The new `ti,am62p-efuse` compatible incorrectly inherits legacy NVMEM device tree binding behavior.
- [Medium] The driver does not ensure that clocks and power domains are enabled before accessing hardware registers.
--

--- Patch [3]: [RFC PATCH 3/3] nvmem: uniphier-efuse: Add ti,am62p-efuse compatible ---
commit 364e40673a46df742ec59f8dd05432dba10e9a3a
Author: Judith Mendez <jm@ti.com>

nvmem: uniphier-efuse: Add ti,am62p-efuse compatible

Add ti,am62p-efuse compatible to uniphier-efuse. Leverage the
nvmem provider to supply silicon revision information from GP_SW
efuse registers on AM62p device.

> diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c
> index 6ad3295d31951..35977e1864135 100644
> --- a/drivers/nvmem/uniphier-efuse.c
> +++ b/drivers/nvmem/uniphier-efuse.c
> @@ -60,6 +60,7 @@ static int uniphier_efuse_probe(struct platform_device *pdev)
>  
>  static const struct of_device_id uniphier_efuse_of_match[] = {
>  	{ .compatible = "socionext,uniphier-efuse",},
> +	{ .compatible = "ti,am62p-efuse",},

[Severity: Medium]
Is it appropriate to reuse a vendor-specific driver (Socionext Uniphier) for
an unrelated vendor's SoC (Texas Instruments AM62p) purely for simple MMIO
reads?

If a simple generic MMIO-based NVMEM provider is needed, would it be better to
use a generic nvmem-mmio driver or syscon-based nvmem rather than piggybacking
onto another vendor's specific driver?

[Severity: High]
Will the byte-wise register reads in this driver cause a synchronous external
abort (bus fault) on TI K3 AM62p hardware?

The uniphier-efuse driver hardcodes a 1-byte word size and stride, and uses
readb() to read data:

drivers/nvmem/uniphier-efuse.c:uniphier_reg_read() {
    ...
    *val++ = readb(priv->base + reg + offs);
    ...
}

Since TI K3 SoC peripherals strictly require 32-bit aligned reads (readl()),
could performing 8-bit reads on these hardware registers result in an
external bus exception and crash the system?

[Severity: Medium]
By binding the new TI compatible to this driver, does the AM62p incorrectly
inherit legacy NVMEM device tree binding behavior?

The driver unconditionally enables legacy parsing:

drivers/nvmem/uniphier-efuse.c:uniphier_efuse_probe() {
    ...
    econfig.add_legacy_fixed_of_cells = true;
    ...
}

This tells the NVMEM core to fall back to the deprecated #address-cells and
#size-cells parsing. Shouldn't new NVMEM providers use the standard
nvmem-layout binding?

[Severity: Medium]
How does this driver ensure that clocks and power domains are enabled before
accessing hardware registers on the AM62p?

The uniphier-efuse probe function performs raw memory-mapped reads without any
prior runtime power management, such as pm_runtime_enable() or
pm_runtime_get_sync().

On TI K3 platforms, accessing peripheral registers when the corresponding
TI SCI power domain is disabled typically leads to a system hang or bus fault.

Are there protections in place to prevent this if the domain is ever
power-gated?

>  	{/* sentinel */},
>  };
>  MODULE_DEVICE_TABLE(of, uniphier_efuse_of_match);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812154442.3379851-1-jm@ti.com?part=3

      reply	other threads:[~2026-08-12 15:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12 15:44 [RFC PATCH 0/3] Support AM62P silicon revision detection via uniphier-efuse Judith Mendez
2026-08-12 15:44 ` [RFC PATCH 1/3] dt-bindings: nvmem: uniphier-efuse: Add ti,am62p-efuse compatible Judith Mendez
2026-08-12 15:53   ` sashiko-bot
2026-08-12 15:44 ` [RFC PATCH 2/3] nvmem: uniphier-efuse: Enable for K3 SoCs Judith Mendez
2026-08-12 15:54   ` sashiko-bot
2026-08-12 15:44 ` [RFC PATCH 3/3] nvmem: uniphier-efuse: Add ti,am62p-efuse compatible Judith Mendez
2026-08-12 15:56   ` sashiko-bot [this message]

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=20260812155648.C4A531F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jm@ti.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 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.