From: sashiko-bot@kernel.org
To: "Hongmei Xu" <hongmei.xu@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 1/2] dt-bindings: nvmem: add byte-mask property for non-contiguous byte selection
Date: Mon, 16 Nov 2026 03:05:33 +0000 [thread overview]
Message-ID: <sashiko-outbox-216098@kernel.org> (raw)
In-Reply-To: <20261116-nvmem-byte-mask-for-split-macaddr-v2-1-96f4a0c08264@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] dt-bindings: nvmem: byte-mask redefines reg size and accesses
beyond reg
--
commit 66779220f836f809e1148ff64ede0801ef303fad
Author: Hongmei Xu <hongmei.xu@oss.qualcomm.com>
dt-bindings: nvmem: add byte-mask property for non-contiguous byte selection
This commit adds the byte-mask property to the fixed-cell NVMEM binding to
select non-contiguous physical bytes within a 32-byte window relative to a
cell's base offset.
> diff --git a/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml b/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml
> index 38e3ad50ff4fb..46e1101ee98ae 100644
> --- a/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/layouts/fixed-cell.yaml
> @@ -34,6 +34,20 @@ properties:
> description:
> Size in bit within the address range specified by reg.
>
> + byte-mask:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + minimum: 1
> + description: >
> + Bitmask selecting which physical bytes within the NVMEM device region
> + contribute to this cell's output. Bit N set means physical byte N
> + relative to the cell's base offset is included; selected bytes are
> + packed into the output buffer in ascending byte order. Byte positions
> + are relative to the cell's base offset and limited to a 32-byte window.
> + The highest set bit must not reference a byte beyond the device size.
> + The number of set bits must not exceed the cell's logical size given by
> + reg. Cannot be used together with bits. Cells using byte-mask are
> + read-only; write operations are not supported.
[Severity: Medium]
Does byte-mask redefine the size cell of reg as a logical output size while
allowing physical reads past the declared reg range?
Any non-contiguous selection of K bytes has a highest set bit H >= K, which
references physical bytes at offset + H outside a reg = <offset K> range.
Unlike the existing bits property, which stays within the address range
specified by reg, setting reg = <offset K> causes physical accesses beyond
the cell's declared reg range and hides overlaps between sibling cells.
Conversely, setting reg = <offset M> to cover the full physical span M > K
leaves the contents of the trailing M - K output bytes unspecified in the
binding and causes consumers such as nvmem_get_mac_address() and
nvmem_cell_read_u32() to see an unexpected cell size M instead of K.
Also, the commit message notes that multiple reg entries would require the
consumer to assemble the value from separate cells, but multiple reg tuples
on a single cell node (for example, reg = <offset1 len1>, <offset2 len2>)
describe one cell with discontiguous physical ranges without redefining reg
or limiting the span to 32 bytes.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-nvmem-byte-mask-for-split-macaddr-v2-0-96f4a0c08264@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-11-16 3:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 2:58 [PATCH v2 0/2] nvmem: Add byte-mask support for non-contiguous byte selection Hongmei Xu
2026-11-16 2:58 ` [PATCH v2 1/2] dt-bindings: nvmem: add byte-mask property " Hongmei Xu
2026-11-16 3:05 ` sashiko-bot [this message]
2026-11-17 3:15 ` Hongmei Xu
2026-11-16 2:58 ` [PATCH v2 2/2] nvmem: core: add byte-mask support for non-contiguous cell bytes Hongmei Xu
2026-11-16 3:13 ` sashiko-bot
2026-11-17 5:41 ` Hongmei Xu
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=sashiko-outbox-216098@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=hongmei.xu@oss.qualcomm.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.