]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nvmem: imx: assign nvmem_cell_info::raw_len
authorChristian Eggers <ceggers@arri.de>
Fri, 27 Mar 2026 13:16:44 +0000 (13:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2026 14:44:40 +0000 (16:44 +0200)
Avoid getting error messages at startup like the following on i.MX6ULL:

nvmem imx-ocotp0: cell mac-addr raw len 6 unaligned to nvmem word size 4
nvmem imx-ocotp0: cell mac-addr raw len 6 unaligned to nvmem word size 4

This shouldn't cause any functional change as this alignment would
otherwise be done in nvmem_cell_info_to_nvmem_cell_entry_nodup().

Cc: stable@vger.kernel.org
Fixes: 13bcd440f2ff ("nvmem: core: verify cell's raw_len")
Signed-off-by: Christian Eggers <ceggers@arri.de>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20260327131645.3025781-2-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvmem/imx-ocotp-ele.c
drivers/nvmem/imx-ocotp.c

index 7cf7e809a8f51afd94089b18d9b06c71295d6906..a0d2985c6d03040b5d0e8a7f9bdb4bb97d01170d 100644 (file)
@@ -131,6 +131,7 @@ static int imx_ocotp_cell_pp(void *context, const char *id, int index,
 static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem,
                                         struct nvmem_cell_info *cell)
 {
+       cell->raw_len = round_up(cell->bytes, 4);
        cell->read_post_process = imx_ocotp_cell_pp;
 }
 
index 7bf7656d4f96318864fe12c21dbf60ead34fd55c..108d78d7f6cba6f8f5dcb1065e0b982d1d9f67e0 100644 (file)
@@ -589,6 +589,7 @@ MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids);
 static void imx_ocotp_fixup_dt_cell_info(struct nvmem_device *nvmem,
                                         struct nvmem_cell_info *cell)
 {
+       cell->raw_len = round_up(cell->bytes, 4);
        cell->read_post_process = imx_ocotp_cell_pp;
 }