]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:57:44 +0000 (11:57 +0200)
commit8cbbdfe64a6579f9db9ce90c32c8bf30502018e9
tree0c822ba6bc00b12a0dff183d055db7927b117f0c
parent93fd24db75e1bb1f950cf2f689e71f041119ada4
net: ipa: don't assume SMEM is page-aligned

BugLink: https://bugs.launchpad.net/bugs/1991717
[ Upstream commit b8d4380365c515d8e0351f2f46d371738dd19be1 ]

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: a0036bb413d5b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ipa/ipa_mem.c