[PATCH] iommu/arm-smmu-v3, acpi: Add temporary Cavium SMMU-V3 IORT model number definitions

From: Robert Richter
Date: Fri Jun 23 2017 - 01:00:02 EST


On 23.06.17 06:55:41, Robert Richter wrote:
> On 22.06.17 22:04:37, Lorenzo Pieralisi wrote:
> > On Thu, Jun 22, 2017 at 09:35:35PM +0200, Robert Richter wrote:
> > > On 22.06.17 19:58:22, Will Deacon wrote:
> > > > On Thu, Jun 22, 2017 at 07:22:57PM +0100, Will Deacon wrote:
> > > > > On Thu, Jun 22, 2017 at 05:35:35PM +0530, Geetha sowjanya wrote:
> > > > > > Cavium ThunderX2 SMMUv3 implementation has two Silicon Erratas.
> > > > > > 1. Errata ID #74
> > > > > > SMMU register alias Page 1 is not implemented
> > > > > > 2. Errata ID #126
> > > > > > SMMU doesnt support unique IRQ lines and also MSI for gerror,
> > > > > > eventq and cmdq-sync
> > > > > >
> > > > > > The following patchset does software workaround for these two erratas.
> > > > >
> > > > > I've picked up the first two patches, and left comments on the final patch.
> > > >
> > > > ... except that it doesn't build:
> > > >
> > > >
> > > > drivers/acpi/arm64/iort.c: In function âarm_smmu_v3_resource_sizeâ:
> > > > drivers/acpi/arm64/iort.c:837:21: error: âACPI_IORT_SMMU_V3_CAVIUM_CN99XXâ undeclared (first use in this function)
> > > > if (smmu->model == ACPI_IORT_SMMU_V3_CAVIUM_CN99XX)
> > > > ^
> > > > drivers/acpi/arm64/iort.c:837:21: note: each undeclared identifier is reported only once for each function it appears in
> > > > make[4]: *** [drivers/acpi/arm64/iort.o] Error 1
> > > >
> > > >
> > > > I don't see ACPI_IORT_SMMU_V3_CAVIUM_CN99XX defined, even in linux-next.
> > > >
> > > > What's the plan here?
> > >
> > > It is defined already in acpica and we actually waiting for the acpi
> > > maintainers to include it:
> > >
> > > https://github.com/acpica/acpica/commit/d00a4eb86e64
> > >
> > > We could add
> > >
> > > /* Until ACPICA headers cover IORT rev. C */
> > > #ifndef ACPI_IORT_SMMU_V3_CAVIUM_CN99XX
> > > #define ACPI_IORT_SMMU_V3_CAVIUM_CN99XX 0x2
> > > #endif
> > >
> > > to both files:
> > >
> > > drivers/acpi/arm64/iort.c
> > > drivers/iommu/arm-smmu-v3.c
> > >
> >
> > I thought it was a solved problem (and that the IORT patch was based
> > on Robin's workaround) but I was clearly wrong and I apologise to
> > Will about this.
> >
> > FWIW, you could add the define in include/linux/acpi_iort.h and I will
> > remove it whenever ACPICA changes make it into the kernel.
>
> Adding it there will still let depend us on acpi maintainers, while I
> think the over 2 files might go through arm64 tree smoothly. A change
> in acpi_iort.h also adds the definition to other archs and I don't
> think that adding arch #ifdefs to avoid that are welcome in that
> header file too.
>
> I am going to resend my patch below with an improved wording.

Here it comes: