[PATCH] nvmem: meson-mx-efuse: fix reading from an offset other than 0

Martin Blumenstingl martin.blumenstingl at googlemail.com
Fri Dec 1 13:24:07 PST 2017


Hi Srinivas, Hi Greg,

On Sun, Nov 12, 2017 at 7:34 PM, Martin Blumenstingl
<martin.blumenstingl at googlemail.com> wrote:
> meson_mx_efuse_read calculates the address internal to the eFuse based
> on the offset and the word size. This works fine with any given offset.
> However, the offset is also included when writing to the output buffer.
> This means that reading 4 bytes at offset 500 tries to write beyond the
> array allocated by the nvmem core as it wants to write the 4 bytes to
> "buffer address + offset (500)".
> This issue did not show up in the previous tests since no driver uses
> any value from the eFuse yet and reading the eFuse via sysfs simply
> reads the whole eFuse, starting at offset 0.
>
> Fix this by only including the offset in the internal address
> calculation.
>
> Fixes: 8caef1fa9176 ("nvmem: add a driver for the Amlogic Meson6/Meson8/Meson8b SoCs")
if you don't have any comments on this patch: could you please queue
it as a fix for 4.15 (which is where above commit landed)?


thank you!
Regards
Martin



More information about the linux-amlogic mailing list