mbox series

[v2,0/4] iommu: Remove iommu_fwspec ops

Message ID cover.1718994350.git.robin.murphy@arm.com (mailing list archive)
Headers show
Series iommu: Remove iommu_fwspec ops | expand

Message

Robin Murphy June 21, 2024, 6:46 p.m. UTC
v1: https://lore.kernel.org/linux-iommu/cover.1713523251.git.robin.murphy@arm.com

Hi all,

Here's v2 of this little cleanup, with acks and the additional cosmetic
tweak suggested by Andy. There were some slightly non-trivial changes in
the rebase so I've left off Jean-Philippe's tested-by from v1, but I've
given it a quick spin on arm64 ACPI and DT and all seems well still.

Thanks,
Robin.


Robin Murphy (4):
  iommu: Resolve fwspec ops automatically
  ACPI: Retire acpi_iommu_fwspec_ops()
  OF: Simplify of_iommu_configure()
  iommu: Remove iommu_fwspec ops

 drivers/acpi/arm64/iort.c             | 19 +++-------
 drivers/acpi/scan.c                   | 36 +++++--------------
 drivers/acpi/viot.c                   | 11 ++----
 drivers/iommu/arm/arm-smmu/arm-smmu.c |  3 +-
 drivers/iommu/iommu-priv.h            |  7 ++++
 drivers/iommu/iommu.c                 | 20 +++++------
 drivers/iommu/mtk_iommu_v1.c          |  2 +-
 drivers/iommu/of_iommu.c              | 50 ++++++++++-----------------
 drivers/iommu/tegra-smmu.c            |  2 +-
 drivers/of/device.c                   | 30 ++++++----------
 include/acpi/acpi_bus.h               |  3 +-
 include/linux/iommu.h                 | 15 ++------
 12 files changed, 65 insertions(+), 133 deletions(-)

Comments

Saravana Kannan June 21, 2024, 8:51 p.m. UTC | #1
On Fri, Jun 21, 2024 at 8:46 PM Robin Murphy <robin.murphy@arm.com> wrote:
>
> v1: https://lore.kernel.org/linux-iommu/cover.1713523251.git.robin.murphy@arm.com
>
> Hi all,
>
> Here's v2 of this little cleanup, with acks and the additional cosmetic
> tweak suggested by Andy. There were some slightly non-trivial changes in
> the rebase so I've left off Jean-Philippe's tested-by from v1, but I've
> given it a quick spin on arm64 ACPI and DT and all seems well still.

Hi Robin,

I see in this series you talk about figuring out if a device has a
driver that could match. There has been a "can_match" flag in every
device that's set if a driver that match it is present, but hasn't
probed the device yet (for whatever reason). Just pointing that out in
case that makes things a lot easier for you. As of now, we don't
handle clearing it when the driver is unregistered, but if that really
needs to be handled, that shouldn't be too difficult.

-Saravana

>
> Thanks,
> Robin.
>
>
> Robin Murphy (4):
>   iommu: Resolve fwspec ops automatically
>   ACPI: Retire acpi_iommu_fwspec_ops()
>   OF: Simplify of_iommu_configure()
>   iommu: Remove iommu_fwspec ops
>
>  drivers/acpi/arm64/iort.c             | 19 +++-------
>  drivers/acpi/scan.c                   | 36 +++++--------------
>  drivers/acpi/viot.c                   | 11 ++----
>  drivers/iommu/arm/arm-smmu/arm-smmu.c |  3 +-
>  drivers/iommu/iommu-priv.h            |  7 ++++
>  drivers/iommu/iommu.c                 | 20 +++++------
>  drivers/iommu/mtk_iommu_v1.c          |  2 +-
>  drivers/iommu/of_iommu.c              | 50 ++++++++++-----------------
>  drivers/iommu/tegra-smmu.c            |  2 +-
>  drivers/of/device.c                   | 30 ++++++----------
>  include/acpi/acpi_bus.h               |  3 +-
>  include/linux/iommu.h                 | 15 ++------
>  12 files changed, 65 insertions(+), 133 deletions(-)
>
> --
> 2.39.2.101.g768bb238c484.dirty
>
Jean-Philippe Brucker July 1, 2024, 1:49 p.m. UTC | #2
On Fri, Jun 21, 2024 at 07:46:35PM +0100, Robin Murphy wrote:
> v1: https://lore.kernel.org/linux-iommu/cover.1713523251.git.robin.murphy@arm.com
> 
> Hi all,
> 
> Here's v2 of this little cleanup, with acks and the additional cosmetic
> tweak suggested by Andy. There were some slightly non-trivial changes in
> the rebase so I've left off Jean-Philippe's tested-by from v1, but I've
> given it a quick spin on arm64 ACPI and DT and all seems well still.

virtio-iommu arm64/x86 DT/ACPI still work as well

Tested-by: Jean-Philippe Brucker <jean-philippe@linaro.org>

> 
> Thanks,
> Robin.
> 
> 
> Robin Murphy (4):
>   iommu: Resolve fwspec ops automatically
>   ACPI: Retire acpi_iommu_fwspec_ops()
>   OF: Simplify of_iommu_configure()
>   iommu: Remove iommu_fwspec ops
> 
>  drivers/acpi/arm64/iort.c             | 19 +++-------
>  drivers/acpi/scan.c                   | 36 +++++--------------
>  drivers/acpi/viot.c                   | 11 ++----
>  drivers/iommu/arm/arm-smmu/arm-smmu.c |  3 +-
>  drivers/iommu/iommu-priv.h            |  7 ++++
>  drivers/iommu/iommu.c                 | 20 +++++------
>  drivers/iommu/mtk_iommu_v1.c          |  2 +-
>  drivers/iommu/of_iommu.c              | 50 ++++++++++-----------------
>  drivers/iommu/tegra-smmu.c            |  2 +-
>  drivers/of/device.c                   | 30 ++++++----------
>  include/acpi/acpi_bus.h               |  3 +-
>  include/linux/iommu.h                 | 15 ++------
>  12 files changed, 65 insertions(+), 133 deletions(-)
> 
> -- 
> 2.39.2.101.g768bb238c484.dirty
>
Robin Murphy July 2, 2024, 12:23 p.m. UTC | #3
On 21/06/2024 9:51 pm, Saravana Kannan wrote:
> On Fri, Jun 21, 2024 at 8:46 PM Robin Murphy <robin.murphy@arm.com> wrote:
>>
>> v1: https://lore.kernel.org/linux-iommu/cover.1713523251.git.robin.murphy@arm.com
>>
>> Hi all,
>>
>> Here's v2 of this little cleanup, with acks and the additional cosmetic
>> tweak suggested by Andy. There were some slightly non-trivial changes in
>> the rebase so I've left off Jean-Philippe's tested-by from v1, but I've
>> given it a quick spin on arm64 ACPI and DT and all seems well still.
> 
> Hi Robin,
> 
> I see in this series you talk about figuring out if a device has a
> driver that could match. There has been a "can_match" flag in every
> device that's set if a driver that match it is present, but hasn't
> probed the device yet (for whatever reason). Just pointing that out in
> case that makes things a lot easier for you. As of now, we don't
> handle clearing it when the driver is unregistered, but if that really
> needs to be handled, that shouldn't be too difficult.

Thanks, that's interesting to know. I'm not sure it's directly 
applicable here since we have the more general case where the IOMMU 
driver may also be a module that's not even loaded yet. What ultimately 
matters is whether someone has called iommu_device_register() for a 
matching IOMMU instance, or may do within a reasonable timeframe, so as 
long as we can keep relying on fw_devlink and deferred_probe_timeout to 
do most of the heavy lifting then I'd actually hope we can avoid getting 
into the low-level details here.

Cheers,
Robin.