iommu/arm-smmu-qcom: Implement S2CR quirk
authorBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 19 Oct 2020 18:23:23 +0000 (11:23 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:15 +0000 (11:54 +0100)
commit1dd44b5e5f202c8d62794df13dd4a5e587a2e105
tree71a7b65d61998265a5cb18e620a9623b2806c162
parentf48e7f77713e844a1f77e1b2e0b90a1216159b8c
iommu/arm-smmu-qcom: Implement S2CR quirk

commit f9081b8ff5934b8d69c748d0200e844cadd2c667 upstream.

The firmware found in some Qualcomm platforms intercepts writes to S2CR
in order to replace bypass type streams with fault; and ignore S2CR
updates of type fault.

Detect this behavior and implement a custom write_s2cr function in order
to trick the firmware into supporting bypass streams by the means of
configuring the stream for translation using a reserved and disabled
context bank.

Also circumvent the problem of configuring faulting streams by
configuring the stream as bypass.

Cc: <stable@vger.kernel.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Steev Klimaszewski <steev@kali.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20201019182323.3162386-4-bjorn.andersson@linaro.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c