xenomai.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Julien Blanc <julien.blanc@sprinte.eu>
To: "xenomai@lists.linux.dev" <xenomai@lists.linux.dev>
Subject: [PATCH] Fix flexcan interrupt request not working on non SMP systems
Date: Mon, 3 Apr 2023 07:08:49 +0000	[thread overview]
Message-ID: <45c60fcea46516061189dbd840c5af889b94a44c.camel@sprinte.eu> (raw)

irq_set_affinity_hint returns -EINVAL on non-SMP systems. On such
systems, setting the irq affinity is non-sense, so just remove the
call in xnintr_attach (resp. xnintr_detach) if CONFIG_SMP is not defined

Signed-off-by: Julien Blanc <julien.blanc@sprinte.eu>
---
 kernel/cobalt/dovetail/intr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/kernel/cobalt/dovetail/intr.c b/kernel/cobalt/dovetail/intr.c
index a9459b7a8..88116c7c8 100644
--- a/kernel/cobalt/dovetail/intr.c
+++ b/kernel/cobalt/dovetail/intr.c
@@ -100,9 +100,11 @@ int xnintr_attach(struct xnintr *intr, void *cookie, const cpumask_t *cpumask)
                if (cpumask_empty(effective_mask))
                        return -EINVAL;
        }
+#ifdef CONFIG_SMP
        ret = irq_set_affinity_hint(intr->irq, effective_mask);
        if (ret)
                return ret;
+#endif

        return request_irq(intr->irq, xnintr_irq_handler, IRQF_OOB,
                        intr->name, intr);
@@ -112,7 +114,9 @@ EXPORT_SYMBOL_GPL(xnintr_attach);
 void xnintr_detach(struct xnintr *intr)
 {
        secondary_mode_only();
+#ifdef CONFIG_SMP
        irq_set_affinity_hint(intr->irq, NULL);
+#endif
        free_irq(intr->irq, intr);
 }
 EXPORT_SYMBOL_GPL(xnintr_detach);
-- 
2.39.2


             reply	other threads:[~2023-04-03  7:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-03  7:08 Julien Blanc [this message]
2023-04-03  8:04 ` [PATCH] Fix flexcan interrupt request not working on non SMP systems Julien Blanc

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=45c60fcea46516061189dbd840c5af889b94a44c.camel@sprinte.eu \
    --to=julien.blanc@sprinte.eu \
    --cc=xenomai@lists.linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).