From: Andrew Davis <afd@ti.com>
To: Bjorn Andersson <andersson@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, "Andrew Davis" <afd@ti.com>
Subject: [PATCH] remoteproc: keystone: Request IRQs in probe()
Date: Mon, 2 Mar 2026 14:17:34 -0600 [thread overview]
Message-ID: <20260302201734.320747-1-afd@ti.com> (raw)
IRQs can be registered in probe and only need to be enabled/disabled
during remoteproc start/stop. This lets us catch IRQ issues early
and simplify remoteproc start/stop.
Signed-off-by: Andrew Davis <afd@ti.com>
---
drivers/remoteproc/keystone_remoteproc.c | 41 +++++++++---------------
1 file changed, 15 insertions(+), 26 deletions(-)
diff --git a/drivers/remoteproc/keystone_remoteproc.c b/drivers/remoteproc/keystone_remoteproc.c
index 4d6550b485675..e7fde55097866 100644
--- a/drivers/remoteproc/keystone_remoteproc.c
+++ b/drivers/remoteproc/keystone_remoteproc.c
@@ -173,35 +173,16 @@ static int keystone_rproc_start(struct rproc *rproc)
INIT_WORK(&ksproc->workqueue, handle_event);
- ret = request_irq(ksproc->irq_ring, keystone_rproc_vring_interrupt, 0,
- dev_name(ksproc->dev), ksproc);
- if (ret) {
- dev_err(ksproc->dev, "failed to enable vring interrupt, ret = %d\n",
- ret);
- goto out;
- }
+ enable_irq(ksproc->irq_ring);
+ enable_irq(ksproc->irq_fault);
- ret = request_irq(ksproc->irq_fault, keystone_rproc_exception_interrupt,
- 0, dev_name(ksproc->dev), ksproc);
+ ret = keystone_rproc_dsp_boot(ksproc, rproc->bootaddr);
if (ret) {
- dev_err(ksproc->dev, "failed to enable exception interrupt, ret = %d\n",
- ret);
- goto free_vring_irq;
+ flush_work(&ksproc->workqueue);
+ return ret;
}
- ret = keystone_rproc_dsp_boot(ksproc, rproc->bootaddr);
- if (ret)
- goto free_exc_irq;
-
return 0;
-
-free_exc_irq:
- free_irq(ksproc->irq_fault, ksproc);
-free_vring_irq:
- free_irq(ksproc->irq_ring, ksproc);
- flush_work(&ksproc->workqueue);
-out:
- return ret;
}
/*
@@ -215,8 +196,8 @@ static int keystone_rproc_stop(struct rproc *rproc)
struct keystone_rproc *ksproc = rproc->priv;
keystone_rproc_dsp_reset(ksproc);
- free_irq(ksproc->irq_fault, ksproc);
- free_irq(ksproc->irq_ring, ksproc);
+ disable_irq(ksproc->irq_fault);
+ disable_irq(ksproc->irq_ring);
flush_work(&ksproc->workqueue);
return 0;
@@ -427,10 +408,18 @@ static int keystone_rproc_probe(struct platform_device *pdev)
ksproc->irq_ring = platform_get_irq_byname(pdev, "vring");
if (ksproc->irq_ring < 0)
return ksproc->irq_ring;
+ ret = devm_request_irq(dev, ksproc->irq_ring, keystone_rproc_vring_interrupt,
+ IRQF_NO_AUTOEN, dev_name(dev), ksproc);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to request vring interrupt\n");
ksproc->irq_fault = platform_get_irq_byname(pdev, "exception");
if (ksproc->irq_fault < 0)
return ksproc->irq_fault;
+ ret = devm_request_irq(dev, ksproc->irq_fault, keystone_rproc_exception_interrupt,
+ IRQF_NO_AUTOEN, dev_name(dev), ksproc);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to enable exception interrupt\n");
ksproc->kick_gpio = devm_gpiod_get(dev, "kick", GPIOD_ASIS);
ret = PTR_ERR_OR_ZERO(ksproc->kick_gpio);
--
2.39.2
next reply other threads:[~2026-03-02 20:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-02 20:17 Andrew Davis [this message]
2026-03-06 17:19 ` [PATCH] remoteproc: keystone: Request IRQs in probe() Mathieu Poirier
2026-03-06 17:29 ` Andrew Davis
2026-03-09 14:26 ` Mathieu Poirier
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=20260302201734.320747-1-afd@ti.com \
--to=afd@ti.com \
--cc=andersson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox