]> git.baikalelectronics.ru Git - kernel.git/commit
net: ipa: don't assume SMEM is page-aligned
authorAlex Elder <elder@linaro.org>
Thu, 18 Aug 2022 13:42:05 +0000 (08:42 -0500)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Aug 2022 01:10:48 +0000 (18:10 -0700)
commitf62dd1975ef0df257993131dbd9a847499b00b3e
tree0ed2eec3a8d67491f9f08bbfe939e5f980f39de3
parenta17d50ca98bf2fa926e6a0fc84ddbdec55eb4363
net: ipa: don't assume SMEM is page-aligned

In ipa_smem_init(), a Qualcomm SMEM region is allocated (if needed)
and then its virtual address is fetched using qcom_smem_get().  The
physical address associated with that region is also fetched.

The physical address is adjusted so that it is page-aligned, and an
attempt is made to update the size of the region to compensate for
any non-zero adjustment.

But that adjustment isn't done properly.  The physical address is
aligned twice, and as a result the size is never actually adjusted.

Fix this by *not* aligning the "addr" local variable, and instead
making the "phys" local variable be the adjusted "addr" value.

Fixes: 3d14eecb6f067 ("net: ipa: define SMEM memory region for IPA")
Signed-off-by: Alex Elder <elder@linaro.org>
Link: https://lore.kernel.org/r/20220818134206.567618-1-elder@linaro.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ipa/ipa_mem.c