From: shameer <shameerali.kolothum.thodi@huawei.com> To: will.deacon@arm.com, robin.murphy@arm.com, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, hanjun.guo@linaro.org Cc: gabriele.paoloni@huawei.com, john.garry@huawei.com, iommu@lists.linux-foundation.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, devel@acpica.org, linuxarm@huawei.com, wangzhou1@hisilicon.com, guohanjun@huawei.com, shameer <shameerali.kolothum.thodi@huawei.com> Subject: [RFC v1 5/7] iommu/arm-smmu-v3: Enable ACPI based HiSilicon erratum 161010701 Date: Sat, 13 May 2017 10:47:29 +0100 [thread overview] Message-ID: <20170513094731.3676-6-shameerali.kolothum.thodi@huawei.com> (raw) In-Reply-To: <20170513094731.3676-1-shameerali.kolothum.thodi@huawei.com> This uses the ACPI IORT model number to enable the erratum. Signed-off-by: shameer <shameerali.kolothum.thodi@huawei.com> --- drivers/iommu/arm-smmu-v3.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 14538cb..770cc9e 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -652,6 +652,7 @@ struct arm_smmu_domain { enum smmu_erratum_match_type { se_match_dt, + se_match_acpi_iort_model, }; void erratum_skip_prefetch_cmd(struct arm_smmu_device *smmu, void *arg) @@ -674,6 +675,13 @@ static const struct smmu_erratum_workaround smmu_workarounds[] = { .desc_str = "HiSilicon erratum 161010701", .enable = erratum_skip_prefetch_cmd, }, + { + .match_type = se_match_acpi_iort_model, + .id = (void *)ACPI_IORT_SMMU_HISILICON_HI161X, + .desc_str = "HiSilicon erratum 161010701", + .enable = erratum_skip_prefetch_cmd, + }, + #endif { @@ -691,6 +699,15 @@ bool smmu_check_dt_erratum(const struct smmu_erratum_workaround *wa, return of_property_read_bool(np, wa->id); } +static +bool smmu_check_acpi_iort_erratum(const struct smmu_erratum_workaround *wa, + const void *arg) +{ + const struct acpi_iort_smmu_v3 *iort_smmu = arg; + + return (iort_smmu->model == *(u32 *)(&wa->id)) ? true : false; +} + static void smmu_enable_errata(struct arm_smmu_device *smmu, enum smmu_erratum_match_type type, se_match_fn_t match_fn, @@ -724,6 +741,9 @@ static void smmu_check_workarounds(struct arm_smmu_device *smmu, case se_match_dt: match_fn = smmu_check_dt_erratum; break; + case se_match_acpi_iort_model: + match_fn = smmu_check_acpi_iort_erratum; + break; } smmu_enable_errata(smmu, type, match_fn, arg); @@ -2654,6 +2674,8 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev, /* Retrieve SMMUv3 specific data */ iort_smmu = (struct acpi_iort_smmu_v3 *)node->node_data; + smmu_check_workarounds(smmu, se_match_acpi_iort_model, iort_smmu); + if (iort_smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE) smmu->features |= ARM_SMMU_FEAT_COHERENCY; -- 2.5.0
WARNING: multiple messages have this Message-ID (diff)
From: shameerali.kolothum.thodi@huawei.com (shameer) To: linux-arm-kernel@lists.infradead.org Subject: [RFC v1 5/7] iommu/arm-smmu-v3: Enable ACPI based HiSilicon erratum 161010701 Date: Sat, 13 May 2017 10:47:29 +0100 [thread overview] Message-ID: <20170513094731.3676-6-shameerali.kolothum.thodi@huawei.com> (raw) In-Reply-To: <20170513094731.3676-1-shameerali.kolothum.thodi@huawei.com> This uses the ACPI IORT model number to enable the erratum. Signed-off-by: shameer <shameerali.kolothum.thodi@huawei.com> --- drivers/iommu/arm-smmu-v3.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 14538cb..770cc9e 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -652,6 +652,7 @@ struct arm_smmu_domain { enum smmu_erratum_match_type { se_match_dt, + se_match_acpi_iort_model, }; void erratum_skip_prefetch_cmd(struct arm_smmu_device *smmu, void *arg) @@ -674,6 +675,13 @@ static const struct smmu_erratum_workaround smmu_workarounds[] = { .desc_str = "HiSilicon erratum 161010701", .enable = erratum_skip_prefetch_cmd, }, + { + .match_type = se_match_acpi_iort_model, + .id = (void *)ACPI_IORT_SMMU_HISILICON_HI161X, + .desc_str = "HiSilicon erratum 161010701", + .enable = erratum_skip_prefetch_cmd, + }, + #endif { @@ -691,6 +699,15 @@ bool smmu_check_dt_erratum(const struct smmu_erratum_workaround *wa, return of_property_read_bool(np, wa->id); } +static +bool smmu_check_acpi_iort_erratum(const struct smmu_erratum_workaround *wa, + const void *arg) +{ + const struct acpi_iort_smmu_v3 *iort_smmu = arg; + + return (iort_smmu->model == *(u32 *)(&wa->id)) ? true : false; +} + static void smmu_enable_errata(struct arm_smmu_device *smmu, enum smmu_erratum_match_type type, se_match_fn_t match_fn, @@ -724,6 +741,9 @@ static void smmu_check_workarounds(struct arm_smmu_device *smmu, case se_match_dt: match_fn = smmu_check_dt_erratum; break; + case se_match_acpi_iort_model: + match_fn = smmu_check_acpi_iort_erratum; + break; } smmu_enable_errata(smmu, type, match_fn, arg); @@ -2654,6 +2674,8 @@ static int arm_smmu_device_acpi_probe(struct platform_device *pdev, /* Retrieve SMMUv3 specific data */ iort_smmu = (struct acpi_iort_smmu_v3 *)node->node_data; + smmu_check_workarounds(smmu, se_match_acpi_iort_model, iort_smmu); + if (iort_smmu->flags & ACPI_IORT_SMMU_V3_COHACC_OVERRIDE) smmu->features |= ARM_SMMU_FEAT_COHERENCY; -- 2.5.0
next prev parent reply other threads:[~2017-05-13 9:53 UTC|newest] Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top 2017-05-13 9:47 [RFC v1 0/7] iommu/smmu-v3: Workaround for hisilicon 161010801 erratum(reserve HW MSI) shameer 2017-05-13 9:47 ` shameer 2017-05-13 9:47 ` [RFC v1 1/7] iommu/arm-smmu-v3: Add erratum framework structures shameer 2017-05-13 9:47 ` shameer [not found] ` <20170513094731.3676-1-shameerali.kolothum.thodi-hv44wF8Li93QT0dZR+AlfA@public.gmane.org> 2017-05-13 9:47 ` [RFC v1 2/7] iommu/arm-smmu-v3: Add erratum framework functions shameer 2017-05-13 9:47 ` shameer 2017-05-16 13:08 ` Robin Murphy 2017-05-16 13:08 ` Robin Murphy 2017-05-16 13:45 ` Shameerali Kolothum Thodi 2017-05-16 13:45 ` Shameerali Kolothum Thodi 2017-05-13 9:47 ` [RFC v1 6/7] iommu/arm-smmu-v3: Rearrange msi resv alloc functions shameer 2017-05-13 9:47 ` shameer 2017-05-16 13:27 ` Robin Murphy 2017-05-16 13:27 ` Robin Murphy [not found] ` <d2d90929-6e79-70a3-5c82-a25e67931b4a-5wv7dgnIgG8@public.gmane.org> 2017-05-16 13:54 ` Shameerali Kolothum Thodi 2017-05-16 13:54 ` Shameerali Kolothum Thodi 2017-05-13 9:47 ` [RFC v1 3/7] iommu/arm-smmu-v3: Replace the device tree binding for hisilicon broken prefetch cmd with erratum id shameer 2017-05-13 9:47 ` shameer 2017-05-15 15:23 ` Rob Herring 2017-05-15 15:23 ` Rob Herring 2017-05-16 10:15 ` Shameerali Kolothum Thodi 2017-05-16 10:15 ` Shameerali Kolothum Thodi 2017-05-13 9:47 ` [RFC v1 4/7] iommu/arm-smmu-v3: Enable HiSilicon erratum 161010701 shameer 2017-05-13 9:47 ` shameer 2017-05-16 13:13 ` Robin Murphy 2017-05-16 13:13 ` Robin Murphy [not found] ` <6d290334-cb68-5b20-a969-0cc6010922d5-5wv7dgnIgG8@public.gmane.org> 2017-05-16 13:46 ` Shameerali Kolothum Thodi 2017-05-16 13:46 ` Shameerali Kolothum Thodi 2017-05-13 9:47 ` shameer [this message] 2017-05-13 9:47 ` [RFC v1 5/7] iommu/arm-smmu-v3: Enable ACPI based " shameer 2017-05-13 9:47 ` [RFC v1 7/7] iommu/arm-smmu-v3: Enable ACPI based HiSilicon erratum 161010801 shameer 2017-05-13 9:47 ` shameer 2017-05-16 13:50 ` Robin Murphy 2017-05-16 13:50 ` Robin Murphy 2017-05-16 14:03 ` Shameerali Kolothum Thodi 2017-05-16 14:03 ` Shameerali Kolothum Thodi [not found] ` <5FC3163CFD30C246ABAA99954A238FA838350A62-WFPaWmAhWqtUuCJht5byYAK1hpo4iccwjNknBlVQO8k@public.gmane.org> 2017-05-17 8:05 ` John Garry 2017-05-17 8:05 ` John Garry
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20170513094731.3676-6-shameerali.kolothum.thodi@huawei.com \ --to=shameerali.kolothum.thodi@huawei.com \ --cc=devel@acpica.org \ --cc=devicetree@vger.kernel.org \ --cc=gabriele.paoloni@huawei.com \ --cc=guohanjun@huawei.com \ --cc=hanjun.guo@linaro.org \ --cc=iommu@lists.linux-foundation.org \ --cc=john.garry@huawei.com \ --cc=linux-acpi@vger.kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linuxarm@huawei.com \ --cc=lorenzo.pieralisi@arm.com \ --cc=mark.rutland@arm.com \ --cc=robin.murphy@arm.com \ --cc=wangzhou1@hisilicon.com \ --cc=will.deacon@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.