Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1637413
| Path | csiph.com!news.freedyn.net!open-news-network.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Geetha Akula <geethasowjanya.akula@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 6/7] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126 |
| Date | Mon, 08 May 2017 14:10:02 +0200 |
| Message-ID | <tEPEd-3LB-5@gated-at.bofh.it> (permalink) |
| References | <tDLW2-2wh-37@gated-at.bofh.it> <tEP1v-3ge-5@gated-at.bofh.it> <tEP1v-3ge-3@gated-at.bofh.it> |
| X-Original-To | Robin Murphy <robin.murphy@arm.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qN3K0YyBvKI+8+1PMkd0amD0WF7gwtqvE8yeNrvevRA=; b=cN2w/3R5ECCsgw9tnGz1MdrUepBi/F5+PCKSlKTE+5/ObjCJQTkS95mp3aAWDAutSL HXMi9xZ1kktLJZSgJWm2KLeZ/Vf52T5TIm6ISgRQs86G0izgxPNsu/+9ZHRTts8sxny8 Z5iYnVlNUceqVWFQIYhN2UOFj1yywkLx0JnrPKP61jbkCVlFToLTXc8XCut9jsxZ3Ps1 Q4/HzrinjgLTTRMZwgZDQQ23gA7aAtcK0L1jI/thLZ4CUydF8La1FJHaAjzBf7wcr6iO pldAQ29PE4nRUTl2NhyKA8SzbTrT+rJXrGXfaHgeoawkm+JxHl+tlE5rSl5qbPEcyBd1 duhQ== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qN3K0YyBvKI+8+1PMkd0amD0WF7gwtqvE8yeNrvevRA=; b=dUBoXCV3Vxyzn8vUTv3B+lJJ1kWA6Ix9kNWXHIowyDkocefCd1mZ6bXF/h70xXwu7Z n/PMLYO3yJIE9dXimyQ388jXKsY4nQo1DHtBalpHzjdsL3ytm9ro8QZuctRcfvCIo3BW Ai3V6wL962ajZMNzb/r5Gq9Fu2WqmEgnr6xXCuvaiqZL3rg/Vg4qrg8fLFcPfsoQI1Jm spAOkAjve0fydGnkmZkpsvSoRPHkyuGI1iyQg+sU76kfcs0wn8J+yjM4RSdoQ/qN9AIf KreerX1SLCYaYDUZMacTKqsbNjPRC/B9Xe9wY6vu+CSFdG7rnZzZCLLT6RyjF32UmTMs SU/g== |
| X-Gm-Message-State | AODbwcBmKlDW3SDuEI6FahLhr/0H4S2l1tCI3nSB6YOdBEoqqh9nU/5w r5g0GaOVJ3NxuccOkM0mLKChHogF1w== |
| X-Received | by 10.46.69.8 with SMTP id s8mr6015341lja.55.1494244955305; Mon, 08 May 2017 05:02:35 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 124 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Geetha sowjanya <gakula@caviumnetworks.com>, Will Deacon <will.deacon@arm.com>, lorenzo.pieralisi@arm.com, Hanjun Guo <hanjun.guo@linaro.org>, sudeep.holla@arm.com, iommu@lists.linux-foundation.org, jcm@redhat.com, linux-kernel@vger.kernel.org, Robert Richter <robert.richter@cavium.com>, catalin.marinas@arm.com, Sunil Goutham <sgoutham@cavium.com>, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, Linu Cherian <linu.cherian@cavium.com>, Geetha Sowjanya <geethasowjanya.akula@cavium.com> |
| X-Original-Date | Mon, 8 May 2017 17:32:34 +0530 |
| X-Original-Message-ID | <CANHdaiaw4sB+bMY8LcyQGXbnAfKNk5zX6_893M0gqKrVNmeFuQ@mail.gmail.com> |
| X-Original-References | <1493986091-30521-1-git-send-email-gakula@caviumnetworks.com> <1493986091-30521-7-git-send-email-gakula@caviumnetworks.com> <a2618ab6-6609-7885-3b62-c1c1f170c318@arm.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1637413 |
Show key headers only | View raw
On Mon, May 8, 2017 at 4:51 PM, Robin Murphy <robin.murphy@arm.com> wrote:
> On 05/05/17 13:08, 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>
>> ---
>> drivers/iommu/arm-smmu-v3.c | 32 ++++++++++++++++++++++++++++----
>> 1 file changed, 28 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
>> index 016b702..46428e7 100644
>> --- a/drivers/iommu/arm-smmu-v3.c
>> +++ b/drivers/iommu/arm-smmu-v3.c
>> @@ -2236,10 +2236,30 @@ 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 0;
>
> I'd say just have this return IRQF_ONESHOT in the non-shared case...
>
>> +}
>> +
>> static int arm_smmu_setup_irqs(struct arm_smmu_device *smmu)
>> {
>> int ret, irq;
>> u32 irqen_flags = IRQ_CTRL_EVTQ_IRQEN | IRQ_CTRL_GERROR_IRQEN;
>> + u32 irqflags = 0;
>>
>> /* Disable IRQs first */
>> ret = arm_smmu_write_reg_sync(smmu, 0, ARM_SMMU_IRQ_CTRL,
>> @@ -2254,9 +2274,10 @@ static int arm_smmu_setup_irqs(struct arm_smmu_device *smmu)
>> /* Request interrupt lines */
>> irq = smmu->evtq.q.irq;
>> if (irq) {
>> + irqflags = get_irq_flags(smmu, irq);
>> ret = devm_request_threaded_irq(smmu->dev, irq, NULL,
>> arm_smmu_evtq_thread,
>> - IRQF_ONESHOT,
>> + IRQF_ONESHOT | irqflags,
>
> ...and pass get_irq_flags(smmu, irq) directly as the argument here.
>
> The local variable and intermediate logic only seem to add unnecessary
> complexity, given that the two cases we actually end up with are:
>
> IRQF_ONESHOT | 0
>
> vs.
>
> IRQF_ONESHOT | IRQF_SHARED | IRQF_ONESHOT
>
> neither of which looks particularly sensible.
>
> Robin.
>
I will resubmit the patch with suggested changes.
Thank you,
Geetha.
>> "arm-smmu-v3-evtq", smmu);
>> if (ret < 0)
>> dev_warn(smmu->dev, "failed to enable evtq irq\n");
>> @@ -2264,8 +2285,9 @@ static int arm_smmu_setup_irqs(struct arm_smmu_device *smmu)
>>
>> irq = smmu->cmdq.q.irq;
>> if (irq) {
>> + irqflags = get_irq_flags(smmu, irq);
>> ret = devm_request_irq(smmu->dev, irq,
>> - arm_smmu_cmdq_sync_handler, 0,
>> + arm_smmu_cmdq_sync_handler, irqflags,
>> "arm-smmu-v3-cmdq-sync", smmu);
>> if (ret < 0)
>> dev_warn(smmu->dev, "failed to enable cmdq-sync irq\n");
>> @@ -2273,8 +2295,9 @@ static int arm_smmu_setup_irqs(struct arm_smmu_device *smmu)
>>
>> irq = smmu->gerr_irq;
>> if (irq) {
>> + irqflags = get_irq_flags(smmu, irq);
>> ret = devm_request_irq(smmu->dev, irq, arm_smmu_gerror_handler,
>> - 0, "arm-smmu-v3-gerror", smmu);
>> + irqflags, "arm-smmu-v3-gerror", smmu);
>> if (ret < 0)
>> dev_warn(smmu->dev, "failed to enable gerror irq\n");
>> }
>> @@ -2282,9 +2305,10 @@ static int arm_smmu_setup_irqs(struct arm_smmu_device *smmu)
>> if (smmu->features & ARM_SMMU_FEAT_PRI) {
>> irq = smmu->priq.q.irq;
>> if (irq) {
>> + irqflags = get_irq_flags(smmu, irq);
>> ret = devm_request_threaded_irq(smmu->dev, irq, NULL,
>> arm_smmu_priq_thread,
>> - IRQF_ONESHOT,
>> + IRQF_ONESHOT | irqflags,
>> "arm-smmu-v3-priq",
>> smmu);
>> if (ret < 0)
>>
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v3 6/7] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126 Robin Murphy <robin.murphy@arm.com> - 2017-05-08 13:30 +0200 Re: [PATCH v3 6/7] iommu/arm-smmu-v3: Add workaround for Cavium ThunderX2 erratum #126 Geetha Akula <geethasowjanya.akula@gmail.com> - 2017-05-08 14:10 +0200
csiph-web