Re: [PATCH v4 2/2] nvmem: aspeed: Add read-only AST2600 OTP support
From: Andrew Jeffery
Date: Fri Dec 04 2026 - 00:44:35 EST
Hi Prasanth,
On Fri, 2026-12-04 at 07:21 +0530, Prasanth wrote:
> Hi Andrew,
>
> Thanks for the detailed review. I’ll address these points in the next revision.
> - fix the continuation indentation and unwrap the short bounds check.
> - use readl_poll_timeout() for idle polling. The 1 µs delay will
> remain only after issuing an OTP command, as required by ASPEED’s
> clarification.
> - reject odd addresses in the internal pair-read helper. Public reads
> may still begin at an odd word by selecting the containing even pair.
> - move offset and length validation into the helper that performs the
> arithmetic and copying, while preserving zero-length success and
> overflow-safe bounds checks.
> - ensure the failure latch is checked before any further controller
> operation. Probe already stops after the first initialization failure
> and only performs relock cleanup.
> - consider the mutex annotations and context-analysis support for
> state protected by the mutex.
> - inline the single-use initialization helper if that makes the flow clearer.
> - use devm_kzalloc_obj() if there is no compatibility concern with the
> supported kernel baseline.
>
> The probe-time NVMEM keepout covers the fixed CONF0 range. Neal
> confirmed that SEC54 can increase until an ARM reset, including while
> Linux is running,
>
Sure, but what actually increases it? Nothing I saw in the driver does
so.
> and recommended checking it on each read.
> https://lore.kernel.org/linux-aspeed/KL1PR0601MB3986A356BD06F98D0FF9AD5E80792@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/
I don't think we should be accounting for it changing outside of the
driver's control.
> If SEC54 grows after probe and a request falls within the newly
> protected range, would you prefer the driver to return -EACCES before
> issuing the read, or rely on the controller’s response?
If we can't rely on the controller's response here I wonder how we rely
on the controller at all? Can you describe its behaviour when you try
accessing the secure region?
Andrew