]> git.itanic.dy.fi Git - linux-stable/commit
net: ipa: avoid 64-bit modulus
authorAlex Elder <elder@linaro.org>
Tue, 23 Mar 2021 01:05:05 +0000 (20:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:10:34 +0000 (11:10 +0200)
commit48afea293a892e685b22d575393d5a4a662413b4
tree6edebe6a526b09823722e03ede7d42c2e0075bc7
parent3ae25aca3f892087737e6e25c8e0eb49eb8fe0fb
net: ipa: avoid 64-bit modulus

[ Upstream commit 437c78f976f5b39fc4b2a1c65903a229f55912dd ]

It is possible for a 32 bit x86 build to use a 64 bit DMA address.

There are two remaining spots where the IPA driver does a modulo
operation to check alignment of a DMA address, and under certain
conditions this can lead to a build error on i386 (at least).

The alignment checks we're doing are for power-of-2 values, and this
means the lower 32 bits of the DMA address can be used.  This ensures
both operands to the modulo operator are 32 bits wide.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Alex Elder <elder@linaro.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: cf412ec33325 ("net: ipa: properly limit modem routing table use")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ipa/gsi.c
drivers/net/ipa/ipa_table.c