2020-12-22 00:47:10

by Isaac J. Manjarres

[permalink] [raw]
Subject: [PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

The SMMU driver depends on the availability of the ARM LPAE and
ARM V7S io-pgtable format code to work properly. In preparation
for having the io-pgtable formats as modules, add a "pre"
dependency with MODULE_SOFTDEP() to ensure that the io-pgtable
format modules are loaded before loading the ARM SMMU driver module.

Signed-off-by: Isaac J. Manjarres <[email protected]>
---
drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
index d8c6bfd..a72649f 100644
--- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
+++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
@@ -2351,3 +2351,4 @@ MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
MODULE_AUTHOR("Will Deacon <[email protected]>");
MODULE_ALIAS("platform:arm-smmu");
MODULE_LICENSE("GPL v2");
+MODULE_SOFTDEP("pre: io-pgtable-arm io-pgtable-arm-v7s");
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


2020-12-22 19:31:21

by Robin Murphy

[permalink] [raw]
Subject: Re: [PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

On 2020-12-22 00:44, Isaac J. Manjarres wrote:
> The SMMU driver depends on the availability of the ARM LPAE and
> ARM V7S io-pgtable format code to work properly. In preparation

Nit: we don't really depend on v7s - we *can* use it if it's available,
address constraints are suitable, and the SMMU implementation actually
supports it (many don't), but we can still quite happily not use it even
so. LPAE is mandatory in the architecture so that's our only hard
requirement, embodied in the kconfig select.

This does mean there may technically still be a corner case involving
ARM_SMMU=y and IO_PGTABLE_ARM_V7S=m, but at worst it's now a runtime
failure rather than a build error, so unless and until anyone
demonstrates that it actually matters I don't feel particularly inclined
to give it much thought.

Robin.

> for having the io-pgtable formats as modules, add a "pre"
> dependency with MODULE_SOFTDEP() to ensure that the io-pgtable
> format modules are loaded before loading the ARM SMMU driver module.
>
> Signed-off-by: Isaac J. Manjarres <[email protected]>
> ---
> drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> index d8c6bfd..a72649f 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> @@ -2351,3 +2351,4 @@ MODULE_DESCRIPTION("IOMMU API for ARM architected SMMU implementations");
> MODULE_AUTHOR("Will Deacon <[email protected]>");
> MODULE_ALIAS("platform:arm-smmu");
> MODULE_LICENSE("GPL v2");
> +MODULE_SOFTDEP("pre: io-pgtable-arm io-pgtable-arm-v7s");
>

2020-12-22 19:52:39

by Isaac J. Manjarres

[permalink] [raw]
Subject: Re: [PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

On 2020-12-22 11:27, Robin Murphy wrote:
> On 2020-12-22 00:44, Isaac J. Manjarres wrote:
>> The SMMU driver depends on the availability of the ARM LPAE and
>> ARM V7S io-pgtable format code to work properly. In preparation
>
> Nit: we don't really depend on v7s - we *can* use it if it's
> available, address constraints are suitable, and the SMMU
> implementation actually supports it (many don't), but we can still
> quite happily not use it even so. LPAE is mandatory in the
> architecture so that's our only hard requirement, embodied in the
> kconfig select.
>
> This does mean there may technically still be a corner case involving
> ARM_SMMU=y and IO_PGTABLE_ARM_V7S=m, but at worst it's now a runtime
> failure rather than a build error, so unless and until anyone
> demonstrates that it actually matters I don't feel particularly
> inclined to give it much thought.
>
> Robin.
>
Okay, I'll fix up the commit message, as well as the code, so that it
only depends on io-pgtable-arm.

Thanks,
Isaac
>> for having the io-pgtable formats as modules, add a "pre"
>> dependency with MODULE_SOFTDEP() to ensure that the io-pgtable
>> format modules are loaded before loading the ARM SMMU driver module.
>>
>> Signed-off-by: Isaac J. Manjarres <[email protected]>
>> ---
>> drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c
>> b/drivers/iommu/arm/arm-smmu/arm-smmu.c
>> index d8c6bfd..a72649f 100644
>> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
>> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
>> @@ -2351,3 +2351,4 @@ MODULE_DESCRIPTION("IOMMU API for ARM
>> architected SMMU implementations");
>> MODULE_AUTHOR("Will Deacon <[email protected]>");
>> MODULE_ALIAS("platform:arm-smmu");
>> MODULE_LICENSE("GPL v2");
>> +MODULE_SOFTDEP("pre: io-pgtable-arm io-pgtable-arm-v7s");
>>
>
> _______________________________________________
> linux-arm-kernel mailing list
> [email protected]
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2020-12-23 13:08:32

by Robin Murphy

[permalink] [raw]
Subject: Re: [PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

On 2020-12-22 19:49, [email protected] wrote:
> On 2020-12-22 11:27, Robin Murphy wrote:
>> On 2020-12-22 00:44, Isaac J. Manjarres wrote:
>>> The SMMU driver depends on the availability of the ARM LPAE and
>>> ARM V7S io-pgtable format code to work properly. In preparation
>>
>> Nit: we don't really depend on v7s - we *can* use it if it's
>> available, address constraints are suitable, and the SMMU
>> implementation actually supports it (many don't), but we can still
>> quite happily not use it even so. LPAE is mandatory in the
>> architecture so that's our only hard requirement, embodied in the
>> kconfig select.
>>
>> This does mean there may technically still be a corner case involving
>> ARM_SMMU=y and IO_PGTABLE_ARM_V7S=m, but at worst it's now a runtime
>> failure rather than a build error, so unless and until anyone
>> demonstrates that it actually matters I don't feel particularly
>> inclined to give it much thought.
>>
>> Robin.
>>
> Okay, I'll fix up the commit message, as well as the code, so that it
> only depends on io-pgtable-arm.

Well, IIUC it would make sense to keep the softdep for when the v7s
module *is* present; I just wanted to clarify that it's more of a
nice-to-have rather than a necessity.

Robin.

> Thanks,
> Isaac
>>> for having the io-pgtable formats as modules, add a "pre"
>>> dependency with MODULE_SOFTDEP() to ensure that the io-pgtable
>>> format modules are loaded before loading the ARM SMMU driver module.
>>>
>>> Signed-off-by: Isaac J. Manjarres <[email protected]>
>>> ---
>>>   drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c
>>> b/drivers/iommu/arm/arm-smmu/arm-smmu.c
>>> index d8c6bfd..a72649f 100644
>>> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
>>> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
>>> @@ -2351,3 +2351,4 @@ MODULE_DESCRIPTION("IOMMU API for ARM
>>> architected SMMU implementations");
>>>   MODULE_AUTHOR("Will Deacon <[email protected]>");
>>>   MODULE_ALIAS("platform:arm-smmu");
>>>   MODULE_LICENSE("GPL v2");
>>> +MODULE_SOFTDEP("pre: io-pgtable-arm io-pgtable-arm-v7s");
>>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> [email protected]
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

2020-12-23 15:14:35

by Isaac J. Manjarres

[permalink] [raw]
Subject: Re: [PATCH v2 3/7] iommu/arm-smmu: Add dependency on io-pgtable format modules

On 2020-12-23 05:05, Robin Murphy wrote:
> On 2020-12-22 19:49, [email protected] wrote:
>> On 2020-12-22 11:27, Robin Murphy wrote:
>>> On 2020-12-22 00:44, Isaac J. Manjarres wrote:
>>>> The SMMU driver depends on the availability of the ARM LPAE and
>>>> ARM V7S io-pgtable format code to work properly. In preparation
>>>
>>> Nit: we don't really depend on v7s - we *can* use it if it's
>>> available, address constraints are suitable, and the SMMU
>>> implementation actually supports it (many don't), but we can still
>>> quite happily not use it even so. LPAE is mandatory in the
>>> architecture so that's our only hard requirement, embodied in the
>>> kconfig select.
>>>
>>> This does mean there may technically still be a corner case involving
>>> ARM_SMMU=y and IO_PGTABLE_ARM_V7S=m, but at worst it's now a runtime
>>> failure rather than a build error, so unless and until anyone
>>> demonstrates that it actually matters I don't feel particularly
>>> inclined to give it much thought.
>>>
>>> Robin.
>>>
>> Okay, I'll fix up the commit message, as well as the code, so that it
>> only depends on io-pgtable-arm.
>
> Well, IIUC it would make sense to keep the softdep for when the v7s
> module *is* present; I just wanted to clarify that it's more of a
> nice-to-have rather than a necessity.
>
> Robin.
>
Understood, I will keep it there and reword the commit msg. I just tried
it out in an environment
where the io-pgtable-arm-v7s module isn't present, and I didn't see any
warnings or error messages, and the SMMU driver module was loaded
properly,
so yes, it's good to have it.

Thanks,
Isaac
>> Thanks,
>> Isaac
>>>> for having the io-pgtable formats as modules, add a "pre"
>>>> dependency with MODULE_SOFTDEP() to ensure that the io-pgtable
>>>> format modules are loaded before loading the ARM SMMU driver module.
>>>>
>>>> Signed-off-by: Isaac J. Manjarres <[email protected]>
>>>> ---
>>>>   drivers/iommu/arm/arm-smmu/arm-smmu.c | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c
>>>> b/drivers/iommu/arm/arm-smmu/arm-smmu.c
>>>> index d8c6bfd..a72649f 100644
>>>> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
>>>> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
>>>> @@ -2351,3 +2351,4 @@ MODULE_DESCRIPTION("IOMMU API for ARM
>>>> architected SMMU implementations");
>>>>   MODULE_AUTHOR("Will Deacon <[email protected]>");
>>>>   MODULE_ALIAS("platform:arm-smmu");
>>>>   MODULE_LICENSE("GPL v2");
>>>> +MODULE_SOFTDEP("pre: io-pgtable-arm io-pgtable-arm-v7s");
>>>>
>>>
>>> _______________________________________________
>>> linux-arm-kernel mailing list
>>> [email protected]
>>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel