Alex Elder 834a5483bf net: ipa: don't assume SMEM is page-aligned
[ 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>
2022-08-31 17:18:05 +02:00
..
2022-05-20 11:12:23 +01:00
2022-05-22 20:46:12 +01:00
2022-05-20 11:12:23 +01:00
2022-05-22 20:46:12 +01:00
2022-05-22 20:46:12 +01:00
2022-05-22 20:46:12 +01:00
2021-11-25 19:37:33 -08:00
2021-07-26 23:09:18 +01:00
2021-06-11 14:13:18 -07:00
2021-06-11 14:13:18 -07:00
2021-08-22 09:44:17 +01:00
2021-06-11 14:13:18 -07:00
2021-08-22 09:44:17 +01:00