Skip to content

nvmem: Bring a tiny bit of sanity to reading 16/32/64 bits from nvmem

Douglas Anderson dri-devel linux-arm-msm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3drm/msm: Fix speed-bin support not to access outside valid memorydrivers/gpu/drm/msm/adreno/a6xx_gpu.c+8 -233 replies
2/3nvmem: core: Allow nvmem_cell_read_u16/32/64 to read smaller cellsdrivers/nvmem/core.c+19 -24 replies
3/3nvmem: core: nvmem_cell_read() should return the true sizedrivers/nvmem/core.c+7 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] nvmem: Bring a tiny bit of sanity to reading 16/32/64 bits from nvmem

This series was inspried by a KASAN warning that I got at bootup caused by the GPU driver on my system interfacing with the nvmem API incorrectly.

I have posted a fix for the GPU driver but looking at this nvmem entry made me question how the nvmem API was supposed to work. I've proposed some improvements and these seem better (to me) than any of:
- Open coding logic like that in "cpr.c" in the GPU driver.
- Ignoring the problem and just forcing everyone in the future to always specify a length of "2" for the GPU speed bin cells.
- Ignoring the problem and specifying a length of "4" for the GPU speed bin cells.

About applying the patches.
- GPU patch can land on its own. No need for the nvmem patches.
- nvmem patches can land on their own too.
- If the second nvmem patch lands without the first, however, it will break the GPU patch.

Douglas Anderson (3):
drm/msm: Fix speed-bin support not to access outside valid memory
nvmem: core: Allow nvmem_cell_read_u16/32/64 to read smaller cells
nvmem: core: nvmem_cell_read() should return the true size

 drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 31 +++++++--------------------
 drivers/nvmem/core.c                  | 30 ++++++++++++++++++++++----
 2 files changed, 34 insertions(+), 27 deletions(-)
Signature · 6 lines
2.30.1.766.gb4fecdf3b7-goog

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel