Skip to content

Commit 1b2cb4d

Browse files
saschahauergregkh
authored andcommitted
nvmem: imx-ocotp-ele: set word length to 1
The ELE hardware internally has a word length of 4. However, among other things we store MAC addresses in the ELE OCOTP. With a length of 6 bytes these are naturally unaligned to the word length. Therefore we must support unaligned reads in reg_read() and indeed it works properly when reg_read() is called via nvmem_reg_read(). Setting the word size to 4 has the only visible effect that doing unaligned reads from userspace via bin_attr_nvmem_read() do not work because they are rejected by that function. Given that we have to abstract from word accesses to byte accesses in the driver, set the word size to 1. This allows bytewise accesses from userspace to be able to test what the driver has to support anyway. Fixes: 22e9e6f ("nvmem: imx: support i.MX93 OCOTP") Signed-off-by: Sascha Hauer <[email protected]> Cc: stable <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 391b06e commit 1b2cb4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvmem/imx-ocotp-ele.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static int imx_ele_ocotp_probe(struct platform_device *pdev)
153153
priv->config.owner = THIS_MODULE;
154154
priv->config.size = priv->data->size;
155155
priv->config.reg_read = priv->data->reg_read;
156-
priv->config.word_size = 4;
156+
priv->config.word_size = 1;
157157
priv->config.stride = 1;
158158
priv->config.priv = priv;
159159
priv->config.read_only = true;

0 commit comments

Comments
 (0)