Patch "iommu/arm-smmu-qcom: Limit the SMR groups to 128" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    iommu/arm-smmu-qcom: Limit the SMR groups to 128

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     iommu-arm-smmu-qcom-limit-the-smr-groups-to-128.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 472420571d0ac36165e325b1ff61758700d6959f
Author: Manivannan Sadhasivam <mani@xxxxxxxxxx>
Date:   Mon Mar 27 13:30:29 2023 +0530

    iommu/arm-smmu-qcom: Limit the SMR groups to 128
    
    [ Upstream commit 12261134732689b7e30c59db9978f81230965181 ]
    
    Some platforms support more than 128 stream matching groups than what is
    defined by the ARM SMMU architecture specification. But due to some unknown
    reasons, those additional groups don't exhibit the same behavior as the
    architecture supported ones.
    
    For instance, the additional groups will not detect the quirky behavior of
    some firmware versions intercepting writes to S2CR register, thus skipping
    the quirk implemented in the driver and causing boot crash.
    
    So let's limit the groups to 128 for now until the issue with those groups
    are fixed and issue a notice to users in that case.
    
    Reviewed-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
    Tested-by: Johan Hovold <johan+linaro@xxxxxxxxxx>
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230327080029.11584-1-manivannan.sadhasivam@xxxxxxxxxx
    [will: Reworded the comment slightly]
    Signed-off-by: Will Deacon <will@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
index 63f7173b241f0..1598a1ddbf694 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
@@ -32,12 +32,26 @@ static const struct of_device_id qcom_smmu_client_of_match[] __maybe_unused = {
 
 static int qcom_smmu_cfg_probe(struct arm_smmu_device *smmu)
 {
-	unsigned int last_s2cr = ARM_SMMU_GR0_S2CR(smmu->num_mapping_groups - 1);
 	struct qcom_smmu *qsmmu = to_qcom_smmu(smmu);
+	unsigned int last_s2cr;
 	u32 reg;
 	u32 smr;
 	int i;
 
+	/*
+	 * Some platforms support more than the Arm SMMU architected maximum of
+	 * 128 stream matching groups. For unknown reasons, the additional
+	 * groups don't exhibit the same behavior as the architected registers,
+	 * so limit the groups to 128 until the behavior is fixed for the other
+	 * groups.
+	 */
+	if (smmu->num_mapping_groups > 128) {
+		dev_notice(smmu->dev, "\tLimiting the stream matching groups to 128\n");
+		smmu->num_mapping_groups = 128;
+	}
+
+	last_s2cr = ARM_SMMU_GR0_S2CR(smmu->num_mapping_groups - 1);
+
 	/*
 	 * With some firmware versions writes to S2CR of type FAULT are
 	 * ignored, and writing BYPASS will end up written as FAULT in the



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux