Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * Copyright (C) 1992, 1998-2006 Linus Torvalds, Ingo Molnar
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Copyright (C) 2005-2006, Thomas Gleixner, Russell King
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * This file contains the core interrupt handling code. Detailed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * information is available in Documentation/core-api/genericirq.rst
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #include <linux/random.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) #include <linux/interrupt.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) #include <linux/kernel_stat.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) #include <trace/events/irq.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) #include "internals.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) #ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) void (*handle_arch_irq)(struct pt_regs *) __ro_after_init;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * handle_bad_irq - handle spurious and unhandled irqs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  * @desc:      description of the interrupt
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  * Handles spurious and unhandled IRQ's. It also prints a debugmessage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) void handle_bad_irq(struct irq_desc *desc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	unsigned int irq = irq_desc_get_irq(desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	print_irq_desc(irq, desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	kstat_incr_irqs_this_cpu(desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	ack_bad_irq(irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) EXPORT_SYMBOL_GPL(handle_bad_irq);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * Special, empty irq handler:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) irqreturn_t no_action(int cpl, void *dev_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	return IRQ_NONE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) EXPORT_SYMBOL_GPL(no_action);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) static void warn_no_thread(unsigned int irq, struct irqaction *action)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	if (test_and_set_bit(IRQTF_WARNED, &action->thread_flags))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	printk(KERN_WARNING "IRQ %d device %s returned IRQ_WAKE_THREAD "
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 	       "but no thread function available.", irq, action->name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) void __irq_wake_thread(struct irq_desc *desc, struct irqaction *action)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	 * In case the thread crashed and was killed we just pretend that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	 * we handled the interrupt. The hardirq handler has disabled the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	 * device interrupt, so no irq storm is lurking.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	if (action->thread->flags & PF_EXITING)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	 * Wake up the handler thread for this action. If the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 	 * RUNTHREAD bit is already set, nothing to do.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	if (test_and_set_bit(IRQTF_RUNTHREAD, &action->thread_flags))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	 * It's safe to OR the mask lockless here. We have only two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	 * places which write to threads_oneshot: This code and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	 * irq thread.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	 * This code is the hard irq context and can never run on two
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	 * cpus in parallel. If it ever does we have more serious
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	 * problems than this bitmask.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	 * The irq threads of this irq which clear their "running" bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	 * in threads_oneshot are serialized via desc->lock against
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	 * each other and they are serialized against this code by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	 * IRQS_INPROGRESS.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	 * Hard irq handler:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	 *	spin_lock(desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	 *	desc->state |= IRQS_INPROGRESS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	 *	spin_unlock(desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	 *	set_bit(IRQTF_RUNTHREAD, &action->thread_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	 *	desc->threads_oneshot |= mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	 *	spin_lock(desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	 *	desc->state &= ~IRQS_INPROGRESS;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	 *	spin_unlock(desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	 * irq thread:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	 * again:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	 *	spin_lock(desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	 *	if (desc->state & IRQS_INPROGRESS) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	 *		spin_unlock(desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	 *		while(desc->state & IRQS_INPROGRESS)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	 *			cpu_relax();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 	 *		goto again;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	 *	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	 *	if (!test_bit(IRQTF_RUNTHREAD, &action->thread_flags))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	 *		desc->threads_oneshot &= ~mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	 *	spin_unlock(desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 	 *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 	 * So either the thread waits for us to clear IRQS_INPROGRESS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 	 * or we are waiting in the flow handler for desc->lock to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	 * released before we reach this point. The thread also checks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 	 * IRQTF_RUNTHREAD under desc->lock. If set it leaves
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	 * threads_oneshot untouched and runs the thread another time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	desc->threads_oneshot |= action->thread_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	 * We increment the threads_active counter in case we wake up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	 * the irq thread. The irq thread decrements the counter when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	 * it returns from the handler or in the exit path and wakes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 	 * up waiters which are stuck in synchronize_irq() when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	 * active count becomes zero. synchronize_irq() is serialized
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	 * against this code (hard irq handler) via IRQS_INPROGRESS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	 * like the finalize_oneshot() code. See comment above.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 	atomic_inc(&desc->threads_active);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 	wake_up_process(action->thread);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc, unsigned int *flags)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	irqreturn_t retval = IRQ_NONE;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	unsigned int irq = desc->irq_data.irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	struct irqaction *action;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	record_irq_time(desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	for_each_action_of_desc(desc, action) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 		irqreturn_t res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 		/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 		 * If this IRQ would be threaded under force_irqthreads, mark it so.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 		 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 		if (irq_settings_can_thread(desc) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		    !(action->flags & (IRQF_NO_THREAD | IRQF_PERCPU | IRQF_ONESHOT)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 			lockdep_hardirq_threaded();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 		trace_irq_handler_entry(irq, action);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		res = action->handler(irq, action->dev_id);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 		trace_irq_handler_exit(irq, action, res);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 		if (WARN_ONCE(!irqs_disabled(),"irq %u handler %pS enabled interrupts\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 			      irq, action->handler))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 			local_irq_disable();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 		switch (res) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		case IRQ_WAKE_THREAD:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 			 * Catch drivers which return WAKE_THREAD but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 			 * did not set up a thread function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 			if (unlikely(!action->thread_fn)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 				warn_no_thread(irq, action);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 				break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 			__irq_wake_thread(desc, action);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 			fallthrough;	/* to add to randomness */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 		case IRQ_HANDLED:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 			*flags |= action->flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 		retval |= res;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	irqreturn_t retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	unsigned int flags = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	retval = __handle_irq_event_percpu(desc, &flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	add_interrupt_randomness(desc->irq_data.irq, flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	if (!noirqdebug)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 		note_interrupt(desc, retval);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	return retval;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) irqreturn_t handle_irq_event(struct irq_desc *desc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	irqreturn_t ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	desc->istate &= ~IRQS_PENDING;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 	irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 	raw_spin_unlock(&desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	ret = handle_irq_event_percpu(desc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	raw_spin_lock(&desc->lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 	irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	return ret;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) #ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) int __init set_handle_irq(void (*handle_irq)(struct pt_regs *))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	if (handle_arch_irq)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 		return -EBUSY;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	handle_arch_irq = handle_irq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) #endif