regmap: Account for register length when chunking
stable inclusion from stable-v5.10.183 commit 608c1f20830c3a07c0a16886e465deba7280364d category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8IRR2 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=608c1f20830c3a07c0a16886e465deba7280364d -------------------------------- commit 39815141 upstream. Currently, when regmap_raw_write() splits the data, it uses the max_raw_write value defined for the bus. For any bus that includes the target register address in the max_raw_write value, the chunked transmission will always exceed the maximum transmission length. To avoid this problem, subtract the length of the register and the padding from the maximum transmission. Signed-off-by:Jim Wylder <jwylder@google.com> Link: https://lore.kernel.org/r/20230517152444.3690870-2-jwylder@google.com Signed-off-by:
Mark Brown <broonie@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com> (cherry picked from commit 72559bcb)
Loading
Please sign in to comment