Hello Stefano,

> On 11 Dec 2020, at 1:28 am, Stefano Stabellini <sstabell...@kernel.org> wrote:
> 
> On Thu, 10 Dec 2020, Rahul Singh wrote:
>> @@ -2087,29 +1693,8 @@ static int arm_smmu_domain_finalise(struct 
>> iommu_domain *domain,
>>      }
>> 
>>      /* Restrict the stage to what we can actually support */
>> -    if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1))
>> -            smmu_domain->stage = ARM_SMMU_DOMAIN_S2;
>> -    if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S2))
>> -            smmu_domain->stage = ARM_SMMU_DOMAIN_S1;
>> -
>> -    switch (smmu_domain->stage) {
>> -    case ARM_SMMU_DOMAIN_S1:
>> -            ias = (smmu->features & ARM_SMMU_FEAT_VAX) ? 52 : 48;
>> -            ias = min_t(unsigned long, ias, VA_BITS);
>> -            oas = smmu->ias;
>> -            fmt = ARM_64_LPAE_S1;
>> -            finalise_stage_fn = arm_smmu_domain_finalise_s1;
>> -            break;
>> -    case ARM_SMMU_DOMAIN_NESTED:
>> -    case ARM_SMMU_DOMAIN_S2:
>> -            ias = smmu->ias;
>> -            oas = smmu->oas;
>> -            fmt = ARM_64_LPAE_S2;
>> -            finalise_stage_fn = arm_smmu_domain_finalise_s2;
>> -            break;
>> -    default:
>> -            return -EINVAL;
>> -    }
>> +    smmu_domain->stage = ARM_SMMU_DOMAIN_S2;
>> +
> 
> Last time we agreed on adding an error message?

Yes I added in next patch to report error if Stage-2 is not supported 

if (reg & IDR0_S2P)                                                         
        smmu->features |= ARM_SMMU_FEAT_TRANS_S2;                               
                                                                                
    if (!(reg & IDR0_S2P)) {                                                    
        dev_err(smmu->dev, "no stage-2 translation support!\n");                
        return -ENXIO;                                                          
    }


Regards,
Rahul


Reply via email to