diff mbox series

[1/3] arm: smmu: allow SMMU to have more IRQs than context banks

Message ID 20240329000822.3363568-2-volodymyr_babchuk@epam.com (mailing list archive)
State New, archived
Headers show
Series Add experimental support for Qualcomm SA8155P SoC | expand

Commit Message

Volodymyr Babchuk March 29, 2024, 12:08 a.m. UTC
I encountered platform, namely Qualcomm SA8155P where SMMU-compatible
IO-MMU advertises more context IQRs than there are context banks. This
should not be an issue, we need to relax the check in the SMMU driver
to allow such configuration.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
---
 xen/drivers/passthrough/arm/smmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Orzel April 2, 2024, 7:28 a.m. UTC | #1
Hello,

On 29/03/2024 01:08, Volodymyr Babchuk wrote:
> 
> 
> I encountered platform, namely Qualcomm SA8155P where SMMU-compatible
NIT: a commit msg should be written in imperative mood

> IO-MMU advertises more context IQRs than there are context banks. This
> should not be an issue, we need to relax the check in the SMMU driver
> to allow such configuration.
> 
> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
> ---
>  xen/drivers/passthrough/arm/smmu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
> index 32e2ff279b..2dd3688f3b 100644
> --- a/xen/drivers/passthrough/arm/smmu.c
> +++ b/xen/drivers/passthrough/arm/smmu.c
> @@ -2550,7 +2550,7 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
>         parse_driver_options(smmu);
> 
>         if (smmu->version > ARM_SMMU_V1 &&
> -           smmu->num_context_banks != smmu->num_context_irqs) {
> +           smmu->num_context_banks > smmu->num_context_irqs) {
This was done in Linux by commit:
d1e20222d537 ("iommu/arm-smmu: Error out only if not enough context interrupts")

However, they also ignore superfluous interrupts. Shouldn't we do the same?

~Michal
Julien Grall April 17, 2024, 9:26 p.m. UTC | #2
Hi,

On 02/04/2024 08:28, Michal Orzel wrote:
> Hello,
> 
> On 29/03/2024 01:08, Volodymyr Babchuk wrote:
>>
>>
>> I encountered platform, namely Qualcomm SA8155P where SMMU-compatible
> NIT: a commit msg should be written in imperative mood
> 
>> IO-MMU advertises more context IQRs than there are context banks. This
>> should not be an issue, we need to relax the check in the SMMU driver
>> to allow such configuration.
>>
>> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
>> ---
>>   xen/drivers/passthrough/arm/smmu.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
>> index 32e2ff279b..2dd3688f3b 100644
>> --- a/xen/drivers/passthrough/arm/smmu.c
>> +++ b/xen/drivers/passthrough/arm/smmu.c
>> @@ -2550,7 +2550,7 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
>>          parse_driver_options(smmu);
>>
>>          if (smmu->version > ARM_SMMU_V1 &&
>> -           smmu->num_context_banks != smmu->num_context_irqs) {
>> +           smmu->num_context_banks > smmu->num_context_irqs) {
> This was done in Linux by commit:
> d1e20222d537 ("iommu/arm-smmu: Error out only if not enough context interrupts")
> 
> However, they also ignore superfluous interrupts. Shouldn't we do the same?

+1. It would be better to avoid allocating stating for IRQs that are 
never used.

Cheers,
diff mbox series

Patch

diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 32e2ff279b..2dd3688f3b 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -2550,7 +2550,7 @@  static int arm_smmu_device_dt_probe(struct platform_device *pdev)
 	parse_driver_options(smmu);
 
 	if (smmu->version > ARM_SMMU_V1 &&
-	    smmu->num_context_banks != smmu->num_context_irqs) {
+	    smmu->num_context_banks > smmu->num_context_irqs) {
 		dev_err(dev,
 			"found only %d context interrupt(s) but %d required\n",
 			smmu->num_context_irqs, smmu->num_context_banks);