xenomai.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix flexcan interrupt request not working on non SMP systems
@ 2023-04-03  7:08 Julien Blanc
  2023-04-03  8:04 ` Julien Blanc
  0 siblings, 1 reply; 2+ messages in thread
From: Julien Blanc @ 2023-04-03  7:08 UTC (permalink / raw)
  To: xenomai

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-03  8:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03  7:08 [PATCH] Fix flexcan interrupt request not working on non SMP systems Julien Blanc
2023-04-03  8:04 ` Julien Blanc

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).