From: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
To: Geetha sowjanya
<gakula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
devel-E0kO6a4B6psdnm+yROfE0A@public.gmane.org,
catalin.marinas-5wv7dgnIgG8@public.gmane.org,
Charles.Garcia-Tobin-5wv7dgnIgG8@public.gmane.org,
geethasowjanya.akula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
jcm-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linu.cherian-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org,
rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org,
robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Geetha Sowjanya
<geethasowjanya.akula-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>,
sudeep.holla-5wv7dgnIgG8@public.gmane.org,
sgoutham-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org,
robert.richter-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org,
lv.zheng-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH v7 3/3] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126
Date: Fri, 9 Jun 2017 11:00:14 +0100 [thread overview]
Message-ID: <20170609100014.GB13955@arm.com> (raw)
In-Reply-To: <1496145821-3411-4-git-send-email-gakula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
Hi Geetha,
On Tue, May 30, 2017 at 05:33:41PM +0530, Geetha sowjanya wrote:
> From: Geetha Sowjanya <geethasowjanya.akula-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
>
> Cavium ThunderX2 SMMU doesn't support MSI and also doesn't have unique irq
> lines for gerror, eventq and cmdq-sync.
>
> This patch addresses the issue by checking if any interrupt sources are
> using same irq number, then they are registered as shared irqs.
>
> Signed-off-by: Geetha Sowjanya <geethasowjanya.akula-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
> ---
> Documentation/arm64/silicon-errata.txt | 1 +
> drivers/iommu/arm-smmu-v3.c | 29 +++++++++++++++++++++++++----
> 2 files changed, 26 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt
> index 4693a32..42422f6 100644
> --- a/Documentation/arm64/silicon-errata.txt
> +++ b/Documentation/arm64/silicon-errata.txt
> @@ -63,6 +63,7 @@ stable kernels.
> | Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 |
> | Cavium | ThunderX SMMUv2 | #27704 | N/A |
> | Cavium | ThunderX2 SMMUv3| #74 | N/A |
> +| Cavium | ThunderX2 SMMUv3| #126 | N/A |
> | | | | |
> | Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
> | | | | |
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 4e80205..d2db01f 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -2232,6 +2232,25 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
> devm_add_action(dev, arm_smmu_free_msis, dev);
> }
>
> +static int get_irq_flags(struct arm_smmu_device *smmu, int irq)
> +{
> + int match_count = 0;
> +
> + if (irq == smmu->evtq.q.irq)
> + match_count++;
> + if (irq == smmu->cmdq.q.irq)
> + match_count++;
> + if (irq == smmu->gerr_irq)
> + match_count++;
> + if (irq == smmu->priq.q.irq)
> + match_count++;
> +
> + if (match_count > 1)
> + return IRQF_SHARED | IRQF_ONESHOT;
> +
> + return IRQF_ONESHOT;
> +}
I really think this is the wrong way of solving the problem: using
IRQF_SHARED has implications elsewhere in the driver (for example, we must
then pass a unique dev_id otherwise freeing the IRQs won't work properly)
and I don't want to have to worry about these constraints just because of
this broken platform.
Please do what I suggested instead: register a single threaded interrupt
handler that acts as a multiplexer and manually calls the other routines.
Will
WARNING: multiple messages have this Message-ID (diff)
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 3/3] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126
Date: Fri, 9 Jun 2017 11:00:14 +0100 [thread overview]
Message-ID: <20170609100014.GB13955@arm.com> (raw)
In-Reply-To: <1496145821-3411-4-git-send-email-gakula@caviumnetworks.com>
Hi Geetha,
On Tue, May 30, 2017 at 05:33:41PM +0530, Geetha sowjanya wrote:
> From: Geetha Sowjanya <geethasowjanya.akula@cavium.com>
>
> Cavium ThunderX2 SMMU doesn't support MSI and also doesn't have unique irq
> lines for gerror, eventq and cmdq-sync.
>
> This patch addresses the issue by checking if any interrupt sources are
> using same irq number, then they are registered as shared irqs.
>
> Signed-off-by: Geetha Sowjanya <geethasowjanya.akula@cavium.com>
> ---
> Documentation/arm64/silicon-errata.txt | 1 +
> drivers/iommu/arm-smmu-v3.c | 29 +++++++++++++++++++++++++----
> 2 files changed, 26 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt
> index 4693a32..42422f6 100644
> --- a/Documentation/arm64/silicon-errata.txt
> +++ b/Documentation/arm64/silicon-errata.txt
> @@ -63,6 +63,7 @@ stable kernels.
> | Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 |
> | Cavium | ThunderX SMMUv2 | #27704 | N/A |
> | Cavium | ThunderX2 SMMUv3| #74 | N/A |
> +| Cavium | ThunderX2 SMMUv3| #126 | N/A |
> | | | | |
> | Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
> | | | | |
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 4e80205..d2db01f 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -2232,6 +2232,25 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
> devm_add_action(dev, arm_smmu_free_msis, dev);
> }
>
> +static int get_irq_flags(struct arm_smmu_device *smmu, int irq)
> +{
> + int match_count = 0;
> +
> + if (irq == smmu->evtq.q.irq)
> + match_count++;
> + if (irq == smmu->cmdq.q.irq)
> + match_count++;
> + if (irq == smmu->gerr_irq)
> + match_count++;
> + if (irq == smmu->priq.q.irq)
> + match_count++;
> +
> + if (match_count > 1)
> + return IRQF_SHARED | IRQF_ONESHOT;
> +
> + return IRQF_ONESHOT;
> +}
I really think this is the wrong way of solving the problem: using
IRQF_SHARED has implications elsewhere in the driver (for example, we must
then pass a unique dev_id otherwise freeing the IRQs won't work properly)
and I don't want to have to worry about these constraints just because of
this broken platform.
Please do what I suggested instead: register a single threaded interrupt
handler that acts as a multiplexer and manually calls the other routines.
Will
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Geetha sowjanya <gakula@caviumnetworks.com>
Cc: robin.murphy@arm.com, lorenzo.pieralisi@arm.com,
hanjun.guo@linaro.org, sudeep.holla@arm.com,
iommu@lists.linux-foundation.org, robert.moore@intel.com,
lv.zheng@intel.com, rjw@rjwysocki.net, jcm@redhat.com,
linux-kernel@vger.kernel.org, robert.richter@cavium.com,
catalin.marinas@arm.com, sgoutham@cavium.com,
linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org,
geethasowjanya.akula@gmail.com, devel@acpica.org,
linu.cherian@cavium.com, Charles.Garcia-Tobin@arm.com,
robh@kernel.org,
Geetha Sowjanya <geethasowjanya.akula@cavium.com>
Subject: Re: [PATCH v7 3/3] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126
Date: Fri, 9 Jun 2017 11:00:14 +0100 [thread overview]
Message-ID: <20170609100014.GB13955@arm.com> (raw)
In-Reply-To: <1496145821-3411-4-git-send-email-gakula@caviumnetworks.com>
Hi Geetha,
On Tue, May 30, 2017 at 05:33:41PM +0530, Geetha sowjanya wrote:
> From: Geetha Sowjanya <geethasowjanya.akula@cavium.com>
>
> Cavium ThunderX2 SMMU doesn't support MSI and also doesn't have unique irq
> lines for gerror, eventq and cmdq-sync.
>
> This patch addresses the issue by checking if any interrupt sources are
> using same irq number, then they are registered as shared irqs.
>
> Signed-off-by: Geetha Sowjanya <geethasowjanya.akula@cavium.com>
> ---
> Documentation/arm64/silicon-errata.txt | 1 +
> drivers/iommu/arm-smmu-v3.c | 29 +++++++++++++++++++++++++----
> 2 files changed, 26 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/arm64/silicon-errata.txt b/Documentation/arm64/silicon-errata.txt
> index 4693a32..42422f6 100644
> --- a/Documentation/arm64/silicon-errata.txt
> +++ b/Documentation/arm64/silicon-errata.txt
> @@ -63,6 +63,7 @@ stable kernels.
> | Cavium | ThunderX Core | #27456 | CAVIUM_ERRATUM_27456 |
> | Cavium | ThunderX SMMUv2 | #27704 | N/A |
> | Cavium | ThunderX2 SMMUv3| #74 | N/A |
> +| Cavium | ThunderX2 SMMUv3| #126 | N/A |
> | | | | |
> | Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 |
> | | | | |
> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
> index 4e80205..d2db01f 100644
> --- a/drivers/iommu/arm-smmu-v3.c
> +++ b/drivers/iommu/arm-smmu-v3.c
> @@ -2232,6 +2232,25 @@ static void arm_smmu_setup_msis(struct arm_smmu_device *smmu)
> devm_add_action(dev, arm_smmu_free_msis, dev);
> }
>
> +static int get_irq_flags(struct arm_smmu_device *smmu, int irq)
> +{
> + int match_count = 0;
> +
> + if (irq == smmu->evtq.q.irq)
> + match_count++;
> + if (irq == smmu->cmdq.q.irq)
> + match_count++;
> + if (irq == smmu->gerr_irq)
> + match_count++;
> + if (irq == smmu->priq.q.irq)
> + match_count++;
> +
> + if (match_count > 1)
> + return IRQF_SHARED | IRQF_ONESHOT;
> +
> + return IRQF_ONESHOT;
> +}
I really think this is the wrong way of solving the problem: using
IRQF_SHARED has implications elsewhere in the driver (for example, we must
then pass a unique dev_id otherwise freeing the IRQs won't work properly)
and I don't want to have to worry about these constraints just because of
this broken platform.
Please do what I suggested instead: register a single threaded interrupt
handler that acts as a multiplexer and manually calls the other routines.
Will
next prev parent reply other threads:[~2017-06-09 10:00 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-30 12:03 [PATCH v7 0/3] Cavium ThunderX2 SMMUv3 errata workarounds Geetha sowjanya
2017-05-30 12:03 ` Geetha sowjanya
2017-05-30 12:03 ` [PATCH v7 1/3] ACPI/IORT: Fixup SMMUv3 resource size for Cavium ThunderX2 SMMUv3 model Geetha sowjanya
2017-05-30 12:03 ` Geetha sowjanya
2017-06-08 8:58 ` [Devel] " Lorenzo Pieralisi
2017-06-08 8:58 ` Lorenzo Pieralisi
2017-06-08 8:58 ` Lorenzo Pieralisi
2017-06-08 8:58 ` Lorenzo Pieralisi
2017-06-09 6:00 ` Geetha Akula
2017-06-09 6:00 ` Geetha Akula
2017-06-09 6:00 ` Geetha Akula
[not found] ` <1496145821-3411-2-git-send-email-gakula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2017-06-20 8:19 ` Robert Richter
2017-06-20 8:19 ` Robert Richter
2017-06-20 8:19 ` Robert Richter
[not found] ` <20170620081943.GT658-vWBEXY7mpu582hYKe6nXyg@public.gmane.org>
2017-06-20 8:51 ` Robert Richter
2017-06-20 8:51 ` Robert Richter
2017-06-20 8:51 ` Robert Richter
2017-05-30 12:03 ` [PATCH v7 2/3] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #74 Geetha sowjanya
2017-05-30 12:03 ` Geetha sowjanya
[not found] ` <1496145821-3411-3-git-send-email-gakula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2017-06-09 10:28 ` Robin Murphy
2017-06-09 10:28 ` Robin Murphy
2017-06-09 10:28 ` Robin Murphy
[not found] ` <CA+7sy7C_44dTy0-nAE=b5BCXmc8ACQx2O6A1jCOCsemZDD5j4w@mail.gmail.com>
[not found] ` <CA+7sy7C_44dTy0-nAE=b5BCXmc8ACQx2O6A1jCOCsemZDD5j4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-09 11:38 ` Fwd: " Jayachandran C
2017-06-09 11:38 ` Jayachandran C
2017-06-09 11:38 ` Jayachandran C
2017-06-09 15:43 ` Robin Murphy
2017-06-09 15:43 ` Robin Murphy
[not found] ` <ee0fb6c3-1c5c-f6d1-b063-ead8102d0c67-5wv7dgnIgG8@public.gmane.org>
2017-06-12 8:12 ` Jayachandran C
2017-06-12 8:12 ` Jayachandran C
2017-06-12 8:12 ` Jayachandran C
[not found] ` <1496145821-3411-1-git-send-email-gakula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2017-05-30 12:03 ` [PATCH v7 3/3] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126 Geetha sowjanya
2017-05-30 12:03 ` Geetha sowjanya
2017-05-30 12:03 ` Geetha sowjanya
[not found] ` <1496145821-3411-4-git-send-email-gakula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
2017-06-06 11:03 ` John Garry
2017-06-06 11:03 ` John Garry
2017-06-06 11:03 ` John Garry
2017-06-09 10:00 ` Will Deacon [this message]
2017-06-09 10:00 ` Will Deacon
2017-06-09 10:00 ` Will Deacon
2017-05-30 14:11 ` [PATCH v7 0/3] Cavium ThunderX2 SMMUv3 errata workarounds Robert Richter
2017-05-30 14:11 ` Robert Richter
2017-06-08 16:32 ` [Devel] " Lorenzo Pieralisi
2017-06-08 16:32 ` Lorenzo Pieralisi
2017-06-08 16:32 ` Lorenzo Pieralisi
2017-06-08 17:13 ` [Devel] " Rafael J. Wysocki
2017-06-08 17:13 ` Rafael J. Wysocki
2017-06-08 17:13 ` Rafael J. Wysocki
2017-06-08 17:13 ` Rafael J. Wysocki
2017-06-08 17:22 ` Robin Murphy
2017-06-08 17:22 ` Robin Murphy
2017-06-08 17:22 ` Robin Murphy
-- strict thread matches above, loose matches on Subject: below --
2017-06-13 11:51 [Devel] " Lorenzo Pieralisi
2017-06-13 11:51 ` Lorenzo Pieralisi
2017-06-13 11:51 ` Lorenzo Pieralisi
2017-06-13 11:51 ` Lorenzo Pieralisi
2017-06-20 10:31 [Devel] [PATCH v7 1/3] ACPI/IORT: Fixup SMMUv3 resource size for Cavium ThunderX2 SMMUv3 model Lorenzo Pieralisi
2017-06-20 10:31 ` Lorenzo Pieralisi
2017-06-20 10:31 ` Lorenzo Pieralisi
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=20170609100014.GB13955@arm.com \
--to=will.deacon-5wv7dgnigg8@public.gmane.org \
--cc=Charles.Garcia-Tobin-5wv7dgnIgG8@public.gmane.org \
--cc=catalin.marinas-5wv7dgnIgG8@public.gmane.org \
--cc=devel-E0kO6a4B6psdnm+yROfE0A@public.gmane.org \
--cc=gakula-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org \
--cc=geethasowjanya.akula-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=geethasowjanya.akula-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jcm-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linu.cherian-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lv.zheng-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=rjw-LthD3rsA81gm4RdzfppkhA@public.gmane.org \
--cc=robert.moore-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=robert.richter-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=sgoutham-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org \
--cc=sudeep.holla-5wv7dgnIgG8@public.gmane.org \
/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: link
Be 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.