Re: [RFC PATCH v2 00/15] ACPI IORT ARM SMMU v3 support

2016-06-21 Thread Hanjun Guo

On 2016/6/21 22:27, Lorenzo Pieralisi wrote:

Hi Hanjun,

On Tue, Jun 21, 2016 at 06:37:17PM +0800, Hanjun Guo wrote:

Hi Lorenzo,

On 2016/6/7 21:30, Lorenzo Pieralisi wrote:

This RFC patch series is v2 of a previous posting:

https://lkml.org/lkml/2016/4/14/702

v1 -> v2:
- Rebased on top of dependencies series [1][2][3](v4.7-rc1)
- Removed IOMMU fwnode generalization
- Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
  owing to patch series dependencies [1]
- Moved platform device creation logic to IORT code to
  generalize its usage for ARM SMMU v1-v2-v3 components
- Removed reliance on ACPI early device probing
- Created IORT specific iommu_xlate() translation hook leaving
  OF code unchanged according to v1 reviews

The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, available through [2]:

this patchset enables ARM SMMU v3 support on ACPI systems.


I'm trying to test your patches on D03 (SMMUv3 based) but ...


What do you mean by "I am trying.." :), have you actually tested
this series ?


I was rebasing this series on top of Tomasz's latest ITS patchset,
and found that patch 1~2,5 are not needed, and also have conflicts
(expected), so I think it's better to wait for the updated version
from you :)




[...]

[1] R.Murphy "Generic DT bindings for PCI and ARM SMMU v3"
   http://marc.info/?l=linux-arm-kernel=146497432413816=2


...This patch set is still in discussion and seems not work
for non-PCI devices.


Can you be more specific please ? Yes, both series are work
in progress.


[2] T.Nowicki "Introduce ACPI world to ITS irqchip" v5
   http://marc.info/?l=linux-acpi=146469369703684=2


Tomasz sent out the v7 and included patches in your series.

I think a updated version before the test makes sense, what
do you think? Let me know your thoughts.


I am working with Robin so that the xlate() mechanism works
properly and seamlessly for both DT and ACPI, given the
dependencies I think it makes more sense to wait for Tomasz
and Robin patches to get merged or at least stabilize before
doing anything else, I am curently working on a v3.


OK.

Thanks
Hanjun


Re: [RFC PATCH v2 00/15] ACPI IORT ARM SMMU v3 support

2016-06-21 Thread Hanjun Guo

On 2016/6/21 22:27, Lorenzo Pieralisi wrote:

Hi Hanjun,

On Tue, Jun 21, 2016 at 06:37:17PM +0800, Hanjun Guo wrote:

Hi Lorenzo,

On 2016/6/7 21:30, Lorenzo Pieralisi wrote:

This RFC patch series is v2 of a previous posting:

https://lkml.org/lkml/2016/4/14/702

v1 -> v2:
- Rebased on top of dependencies series [1][2][3](v4.7-rc1)
- Removed IOMMU fwnode generalization
- Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
  owing to patch series dependencies [1]
- Moved platform device creation logic to IORT code to
  generalize its usage for ARM SMMU v1-v2-v3 components
- Removed reliance on ACPI early device probing
- Created IORT specific iommu_xlate() translation hook leaving
  OF code unchanged according to v1 reviews

The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, available through [2]:

this patchset enables ARM SMMU v3 support on ACPI systems.


I'm trying to test your patches on D03 (SMMUv3 based) but ...


What do you mean by "I am trying.." :), have you actually tested
this series ?


I was rebasing this series on top of Tomasz's latest ITS patchset,
and found that patch 1~2,5 are not needed, and also have conflicts
(expected), so I think it's better to wait for the updated version
from you :)




[...]

[1] R.Murphy "Generic DT bindings for PCI and ARM SMMU v3"
   http://marc.info/?l=linux-arm-kernel=146497432413816=2


...This patch set is still in discussion and seems not work
for non-PCI devices.


Can you be more specific please ? Yes, both series are work
in progress.


[2] T.Nowicki "Introduce ACPI world to ITS irqchip" v5
   http://marc.info/?l=linux-acpi=146469369703684=2


Tomasz sent out the v7 and included patches in your series.

I think a updated version before the test makes sense, what
do you think? Let me know your thoughts.


I am working with Robin so that the xlate() mechanism works
properly and seamlessly for both DT and ACPI, given the
dependencies I think it makes more sense to wait for Tomasz
and Robin patches to get merged or at least stabilize before
doing anything else, I am curently working on a v3.


OK.

Thanks
Hanjun


Re: [RFC PATCH v2 00/15] ACPI IORT ARM SMMU v3 support

2016-06-21 Thread Lorenzo Pieralisi
Hi Hanjun,

On Tue, Jun 21, 2016 at 06:37:17PM +0800, Hanjun Guo wrote:
> Hi Lorenzo,
> 
> On 2016/6/7 21:30, Lorenzo Pieralisi wrote:
> >This RFC patch series is v2 of a previous posting:
> >
> >https://lkml.org/lkml/2016/4/14/702
> >
> >v1 -> v2:
> > - Rebased on top of dependencies series [1][2][3](v4.7-rc1)
> > - Removed IOMMU fwnode generalization
> > - Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
> >   owing to patch series dependencies [1]
> > - Moved platform device creation logic to IORT code to
> >   generalize its usage for ARM SMMU v1-v2-v3 components
> > - Removed reliance on ACPI early device probing
> > - Created IORT specific iommu_xlate() translation hook leaving
> >   OF code unchanged according to v1 reviews
> >
> >The ACPI IORT table provides information that allows instantiating
> >ARM SMMU devices and carrying out id mappings between components on
> >ARM based systems (devices, IOMMUs, interrupt controllers).
> >
> >http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf
> >
> >Building on basic IORT support, available through [2]:
> >
> >this patchset enables ARM SMMU v3 support on ACPI systems.
> 
> I'm trying to test your patches on D03 (SMMUv3 based) but ...

What do you mean by "I am trying.." :), have you actually tested
this series ?

> [...]
> >[1] R.Murphy "Generic DT bindings for PCI and ARM SMMU v3"
> >http://marc.info/?l=linux-arm-kernel=146497432413816=2
> 
> ...This patch set is still in discussion and seems not work
> for non-PCI devices.

Can you be more specific please ? Yes, both series are work
in progress.

> >[2] T.Nowicki "Introduce ACPI world to ITS irqchip" v5
> >http://marc.info/?l=linux-acpi=146469369703684=2
> 
> Tomasz sent out the v7 and included patches in your series.
> 
> I think a updated version before the test makes sense, what
> do you think? Let me know your thoughts.

I am working with Robin so that the xlate() mechanism works
properly and seamlessly for both DT and ACPI, given the
dependencies I think it makes more sense to wait for Tomasz
and Robin patches to get merged or at least stabilize before
doing anything else, I am curently working on a v3.

Thanks,
Lorenzo


Re: [RFC PATCH v2 00/15] ACPI IORT ARM SMMU v3 support

2016-06-21 Thread Lorenzo Pieralisi
Hi Hanjun,

On Tue, Jun 21, 2016 at 06:37:17PM +0800, Hanjun Guo wrote:
> Hi Lorenzo,
> 
> On 2016/6/7 21:30, Lorenzo Pieralisi wrote:
> >This RFC patch series is v2 of a previous posting:
> >
> >https://lkml.org/lkml/2016/4/14/702
> >
> >v1 -> v2:
> > - Rebased on top of dependencies series [1][2][3](v4.7-rc1)
> > - Removed IOMMU fwnode generalization
> > - Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
> >   owing to patch series dependencies [1]
> > - Moved platform device creation logic to IORT code to
> >   generalize its usage for ARM SMMU v1-v2-v3 components
> > - Removed reliance on ACPI early device probing
> > - Created IORT specific iommu_xlate() translation hook leaving
> >   OF code unchanged according to v1 reviews
> >
> >The ACPI IORT table provides information that allows instantiating
> >ARM SMMU devices and carrying out id mappings between components on
> >ARM based systems (devices, IOMMUs, interrupt controllers).
> >
> >http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf
> >
> >Building on basic IORT support, available through [2]:
> >
> >this patchset enables ARM SMMU v3 support on ACPI systems.
> 
> I'm trying to test your patches on D03 (SMMUv3 based) but ...

What do you mean by "I am trying.." :), have you actually tested
this series ?

> [...]
> >[1] R.Murphy "Generic DT bindings for PCI and ARM SMMU v3"
> >http://marc.info/?l=linux-arm-kernel=146497432413816=2
> 
> ...This patch set is still in discussion and seems not work
> for non-PCI devices.

Can you be more specific please ? Yes, both series are work
in progress.

> >[2] T.Nowicki "Introduce ACPI world to ITS irqchip" v5
> >http://marc.info/?l=linux-acpi=146469369703684=2
> 
> Tomasz sent out the v7 and included patches in your series.
> 
> I think a updated version before the test makes sense, what
> do you think? Let me know your thoughts.

I am working with Robin so that the xlate() mechanism works
properly and seamlessly for both DT and ACPI, given the
dependencies I think it makes more sense to wait for Tomasz
and Robin patches to get merged or at least stabilize before
doing anything else, I am curently working on a v3.

Thanks,
Lorenzo


Re: [RFC PATCH v2 00/15] ACPI IORT ARM SMMU v3 support

2016-06-21 Thread Hanjun Guo

Hi Lorenzo,

On 2016/6/7 21:30, Lorenzo Pieralisi wrote:

This RFC patch series is v2 of a previous posting:

https://lkml.org/lkml/2016/4/14/702

v1 -> v2:
- Rebased on top of dependencies series [1][2][3](v4.7-rc1)
- Removed IOMMU fwnode generalization
- Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
  owing to patch series dependencies [1]
- Moved platform device creation logic to IORT code to
  generalize its usage for ARM SMMU v1-v2-v3 components
- Removed reliance on ACPI early device probing
- Created IORT specific iommu_xlate() translation hook leaving
  OF code unchanged according to v1 reviews

The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, available through [2]:

this patchset enables ARM SMMU v3 support on ACPI systems.


I'm trying to test your patches on D03 (SMMUv3 based) but ...

[...]

[1] R.Murphy "Generic DT bindings for PCI and ARM SMMU v3"
http://marc.info/?l=linux-arm-kernel=146497432413816=2


...This patch set is still in discussion and seems not work
for non-PCI devices.



[2] T.Nowicki "Introduce ACPI world to ITS irqchip" v5
http://marc.info/?l=linux-acpi=146469369703684=2


Tomasz sent out the v7 and included patches in your series.

I think a updated version before the test makes sense, what
do you think? Let me know your thoughts.

Thanks
Hanjun


Re: [RFC PATCH v2 00/15] ACPI IORT ARM SMMU v3 support

2016-06-21 Thread Hanjun Guo

Hi Lorenzo,

On 2016/6/7 21:30, Lorenzo Pieralisi wrote:

This RFC patch series is v2 of a previous posting:

https://lkml.org/lkml/2016/4/14/702

v1 -> v2:
- Rebased on top of dependencies series [1][2][3](v4.7-rc1)
- Removed IOMMU fwnode generalization
- Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
  owing to patch series dependencies [1]
- Moved platform device creation logic to IORT code to
  generalize its usage for ARM SMMU v1-v2-v3 components
- Removed reliance on ACPI early device probing
- Created IORT specific iommu_xlate() translation hook leaving
  OF code unchanged according to v1 reviews

The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, available through [2]:

this patchset enables ARM SMMU v3 support on ACPI systems.


I'm trying to test your patches on D03 (SMMUv3 based) but ...

[...]

[1] R.Murphy "Generic DT bindings for PCI and ARM SMMU v3"
http://marc.info/?l=linux-arm-kernel=146497432413816=2


...This patch set is still in discussion and seems not work
for non-PCI devices.



[2] T.Nowicki "Introduce ACPI world to ITS irqchip" v5
http://marc.info/?l=linux-acpi=146469369703684=2


Tomasz sent out the v7 and included patches in your series.

I think a updated version before the test makes sense, what
do you think? Let me know your thoughts.

Thanks
Hanjun


[RFC PATCH v2 00/15] ACPI IORT ARM SMMU v3 support

2016-06-07 Thread Lorenzo Pieralisi
This RFC patch series is v2 of a previous posting:

https://lkml.org/lkml/2016/4/14/702

v1 -> v2:
- Rebased on top of dependencies series [1][2][3](v4.7-rc1)
- Removed IOMMU fwnode generalization
- Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
  owing to patch series dependencies [1]
- Moved platform device creation logic to IORT code to
  generalize its usage for ARM SMMU v1-v2-v3 components
- Removed reliance on ACPI early device probing
- Created IORT specific iommu_xlate() translation hook leaving
  OF code unchanged according to v1 reviews

The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, available through [2]:

this patchset enables ARM SMMU v3 support on ACPI systems.

Most of the code is aimed at building the required generic ACPI
infrastructure to create and enable IOMMU components and to bring
the IOMMU infrastructure for ACPI on par with DT, which is going to
make future ARM SMMU components easier to integrate.

PATCH (1-2) fix compile warning/errors in [2]

PATCH (3) rework ARM64 IOMMU bus notifier to attach dma_ops.

PATCH (4) provides IORT support for registering IOMMU components.

PATCH (5) adds IORT based look-up for named components.

PATCH (6) improve IORT identifiers mapping API to make it work across
  all possible IORT components.

PATCH (7) provides an IORT function to detect existence of specific type
  of IORT components.

PATCH (8) refactors the ARM SMMU v3 driver so that the init functions are
  split in a way that groups together code that probes through DT
  and code that carries out HW registers FW agnostic probing, in
  preparation for adding the ACPI probing path.

PATCH (9) rework ARM SMMU v3 platform driver registration to make it work on
  ACPI systems.

PATCH (10) creates the kernel infrastructure required to create ARM SMMU
   platform devices for IORT nodes.

PATCH (11) Building on patch (10), it adds ARM SMMU v3 IORT IOMMU operations
   to create and probe ARM SMMU v3 components.

PATCH (12) implements the of_dma_configure() API in ACPI world -
   acpi_dma_configure() - and patches PCI and ACPI core code to start
   making use of it.

PATCH (13) provides IORT infrastructure to carry out IOMMU configuration
   for devices and hook it up to the previously introduced ACPI
   DMA configure API.

PATCH (14) define a function to look-up platform devices through their
   respective IORT nodes stored in platform_data. This patch is
   somewhat controversial and is provided as an initial solution
   to the problem pending further discussions.

PATCH (15) provides code to carry out ACPI IORT based device identifiers
   translation for ARM SMMU v3 components.

This patchset is built on top and depends on these three patch series:

[1] R.Murphy "Generic DT bindings for PCI and ARM SMMU v3"
http://marc.info/?l=linux-arm-kernel=146497432413816=2

[2] T.Nowicki "Introduce ACPI world to ITS irqchip" v5
http://marc.info/?l=linux-acpi=146469369703684=2

[3] T.Nowicki "Support for ARM64 ACPI based PCI host controller" v8
http://marc.info/?l=linux-acpi=146462129816292=2

and is provided for early review/testing purposes here:

git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git 
acpi/iort-smmu-v2

Tested on FVP models for ARM SMMU v3 probing path.

Lorenzo Pieralisi (15):
  drivers: acpi: iort: fix struct pci_dev compiler warnings
  drivers: irqchip: its: fix its_acpi_probe() prototype
  arm64: mm: change IOMMU notifier action to attach DMA ops
  drivers: acpi: iort: add support for IOMMU registration
  drivers: acpi: iort: add support for named component look-up
  drivers: acpi: iort: enhance device identifiers mappings
  drivers: acpi: iort: add node match function
  drivers: acpi: iort: add support for ARM SMMU platform devices
creation
  drivers: iommu: arm-smmu-v3: split probe functions into DT/generic
portions
  drivers: iommu: arm-smmu-v3: enable ACPI driver initialization
  drivers: iommu: arm-smmu-v3: add IORT iommu configuration
  drivers: acpi: implement acpi_dma_configure
  drivers: acpi: iort: introduce iort_iommu_configure
  drivers: acpi: iort: add function to retrieve IOMMU platform devices
  drivers: iommu: arm-smmu-v3: allow ACPI based streamid translation

 arch/arm64/mm/dma-mapping.c  |   2 +-
 drivers/acpi/glue.c  |   4 +-
 drivers/acpi/iort.c  | 361 ++-
 drivers/acpi/scan.c  |  29 
 drivers/iommu/arm-smmu-v3.c  | 235 ++---
 

[RFC PATCH v2 00/15] ACPI IORT ARM SMMU v3 support

2016-06-07 Thread Lorenzo Pieralisi
This RFC patch series is v2 of a previous posting:

https://lkml.org/lkml/2016/4/14/702

v1 -> v2:
- Rebased on top of dependencies series [1][2][3](v4.7-rc1)
- Removed IOMMU fwnode generalization
- Implemented ARM SMMU v3 ACPI probing instead of ARM SMMU v2
  owing to patch series dependencies [1]
- Moved platform device creation logic to IORT code to
  generalize its usage for ARM SMMU v1-v2-v3 components
- Removed reliance on ACPI early device probing
- Created IORT specific iommu_xlate() translation hook leaving
  OF code unchanged according to v1 reviews

The ACPI IORT table provides information that allows instantiating
ARM SMMU devices and carrying out id mappings between components on
ARM based systems (devices, IOMMUs, interrupt controllers).

http://infocenter.arm.com/help/topic/com.arm.doc.den0049b/DEN0049B_IO_Remapping_Table.pdf

Building on basic IORT support, available through [2]:

this patchset enables ARM SMMU v3 support on ACPI systems.

Most of the code is aimed at building the required generic ACPI
infrastructure to create and enable IOMMU components and to bring
the IOMMU infrastructure for ACPI on par with DT, which is going to
make future ARM SMMU components easier to integrate.

PATCH (1-2) fix compile warning/errors in [2]

PATCH (3) rework ARM64 IOMMU bus notifier to attach dma_ops.

PATCH (4) provides IORT support for registering IOMMU components.

PATCH (5) adds IORT based look-up for named components.

PATCH (6) improve IORT identifiers mapping API to make it work across
  all possible IORT components.

PATCH (7) provides an IORT function to detect existence of specific type
  of IORT components.

PATCH (8) refactors the ARM SMMU v3 driver so that the init functions are
  split in a way that groups together code that probes through DT
  and code that carries out HW registers FW agnostic probing, in
  preparation for adding the ACPI probing path.

PATCH (9) rework ARM SMMU v3 platform driver registration to make it work on
  ACPI systems.

PATCH (10) creates the kernel infrastructure required to create ARM SMMU
   platform devices for IORT nodes.

PATCH (11) Building on patch (10), it adds ARM SMMU v3 IORT IOMMU operations
   to create and probe ARM SMMU v3 components.

PATCH (12) implements the of_dma_configure() API in ACPI world -
   acpi_dma_configure() - and patches PCI and ACPI core code to start
   making use of it.

PATCH (13) provides IORT infrastructure to carry out IOMMU configuration
   for devices and hook it up to the previously introduced ACPI
   DMA configure API.

PATCH (14) define a function to look-up platform devices through their
   respective IORT nodes stored in platform_data. This patch is
   somewhat controversial and is provided as an initial solution
   to the problem pending further discussions.

PATCH (15) provides code to carry out ACPI IORT based device identifiers
   translation for ARM SMMU v3 components.

This patchset is built on top and depends on these three patch series:

[1] R.Murphy "Generic DT bindings for PCI and ARM SMMU v3"
http://marc.info/?l=linux-arm-kernel=146497432413816=2

[2] T.Nowicki "Introduce ACPI world to ITS irqchip" v5
http://marc.info/?l=linux-acpi=146469369703684=2

[3] T.Nowicki "Support for ARM64 ACPI based PCI host controller" v8
http://marc.info/?l=linux-acpi=146462129816292=2

and is provided for early review/testing purposes here:

git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git 
acpi/iort-smmu-v2

Tested on FVP models for ARM SMMU v3 probing path.

Lorenzo Pieralisi (15):
  drivers: acpi: iort: fix struct pci_dev compiler warnings
  drivers: irqchip: its: fix its_acpi_probe() prototype
  arm64: mm: change IOMMU notifier action to attach DMA ops
  drivers: acpi: iort: add support for IOMMU registration
  drivers: acpi: iort: add support for named component look-up
  drivers: acpi: iort: enhance device identifiers mappings
  drivers: acpi: iort: add node match function
  drivers: acpi: iort: add support for ARM SMMU platform devices
creation
  drivers: iommu: arm-smmu-v3: split probe functions into DT/generic
portions
  drivers: iommu: arm-smmu-v3: enable ACPI driver initialization
  drivers: iommu: arm-smmu-v3: add IORT iommu configuration
  drivers: acpi: implement acpi_dma_configure
  drivers: acpi: iort: introduce iort_iommu_configure
  drivers: acpi: iort: add function to retrieve IOMMU platform devices
  drivers: iommu: arm-smmu-v3: allow ACPI based streamid translation

 arch/arm64/mm/dma-mapping.c  |   2 +-
 drivers/acpi/glue.c  |   4 +-
 drivers/acpi/iort.c  | 361 ++-
 drivers/acpi/scan.c  |  29 
 drivers/iommu/arm-smmu-v3.c  | 235 ++---