iommu: SMMU for SDM670
Subsystems (5)
cover iommu: SMMU for SDM670
This adds the compatible string for the Qualcomm Snapdragon 670's SMMU. The SMMU is necessary for GENI I2C, included in initial bringup because it doesn't need non-trivial patches except for patches conventionally added before the initial device tree (global clock controller and pinctrl).
Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 + drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 2 files changed, 2 insertions(+)
PATCH 1/2 dt-bindings: iommu: arm-smmu: add sdm670 compatible
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string in the documentation to represent its support.
--- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +1 -0
@@ -38,6 +38,7 @@ properties: - qcom,sc7280-smmu-500 - qcom,sc8180x-smmu-500 - qcom,sc8280xp-smmu-500 + - qcom,sdm670-smmu-500 - qcom,sdm845-smmu-500 - qcom,sdx55-smmu-500 - qcom,sdx65-smmu-500
Signature · 1 line
2.37.3
Re: [PATCH 1/2] dt-bindings: iommu: arm-smmu: add sdm670 compatible
Quoted 6 lines · Richard Acayan
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string in the documentation to represent its support.
Signed-off-by Richard Acayan <[email protected]>--- Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 +
Best regards,
Krzysztof
PATCH 2/2 iommu: arm-smmu-qcom: add sdm670 compatible
In reply to Richard AcayanThe Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1 -0
@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" }, { .compatible = "qcom,sdm845-smmu-500" }, { .compatible = "qcom,sm6125-smmu-500" }, { .compatible = "qcom,sm6350-smmu-500" },
Signature · 1 line
2.37.3
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 1 line · Richard Acayan
The Snapdragon 670 needs the IOMMU for GENI I2C.
Way more than that, but sure :D
Add a compatible string to
Quoted 4 lines
support it.
Signed-off-by Richard Acayan <[email protected]>---
Konrad
Quoted 15 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" }, { .compatible = "qcom,sdm845-smmu-500" }, { .compatible = "qcom,sm6125-smmu-500" }, { .compatible = "qcom,sm6350-smmu-500" },
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
In reply to Richard AcayanQuoted 13 lines · Richard Acayan
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +0
-0
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 4 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },
Why do we keep adding compatibles to the driver for apparently compatible devices?
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 9 lines · Krzysztof Kozlowski
Quoted 8 lines · Richard Acayan
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)
Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Konrad
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 25 lines · Konrad Dybcio
Quoted 9 lines · Krzysztof Kozlowski
Quoted 8 lines · Richard Acayan
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Konrad
Quoted 9 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Konrad
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 28 lines · Konrad Dybcio
Quoted 25 lines · Konrad Dybcio
Quoted 21 lines · Krzysztof Kozlowski
Quoted 13 lines · Richard Acayan
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +0
-0drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 4 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 9 lines
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Konrad
Quoted 3 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 34 lines · Krzysztof Kozlowski
Quoted 33 lines · Konrad Dybcio
Quoted 25 lines · Konrad Dybcio
Quoted 9 lines · Krzysztof Kozlowski
Quoted 8 lines · Richard Acayan
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Quoted 8 lines
Quoted 4 lines
Konrad
Quoted 3 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
No, perhaps I misunderstood you.
Quoted 4 lines
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Compatible lists in smmu-impl files allow matching driver quirks for SMMUs themselves and consumer devices (such as MDSS). The situation is more complicated, because some qcom SMMUs also require more quirks than others (think 8974 vs 8994 vs 8996/pro&660&8998 vs 845+ vs adreno smmu in various flavours), so all qcom SMMUs need to use qcom_smmu_impl and some others need even more quirks on top of that (that generally hurt performance or functionality, so we don't want them when they're unnecessary). If all generations of qcom SMMU implementation that bear the same name behaved anywhere near consistent, there would be no need for keeping this around, instead requiring only "qcom,broken-smmu" or something".
Konrad
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 49 lines · Krzysztof Kozlowski
Quoted 34 lines · Konrad Dybcio
Quoted 33 lines · Konrad Dybcio
Quoted 25 lines · Krzysztof Kozlowski
Quoted 9 lines · Richard Acayan
Quoted 8 lines
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Quoted 8 lines
Quoted 4 lines
Konrad
Quoted 3 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
No, perhaps I misunderstood you.
Quoted 4 lines
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Quoted 9 lines
Compatible lists in smmu-impl files allow matching driver quirks for SMMUs themselves and consumer devices (such as MDSS). The situation is more complicated, because some qcom SMMUs also require more quirks than others (think 8974 vs 8994 vs 8996/pro&660&8998 vs 845+ vs adreno smmu in various flavours), so all qcom SMMUs need to use
qcom_smmu_impland some others need even more quirks on top of that (that generally hurt performance or functionality, so we don't want them when they're unnecessary). If all generations of qcom SMMU implementation that bear the same name behaved anywhere near consistent, there would be no need for keeping this around, instead requiring only "qcom,broken-smmu" or something".
Hi, just stopping by to share my own thoughts.
First, I don't mind if this series doesn't get applied as-is. After seeing the eMMC driver in its current state:
I can understand that the devicetree maintainers don't want to see new SoCs touching drivers unnecessarily. Second, I don't see enough quirks to justify needing all compatible strings in the driver (2 quirky SoCs compared to 16 total not counting adreno iommu):
$ grep qcom, drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c
if (of_device_is_compatible(np, "qcom,msm8996-smmu-v2"))
* All targets that use the qcom,adreno-smmu compatible string *should*
{ .compatible = "qcom,adreno" },
{ .compatible = "qcom,mdp4" },
{ .compatible = "qcom,mdss" },
{ .compatible = "qcom,sc7180-mdss" },
{ .compatible = "qcom,sc7180-mss-pil" },
{ .compatible = "qcom,sc7280-mdss" },
{ .compatible = "qcom,sc7280-mss-pil" },
{ .compatible = "qcom,sc8180x-mdss" },
{ .compatible = "qcom,sm8250-mdss" },
{ .compatible = "qcom,sdm845-mdss" },
{ .compatible = "qcom,sdm845-mss-pil" },
if (of_device_is_compatible(np, "qcom,sdm845-smmu-500"))
{ .compatible = "qcom,msm8998-smmu-v2" },
{ .compatible = "qcom,qcm2290-smmu-500" },
{ .compatible = "qcom,sc7180-smmu-500" },
{ .compatible = "qcom,sc7280-smmu-500" },
{ .compatible = "qcom,sc8180x-smmu-500" },
{ .compatible = "qcom,sc8280xp-smmu-500" },
{ .compatible = "qcom,sdm630-smmu-v2" },
{ .compatible = "qcom,sdm670-smmu-500" },
{ .compatible = "qcom,sdm845-smmu-500" },
{ .compatible = "qcom,sm6125-smmu-500" },
{ .compatible = "qcom,sm6350-smmu-500" },
{ .compatible = "qcom,sm6375-smmu-500" },
{ .compatible = "qcom,sm8150-smmu-500" },
{ .compatible = "qcom,sm8250-smmu-500" },
{ .compatible = "qcom,sm8350-smmu-500" },
{ .compatible = "qcom,sm8450-smmu-500" },
if (of_device_is_compatible(np, "qcom,adreno-smmu"))I don't know if it's better to get myself involved in fixing this, though. There is no fallback that encompasses qcom devices but not all arm devices. Either way, I'll have to add a new compatible string to the driver.
If something like this is fine for now, I'll format it properly tomorrow:
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +7 -0
@@ -48,6 +48,13 @@ properties: - qcom,sm8350-smmu-500 - qcom,sm8450-smmu-500 - const: arm,mmu-500 + + - description: Qcom SoCs implementing "qcom,smmu-500" + items: + - enum: + - qcom,sdm670-smmu-500 + - const: qcom,smmu-500 + - description: Qcom Adreno GPUs implementing "arm,smmu-v2" items: - enum:
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1 -0
@@ -424,6 +424,7 @@ static struct arm_smmu_device *qcom_smmu_create(struct arm_smmu_device *smmu, }static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { + { .compatible ="qcom,smmu-500" }, { .compatible ="qcom,msm8998-smmu-v2" }, { .compatible ="qcom,qcm2290-smmu-500" }, { .compatible ="qcom,sc7180-smmu-500" },
Quoted 6 lines
Konrad
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 104 lines · Richard Acayan
Quoted 49 lines · Krzysztof Kozlowski
Quoted 34 lines · Konrad Dybcio
Quoted 33 lines · Konrad Dybcio
Quoted 25 lines · Krzysztof Kozlowski
Quoted 9 lines · Richard Acayan
Quoted 8 lines
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Quoted 8 lines
Quoted 4 lines
Konrad
Quoted 3 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
No, perhaps I misunderstood you.
Quoted 4 lines
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Quoted 9 lines
Compatible lists in smmu-impl files allow matching driver quirks for SMMUs themselves and consumer devices (such as MDSS). The situation is more complicated, because some qcom SMMUs also require more quirks than others (think 8974 vs 8994 vs 8996/pro&660&8998 vs 845+ vs adreno smmu in various flavours), so all qcom SMMUs need to use
qcom_smmu_impland some others need even more quirks on top of that (that generally hurt performance or functionality, so we don't want them when they're unnecessary). If all generations of qcom SMMU implementation that bear the same name behaved anywhere near consistent, there would be no need for keeping this around, instead requiring only "qcom,broken-smmu" or something".Hi, just stopping by to share my own thoughts.
First, I don't mind if this series doesn't get applied as-is. After seeing the eMMC driver in its current state:
I can understand that the devicetree maintainers don't want to see new SoCs touching drivers unnecessarily. Second, I don't see enough quirks to justify needing all compatible strings in the driver (2 quirky SoCs compared to 16 total not counting adreno iommu):
$ grep qcom, drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c if (of_device_is_compatible(np, "qcom,msm8996-smmu-v2")) * All targets that use the qcom,adreno-smmu compatible string *should* { .compatible = "qcom,adreno" }, { .compatible = "qcom,mdp4" }, { .compatible = "qcom,mdss" }, { .compatible = "qcom,sc7180-mdss" }, { .compatible = "qcom,sc7180-mss-pil" }, { .compatible = "qcom,sc7280-mdss" }, { .compatible = "qcom,sc7280-mss-pil" }, { .compatible = "qcom,sc8180x-mdss" }, { .compatible = "qcom,sm8250-mdss" }, { .compatible = "qcom,sdm845-mdss" }, { .compatible = "qcom,sdm845-mss-pil" }, if (of_device_is_compatible(np, "qcom,sdm845-smmu-500")) { .compatible = "qcom,msm8998-smmu-v2" }, { .compatible = "qcom,qcm2290-smmu-500" }, { .compatible = "qcom,sc7180-smmu-500" }, { .compatible = "qcom,sc7280-smmu-500" }, { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, { .compatible = "qcom,sdm670-smmu-500" }, { .compatible = "qcom,sdm845-smmu-500" }, { .compatible = "qcom,sm6125-smmu-500" }, { .compatible = "qcom,sm6350-smmu-500" }, { .compatible = "qcom,sm6375-smmu-500" }, { .compatible = "qcom,sm8150-smmu-500" }, { .compatible = "qcom,sm8250-smmu-500" }, { .compatible = "qcom,sm8350-smmu-500" }, { .compatible = "qcom,sm8450-smmu-500" }, if (of_device_is_compatible(np, "qcom,adreno-smmu"))
Quoted 5 lines
I don't know if it's better to get myself involved in fixing this, though. There is no fallback that encompasses qcom devices but not all arm devices. Either way, I'll have to add a new compatible string to the driver.
If something like this is fine for now, I'll format it properly tomorrow:
Please wait till we reach some conclusion otherwise your work might be wasted.
Quoted 4 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml properties: · line 57
Quoted 10 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +7
-0@@ -48,6 +48,13 @@ properties: - qcom,sm8350-smmu-500 - qcom,sm8450-smmu-500 - const: arm,mmu-500 + + - description: Qcom SoCs implementing "qcom,smmu-500" + items: + - enum: + - qcom,sdm670-smmu-500 + - const: qcom,smmu-500 +
Someone would have to confirm that smmu-500 is a real device spec/version. Otherwise this should be device-specific compatible (e.g. earliest in family).
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 124 lines · Krzysztof Kozlowski
Quoted 104 lines · Richard Acayan
Quoted 49 lines · Krzysztof Kozlowski
Quoted 34 lines · Konrad Dybcio
Quoted 33 lines · Konrad Dybcio
Quoted 25 lines · Krzysztof Kozlowski
Quoted 9 lines · Richard Acayan
Quoted 8 lines
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Quoted 8 lines
Quoted 4 lines
Konrad
Quoted 3 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
No, perhaps I misunderstood you.
Quoted 4 lines
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Quoted 9 lines
Compatible lists in smmu-impl files allow matching driver quirks for SMMUs themselves and consumer devices (such as MDSS). The situation is more complicated, because some qcom SMMUs also require more quirks than others (think 8974 vs 8994 vs 8996/pro&660&8998 vs 845+ vs adreno smmu in various flavours), so all qcom SMMUs need to use
qcom_smmu_impland some others need even more quirks on top of that (that generally hurt performance or functionality, so we don't want them when they're unnecessary). If all generations of qcom SMMU implementation that bear the same name behaved anywhere near consistent, there would be no need for keeping this around, instead requiring only "qcom,broken-smmu" or something".Hi, just stopping by to share my own thoughts.
First, I don't mind if this series doesn't get applied as-is. After seeing the eMMC driver in its current state:
I can understand that the devicetree maintainers don't want to see new SoCs touching drivers unnecessarily. Second, I don't see enough quirks to justify needing all compatible strings in the driver (2 quirky SoCs compared to 16 total not counting adreno iommu):
$ grep qcom, drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c if (of_device_is_compatible(np, "qcom,msm8996-smmu-v2")) * All targets that use the qcom,adreno-smmu compatible string *should* { .compatible = "qcom,adreno" }, { .compatible = "qcom,mdp4" }, { .compatible = "qcom,mdss" }, { .compatible = "qcom,sc7180-mdss" }, { .compatible = "qcom,sc7180-mss-pil" }, { .compatible = "qcom,sc7280-mdss" }, { .compatible = "qcom,sc7280-mss-pil" }, { .compatible = "qcom,sc8180x-mdss" }, { .compatible = "qcom,sm8250-mdss" }, { .compatible = "qcom,sdm845-mdss" }, { .compatible = "qcom,sdm845-mss-pil" }, if (of_device_is_compatible(np, "qcom,sdm845-smmu-500")) { .compatible = "qcom,msm8998-smmu-v2" }, { .compatible = "qcom,qcm2290-smmu-500" }, { .compatible = "qcom,sc7180-smmu-500" }, { .compatible = "qcom,sc7280-smmu-500" }, { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, { .compatible = "qcom,sdm670-smmu-500" }, { .compatible = "qcom,sdm845-smmu-500" }, { .compatible = "qcom,sm6125-smmu-500" }, { .compatible = "qcom,sm6350-smmu-500" }, { .compatible = "qcom,sm6375-smmu-500" }, { .compatible = "qcom,sm8150-smmu-500" }, { .compatible = "qcom,sm8250-smmu-500" }, { .compatible = "qcom,sm8350-smmu-500" }, { .compatible = "qcom,sm8450-smmu-500" }, if (of_device_is_compatible(np, "qcom,adreno-smmu"))Quoted 5 lines
I don't know if it's better to get myself involved in fixing this, though. There is no fallback that encompasses qcom devices but not all arm devices. Either way, I'll have to add a new compatible string to the driver.
If something like this is fine for now, I'll format it properly tomorrow:
Please wait till we reach some conclusion otherwise your work might be wasted.
Quoted 10 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +3
-0@@ -48,6 +48,13 @@ properties: - qcom,sm8350-smmu-500 - qcom,sm8450-smmu-500 - const: arm,mmu-500 + + - description: Qcom SoCs implementing "qcom,smmu-500" + items:
Quoted 8 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml properties: · line 57
Quoted 4 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +4
-0+ - enum: + - qcom,sdm670-smmu-500 + - const: qcom,smmu-500 +Someone would have to confirm that smmu-500 is a real device spec/version. Otherwise this should be device-specific compatible (e.g. earliest in family).
In my view it's hard to name it, downstream uses bool properties for enabling/disabling certain quirks and on different generations there are different combinations of that. Interestingly enough, I vaguely remember that the same quirk names can mean different things on different msm-X.Y versions.. Add to that, different msm-X.Y versions can have different assumptions on what's the default (aka without taking the bool properties into account) behaviour for a given compatible. So I suppose "first in the family" would be the best way to go for mainline, though there are still quite a few families:
<earlier ones used qcom_iommu>
- 8996 with quirks that are already accounted for (or one may also say it works by miracle, just like msm8916 - downstream adds more special handling, but looks like the fw is not as restrictive)
- 8996pro + 660 + 8998 with serious unmerged ones [1]
- 845 which seems to be aok
- special case of chromebooks where they only have qcom TZ/XPUs and not the hypervisor to fight with, so ma-a-aybe (no downstream reference & I don't have the hw to confirm) they can get away with less things
- 8[1234]50 which seem to be a mix-and-match of less serious (read: not accounting for them may hurt performance but will not make your device sepuku at SMMU probe) minor quirks [2][3][4][5] (big warning: these may be overriden somewhere in other device tree fragments, the surest option would be to take a compiled dtb and decompile it to be sure about it)
- 4xxx/6xxx series that mostly align with "whatever was there on the flagship soc released a year before"
Konrad
[1] https://github.com/SoMainline/linux/commits/marijn/v5.19-ninges/drivers/iommu
[2] https://github.com/TeamWin/android_kernel_samsung_d2q/blob/master/arch/arm64/boot/dts/qcom/msm-arm-smmu-sm8150-v2.dtsi
[3] https://android.googlesource.com/kernel/msm-extra/devicetree/+/refs/tags/android-11.0.0_r0.56/qcom/msm-arm-smmu-kona.dtsi
[4] https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/61.0.A.11.xxx/qcom/msm-arm-smmu-lahaina.dtsi
[5] https://github.com/sonyxperiadev/kernel-copyleft-dts/blob/64.0.A.2.xxx/devicetree/qcom/msm-arm-smmu-waipio.dtsi
Quoted 4 lines
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 135 lines · Konrad Dybcio
Quoted 124 lines · Krzysztof Kozlowski
Quoted 104 lines · Richard Acayan
Quoted 49 lines · Krzysztof Kozlowski
Quoted 34 lines · Konrad Dybcio
Quoted 33 lines · Konrad Dybcio
Quoted 25 lines · Krzysztof Kozlowski
Quoted 9 lines · Richard Acayan
Quoted 8 lines
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Quoted 8 lines
Quoted 4 lines
Konrad
Quoted 3 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
No, perhaps I misunderstood you.
Quoted 4 lines
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Quoted 9 lines
Compatible lists in smmu-impl files allow matching driver quirks for SMMUs themselves and consumer devices (such as MDSS). The situation is more complicated, because some qcom SMMUs also require more quirks than others (think 8974 vs 8994 vs 8996/pro&660&8998 vs 845+ vs adreno smmu in various flavours), so all qcom SMMUs need to use
qcom_smmu_impland some others need even more quirks on top of that (that generally hurt performance or functionality, so we don't want them when they're unnecessary). If all generations of qcom SMMU implementation that bear the same name behaved anywhere near consistent, there would be no need for keeping this around, instead requiring only "qcom,broken-smmu" or something".Hi, just stopping by to share my own thoughts.
First, I don't mind if this series doesn't get applied as-is. After seeing the eMMC driver in its current state:
I can understand that the devicetree maintainers don't want to see new SoCs touching drivers unnecessarily. Second, I don't see enough quirks to justify needing all compatible strings in the driver (2 quirky SoCs compared to 16 total not counting adreno iommu):
$ grep qcom, drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c if (of_device_is_compatible(np, "qcom,msm8996-smmu-v2")) * All targets that use the qcom,adreno-smmu compatible string *should* { .compatible = "qcom,adreno" }, { .compatible = "qcom,mdp4" }, { .compatible = "qcom,mdss" }, { .compatible = "qcom,sc7180-mdss" }, { .compatible = "qcom,sc7180-mss-pil" }, { .compatible = "qcom,sc7280-mdss" }, { .compatible = "qcom,sc7280-mss-pil" }, { .compatible = "qcom,sc8180x-mdss" }, { .compatible = "qcom,sm8250-mdss" }, { .compatible = "qcom,sdm845-mdss" }, { .compatible = "qcom,sdm845-mss-pil" }, if (of_device_is_compatible(np, "qcom,sdm845-smmu-500")) { .compatible = "qcom,msm8998-smmu-v2" }, { .compatible = "qcom,qcm2290-smmu-500" }, { .compatible = "qcom,sc7180-smmu-500" }, { .compatible = "qcom,sc7280-smmu-500" }, { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, { .compatible = "qcom,sdm670-smmu-500" }, { .compatible = "qcom,sdm845-smmu-500" }, { .compatible = "qcom,sm6125-smmu-500" }, { .compatible = "qcom,sm6350-smmu-500" }, { .compatible = "qcom,sm6375-smmu-500" }, { .compatible = "qcom,sm8150-smmu-500" }, { .compatible = "qcom,sm8250-smmu-500" }, { .compatible = "qcom,sm8350-smmu-500" }, { .compatible = "qcom,sm8450-smmu-500" }, if (of_device_is_compatible(np, "qcom,adreno-smmu"))Quoted 5 lines
I don't know if it's better to get myself involved in fixing this, though. There is no fallback that encompasses qcom devices but not all arm devices. Either way, I'll have to add a new compatible string to the driver.
If something like this is fine for now, I'll format it properly tomorrow:
Please wait till we reach some conclusion otherwise your work might be wasted.
Quoted 10 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +3
-0@@ -48,6 +48,13 @@ properties: - qcom,sm8350-smmu-500 - qcom,sm8450-smmu-500 - const: arm,mmu-500 + + - description: Qcom SoCs implementing "qcom,smmu-500" + items:Quoted 8 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml properties: · line 57
Quoted 4 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +4
-0+ - enum: + - qcom,sdm670-smmu-500 + - const: qcom,smmu-500 +Someone would have to confirm that smmu-500 is a real device spec/version. Otherwise this should be device-specific compatible (e.g. earliest in family).
Quoted 6 lines
In my view it's hard to name it, downstream uses bool properties for enabling/disabling certain quirks and on different generations there are different combinations of that. Interestingly enough, I vaguely remember that the same quirk names can mean different things on different msm-X.Y versions.. Add to that, different msm-X.Y versions can have different assumptions on what's the default (aka without taking the bool properties into account) behaviour for a given compatible.
Downstream does not care about ABI, coding style, reasonable approach, so it should not wonder that they code things inconsistent.
Quoted 16 lines
So I suppose "first in the family" would be
the best way to go for mainline, though there are still quite a few families:<earlier ones used
qcom_iommu>
- 8996 with quirks that are already accounted for (or one may also say it works by miracle, just like msm8916 - downstream adds more special handling, but looks like the fw is not as restrictive)- 8996pro + 660 + 8998 with serious unmerged ones [1]
- 845 which seems to be aok
- special case of chromebooks where they only have qcom TZ/XPUs and not the hypervisor to fight with, so ma-a-aybe (no downstream reference & I don't have the hw to confirm) they can get away with less things
Quoted 7 lines
- 8[1234]50 which seem to be a mix-and-match of less serious (read: not accounting for them may hurt performance but will not make your device sepuku at SMMU probe) minor quirks [2][3][4][5] (big warning: these may be overriden somewhere in other device tree fragments, the surest option would be to take a compiled dtb and decompile it to be sure about it)
- 4xxx/6xxx series that mostly align with "whatever was there on the flagship soc released a year before"
If the devices are really different, even though it is not visible in Linux driver, then indeed there is no point for fake compatibility. I raised the question only because the driver does not customize the variants, but that might be not enough.
Linked DTSI use different quirks (assuming quirks would have same meaning...), plus they have sometimes different amount of clocks, so in total maybe it is not reasonable to make them compatible. On the other hand, maybe the programming model is very, very similar thus Linux could bind to one fallback and few different bits would be customized with specific compatible.
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
Quoted 168 lines · Konrad Dybcio
Quoted 135 lines · Krzysztof Kozlowski
Quoted 124 lines · Richard Acayan
Quoted 104 lines
Quoted 49 lines · Krzysztof Kozlowski
Quoted 34 lines · Konrad Dybcio
Quoted 33 lines · Konrad Dybcio
Quoted 25 lines · Krzysztof Kozlowski
Quoted 9 lines · Richard Acayan
Quoted 8 lines
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Quoted 8 lines
Quoted 4 lines
Konrad
Quoted 3 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
No, perhaps I misunderstood you.
Quoted 4 lines
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Quoted 9 lines
Compatible lists in smmu-impl files allow matching driver quirks for SMMUs themselves and consumer devices (such as MDSS). The situation is more complicated, because some qcom SMMUs also require more quirks than others (think 8974 vs 8994 vs 8996/pro&660&8998 vs 845+ vs adreno smmu in various flavours), so all qcom SMMUs need to use
qcom_smmu_impland some others need even more quirks on top of that (that generally hurt performance or functionality, so we don't want them when they're unnecessary). If all generations of qcom SMMU implementation that bear the same name behaved anywhere near consistent, there would be no need for keeping this around, instead requiring only "qcom,broken-smmu" or something".Hi, just stopping by to share my own thoughts.
First, I don't mind if this series doesn't get applied as-is. After seeing the eMMC driver in its current state:
I can understand that the devicetree maintainers don't want to see new SoCs touching drivers unnecessarily. Second, I don't see enough quirks to justify needing all compatible strings in the driver (2 quirky SoCs compared to 16 total not counting adreno iommu):
$ grep qcom, drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c if (of_device_is_compatible(np, "qcom,msm8996-smmu-v2")) * All targets that use the qcom,adreno-smmu compatible string *should* { .compatible = "qcom,adreno" }, { .compatible = "qcom,mdp4" }, { .compatible = "qcom,mdss" }, { .compatible = "qcom,sc7180-mdss" }, { .compatible = "qcom,sc7180-mss-pil" }, { .compatible = "qcom,sc7280-mdss" }, { .compatible = "qcom,sc7280-mss-pil" }, { .compatible = "qcom,sc8180x-mdss" }, { .compatible = "qcom,sm8250-mdss" }, { .compatible = "qcom,sdm845-mdss" }, { .compatible = "qcom,sdm845-mss-pil" }, if (of_device_is_compatible(np, "qcom,sdm845-smmu-500")) { .compatible = "qcom,msm8998-smmu-v2" }, { .compatible = "qcom,qcm2290-smmu-500" }, { .compatible = "qcom,sc7180-smmu-500" }, { .compatible = "qcom,sc7280-smmu-500" }, { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, { .compatible = "qcom,sdm670-smmu-500" }, { .compatible = "qcom,sdm845-smmu-500" }, { .compatible = "qcom,sm6125-smmu-500" }, { .compatible = "qcom,sm6350-smmu-500" }, { .compatible = "qcom,sm6375-smmu-500" }, { .compatible = "qcom,sm8150-smmu-500" }, { .compatible = "qcom,sm8250-smmu-500" }, { .compatible = "qcom,sm8350-smmu-500" }, { .compatible = "qcom,sm8450-smmu-500" }, if (of_device_is_compatible(np, "qcom,adreno-smmu"))Quoted 5 lines
I don't know if it's better to get myself involved in fixing this, though. There is no fallback that encompasses qcom devices but not all arm devices. Either way, I'll have to add a new compatible string to the driver.
If something like this is fine for now, I'll format it properly tomorrow:
Please wait till we reach some conclusion otherwise your work might be wasted.
Quoted 10 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +3
-0@@ -48,6 +48,13 @@ properties: - qcom,sm8350-smmu-500 - qcom,sm8450-smmu-500 - const: arm,mmu-500 + + - description: Qcom SoCs implementing "qcom,smmu-500" + items:Quoted 8 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml properties: · line 57
Quoted 4 lines
Documentation/devicetree/bindings/iommu/arm,smmu.yaml +4
-0+ - enum: + - qcom,sdm670-smmu-500 + - const: qcom,smmu-500 +Someone would have to confirm that smmu-500 is a real device spec/version. Otherwise this should be device-specific compatible (e.g. earliest in family).
Quoted 6 lines
In my view it's hard to name it, downstream uses bool properties for enabling/disabling certain quirks and on different generations there are different combinations of that. Interestingly enough, I vaguely remember that the same quirk names can mean different things on different msm-X.Y versions.. Add to that, different msm-X.Y versions can have different assumptions on what's the default (aka without taking the bool properties into account) behaviour for a given compatible.
Downstream does not care about ABI, coding style, reasonable approach, so it should not wonder that they code things inconsistent.
Quoted 21 lines
So I suppose "first in the family" would be
the best way to go for mainline, though there are still quite a few families:<earlier ones used
qcom_iommu>
- 8996 with quirks that are already accounted for (or one may also say it works by miracle, just like msm8916 - downstream adds more special handling, but looks like the fw is not as restrictive)- 8996pro + 660 + 8998 with serious unmerged ones [1]
- 845 which seems to be aok
- special case of chromebooks where they only have qcom TZ/XPUs and not the hypervisor to fight with, so ma-a-aybe (no downstream reference & I don't have the hw to confirm) they can get away with less things
- 8[1234]50 which seem to be a mix-and-match of less serious (read: not accounting for them may hurt performance but will not make your device sepuku at SMMU probe) minor quirks [2][3][4][5] (big warning: these may be overriden somewhere in other device tree fragments, the surest option would be to take a compiled dtb and decompile it to be sure about it)
Quoted 7 lines
Quoted 2 lines
- 4xxx/6xxx series that mostly align with "whatever was there on the flagship soc released a year before"
If the devices are really different, even though it is not visible in Linux driver, then indeed there is no point for fake compatibility. I raised the question only because the driver does not customize the variants, but that might be not enough.
If there are no problems with the original patch, could you please indicate that? I think this thread is getting a little lengthy for the other maintainers.
Quoted 6 lines
Linked DTSI use different quirks (assuming quirks would have same meaning...), plus they have sometimes different amount of clocks, so in total maybe it is not reasonable to make them compatible. On the other hand, maybe the programming model is very, very similar thus Linux could bind to one fallback and few different bits would be customized with specific compatible.
Not to rush you or anything. If you think this should be decided before the series goes in, it's not urgent.
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
In reply to Konrad DybcioQuoted 9 lines · Konrad Dybcio
Quoted 3 lines
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
No, perhaps I misunderstood you.
Quoted 4 lines
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Quoted 9 lines
Compatible lists in smmu-impl files allow matching driver quirks for SMMUs themselves and consumer devices (such as MDSS). The situation is more complicated, because some qcom SMMUs also require more quirks than others (think 8974 vs 8994 vs 8996/pro&660&8998 vs 845+ vs adreno smmu in various flavours), so all qcom SMMUs need to use
qcom_smmu_impland some others need even more quirks on top of that (that generally hurt performance or functionality, so we don't want them when they're unnecessary). If all generations of qcom SMMU implementation that bear the same name behaved anywhere near consistent, there would be no need for keeping this around, instead requiring only "qcom,broken-smmu" or something".
So where are the quirks? Again: driver data is empty.
Best regards,
Krzysztof
Re: [PATCH 2/2] iommu: arm-smmu-qcom: add sdm670 compatible
In reply to Konrad DybcioQuoted 51 lines · Konrad Dybcio
Quoted 34 lines · Krzysztof Kozlowski
Quoted 33 lines · Konrad Dybcio
Quoted 25 lines · Konrad Dybcio
Quoted 9 lines · Krzysztof Kozlowski
Quoted 8 lines · Richard Acayan
The Snapdragon 670 needs the IOMMU for GENI I2C. Add a compatible string to support it.
Signed-off-by Richard Acayan <[email protected]>--- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 1 + 1 file changed, 1 insertion(+)Quoted 12 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { · line 434
Quoted 9 lines
drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +1
-0@@ -431,6 +431,7 @@ static const struct of_device_id __maybe_unused qcom_smmu_impl_of_match[] = { { .compatible = "qcom,sc8180x-smmu-500" }, { .compatible = "qcom,sc8280xp-smmu-500" }, { .compatible = "qcom,sdm630-smmu-v2" }, + { .compatible = "qcom,sdm670-smmu-500" },Why do we keep adding compatibles to the driver for apparently compatible devices?
Quoted 1 line
Because Linux has not funny run on bare Qualcomm hardware ever since at least msm8x60 times and
s/funny/fully
unfortunate typo, this is not funny, quite the contrary..
Quoted 8 lines
Quoted 4 lines
Konrad
Quoted 3 lines
we are not interacting with real hardware, only with Qualcomm's flawed virtual implementation of it, that's abstracted to us through various generations of their saddening software stack. This is also the case for many more standard components, even as far as the GIC on recent boards..
Unfortunately I don't get this explanation... you mean some other firmware requires Linux drivers to use specific compatibles instead of one fallback?
No, perhaps I misunderstood you.
Quoted 4 lines
All of these do not have driver data, so they are essentially compatible for Linux driver. Growing this list in the driver seems pointless. What is the benefit of growing driver with same entries, except more patches?
Quoted 9 lines
Compatible lists in smmu-impl files allow matching driver quirks for SMMUs themselves and consumer devices (such as MDSS). The situation is more complicated, because some qcom SMMUs also require more quirks than others (think 8974 vs 8994 vs 8996/pro&660&8998 vs 845+ vs adreno smmu in various flavours), so all qcom SMMUs need to use
qcom_smmu_impland some others need even more quirks on top of that (that generally hurt performance or functionality, so we don't want them when they're unnecessary). If all generations of qcom SMMU implementation that bear the same name behaved anywhere near consistent, there would be no need for keeping this around, instead requiring only "qcom,broken-smmu" or something".
Excuse me for bumping this thread, I successfully forgot this message in drafts folder.
Granted the driver, your pending smmu patches and the current list of quirks (which includes qcom,msm8996-smmu-v2 and qcom,sdm845-smmu-500, and Konrad's unmerged quirks for -v2), I'd second the suggestion of adding a single qcom,msm-smmu-500 (or qcom,arm-smmu-500) entry as a generic fallback. Downstream device trees support this name by using the -v500 suffix (yes, it's a light argument, but still). This way we can apply SoC-specific quirks, while still retaining the generic entry here.
What's definitely has to be done is the merge of the platform data from arm-smmu-qcom-debug.c into arm-smmu-qcom.c. And having identical entries there just drives me crazy. I'll work on a patch later today.
For -v2 we already have the generic compat, however granted the lack of proper quirks in place, I'd abstain from reworking this part for now.
BTW: I'm trying to follow the commit a242f4297cfe ("iommu/arm-smmu-qcom: Skip the TTBR1 quirk for db820c."). It adds msm8996-specific quirk, but we lack the msm8996 compat entry in the array. Does this work at all?
Quoted 6 lines
Konrad
Quoted 4 lines
Best regards,
Krzysztof
Signature · 2 lines
With best wishes Dmitry