From: srini@kernel.org
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, Stefan Ghetu <stefan.ghetu@nxp.com>,
stable@vger.kernel.org, Daniel Baluta <daniel.baluta@nxp.com>,
Srinivas Kandagatla <srini@kernel.org>
Subject: [PATCH 08/10] nvmem: imx-ocotp-scu: assign nvmem_cell_info::raw_len
Date: Tue, 1 Dec 2026 23:26:55 +0000 [thread overview]
Message-ID: <20261201232657.537736-9-srini@kernel.org> (raw)
In-Reply-To: <20261201232657.537736-1-srini@kernel.org>
From: Stefan Ghetu <stefan.ghetu@nxp.com>
Avoid getting error messages at startup like the following on i.MX8QXP,
i.MX8QM and i.MX8DXL, printed once for each MAC address cell:
nvmem imx-scu-ocotp0: cell mac raw len 6 unaligned to nvmem word size 4
The same was already done for imx-ocotp and imx-ocotp-ele by commit
48b5163c9575 ("nvmem: imx: assign nvmem_cell_info::raw_len"), but the
SCU based driver was not covered.
This shouldn't cause any functional change as this alignment would
otherwise be done in nvmem_cell_info_to_nvmem_cell_entry_nodup().
Fixes: 13bcd440f2ff ("nvmem: core: verify cell's raw_len")
Cc: stable@vger.kernel.org
Signed-off-by: Stefan Ghetu <stefan.ghetu@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
---
drivers/nvmem/imx-ocotp-scu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/nvmem/imx-ocotp-scu.c b/drivers/nvmem/imx-ocotp-scu.c
index 20312fba22d2..80f78bcf3841 100644
--- a/drivers/nvmem/imx-ocotp-scu.c
+++ b/drivers/nvmem/imx-ocotp-scu.c
@@ -218,6 +218,12 @@ static int imx_scu_ocotp_write(void *context, unsigned int offset,
return res.a0;
}
+static void imx_scu_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem,
+ struct nvmem_cell_info *cell)
+{
+ cell->raw_len = round_up(cell->bytes, 4);
+}
+
static struct nvmem_config imx_scu_ocotp_nvmem_config = {
.name = "imx-scu-ocotp",
.add_legacy_fixed_of_cells = true,
@@ -227,6 +233,7 @@ static struct nvmem_config imx_scu_ocotp_nvmem_config = {
.owner = THIS_MODULE,
.reg_read = imx_scu_ocotp_read,
.reg_write = imx_scu_ocotp_write,
+ .fixup_dt_cell_info = imx_scu_ocotp_fixup_dt_cell_info,
};
static const struct of_device_id imx_scu_ocotp_dt_ids[] = {
--
2.53.0
next prev parent reply other threads:[~2026-12-01 23:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-01 23:26 [PATCH 00/10] nvmem: fixes for v7.4 srini
2026-12-01 23:26 ` [PATCH 01/10] nvmem: layouts: onie-tlv: check both field header and value bounds srini
2026-12-01 23:26 ` [PATCH 02/10] nvmem: core: validate DT cell bits before allocating the name srini
2026-12-01 23:26 ` [PATCH 03/10] nvmem: retain the provider node until device release srini
2026-12-01 23:26 ` [PATCH 04/10] nvmem: drain keepout and cell post-processing accesses srini
2026-12-01 23:26 ` [PATCH 05/10] nvmem: exclude disconnected providers from callback admission srini
2026-12-01 23:26 ` [PATCH 06/10] nvmem: release write protection when the provider disconnects srini
2026-12-01 23:26 ` [PATCH 07/10] nvmem: airoha-smc-efuses: Fix the SMC function ID for eFuse read srini
2026-12-01 23:26 ` srini [this message]
2026-12-01 23:26 ` [PATCH 09/10] nvmem: core: reject reads and writes beyond the device size srini
2026-12-01 23:26 ` [PATCH 10/10] nvmem: sprd: fix out-of-bounds read in sprd_efuse_read() srini
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=20261201232657.537736-9-srini@kernel.org \
--to=srini@kernel.org \
--cc=daniel.baluta@nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=stefan.ghetu@nxp.com \
/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.