linux/kernel/irq/spurious.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) 1992, 1998-2004 Linus Torvalds, Ingo Molnar
 *
 * This file contains spurious interrupt handling.
 */

#include <linux/jiffies.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/moduleparam.h>
#include <linux/timer.h>

#include "internals.h"

static int irqfixup __read_mostly;

#define POLL_SPURIOUS_IRQ_INTERVAL
static void poll_spurious_irqs(struct timer_list *unused);
static DEFINE_TIMER(poll_spurious_irq_timer, poll_spurious_irqs);
static int irq_poll_cpu;
static atomic_t irq_poll_active;

/*
 * We wait here for a poller to finish.
 *
 * If the poll runs on this CPU, then we yell loudly and return
 * false. That will leave the interrupt line disabled in the worst
 * case, but it should never happen.
 *
 * We wait until the poller is done and then recheck disabled and
 * action (about to be disabled). Only if it's still active, we return
 * true and let the handler run.
 */
bool irq_wait_for_poll(struct irq_desc *desc)
	__must_hold(&desc->lock)
{}


/*
 * Recovery handler for misrouted interrupts.
 */
static int try_one_irq(struct irq_desc *desc, bool force)
{}

static int misrouted_irq(int irq)
{}

static void poll_spurious_irqs(struct timer_list *unused)
{}

static inline int bad_action_ret(irqreturn_t action_ret)
{}

/*
 * If 99,900 of the previous 100,000 interrupts have not been handled
 * then assume that the IRQ is stuck in some manner. Drop a diagnostic
 * and try to turn the IRQ off.
 *
 * (The other 100-of-100,000 interrupts may have been a correctly
 *  functioning device sharing an IRQ with the failing one)
 */
static void __report_bad_irq(struct irq_desc *desc, irqreturn_t action_ret)
{}

static void report_bad_irq(struct irq_desc *desc, irqreturn_t action_ret)
{}

static inline int
try_misrouted_irq(unsigned int irq, struct irq_desc *desc,
		  irqreturn_t action_ret)
{}

#define SPURIOUS_DEFERRED

void note_interrupt(struct irq_desc *desc, irqreturn_t action_ret)
{}

bool noirqdebug __read_mostly;

int noirqdebug_setup(char *str)
{}

__setup();
module_param(noirqdebug, bool, 0644);
MODULE_PARM_DESC();

static int __init irqfixup_setup(char *str)
{}

__setup();
module_param(irqfixup, int, 0644);

static int __init irqpoll_setup(char *str)
{}

__setup();