Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jul 2021 00:36:24 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 2fc939d71a5f - stable/13 - LinuxKPI: add irq_set_affinity_hint()
Message-ID:  <202107180036.16I0aOWB049084@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=2fc939d71a5fe20e84c18cc9a813a1585a8612cd

commit 2fc939d71a5fe20e84c18cc9a813a1585a8612cd
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2021-05-24 18:14:37 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2021-07-18 00:35:01 +0000

    LinuxKPI: add irq_set_affinity_hint()
    
    Add an implementation for irq_set_affinity_hint() to linux/interrupt.h
    and include linux/hardirq.h for synchronize_irq() as needed by
    wireless drivers.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D30427
    
    (cherry picked from commit 602e4e433d3e7dbb03d4fd30a4720a02cdeca6aa)
---
 sys/compat/linuxkpi/common/include/linux/interrupt.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h
index fc1241240b39..90994a2f2315 100644
--- a/sys/compat/linuxkpi/common/include/linux/interrupt.h
+++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h
@@ -31,12 +31,15 @@
 #ifndef	_LINUX_INTERRUPT_H_
 #define	_LINUX_INTERRUPT_H_
 
+#include <linux/cpu.h>
 #include <linux/device.h>
 #include <linux/pci.h>
 #include <linux/irqreturn.h>
+#include <linux/hardirq.h>
 
 #include <sys/bus.h>
 #include <sys/rman.h>
+#include <sys/interrupt.h>
 
 typedef	irqreturn_t	(*irq_handler_t)(int, void *);
 
@@ -183,6 +186,19 @@ free_irq(unsigned int irq, void *device)
 	kfree(irqe);
 }
 
+static inline int
+irq_set_affinity_hint(int vector, cpumask_t *mask)
+{
+	int error;
+
+	if (mask != NULL)
+		error = intr_setaffinity(vector, CPU_WHICH_IRQ, mask);
+	else
+		error = intr_setaffinity(vector, CPU_WHICH_IRQ, cpuset_root);
+
+	return (-error);
+}
+
 /*
  * LinuxKPI tasklet support
  */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107180036.16I0aOWB049084>