login
Header Space

 
 

Re: [PATCH 0/9] Remove 'irq' argument from all irq handlers

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Thomas Gleixner <tglx@...>
Cc: Jeff Garzik <jeff@...>, LKML <linux-kernel@...>, Ingo Molnar <mingo@...>
Date: Friday, October 19, 2007 - 2:38 pm

Thomas Gleixner <tglx@linutronix.de> writes:


Yes.  keeping this alive is good.

The practical question is how do we make this change without breaking
the drivers that use their irq argument.


There are two problems with that suggestion.
- We don't have all of the architectures converted.
- We don't have a solid plan for how to keep drivers that are
  using the irq parameter today working.

I don't think the irq argument is something we want to keep
around forever, and I certainly don't see the need to do
the error prone get_irqfunc_irq and set_irqfunc_irq logic.

How about:

irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action)
{
	irqreturn_t ret, retval = IRQ_NONE;
	unsigned int status = 0;

	handle_dynamic_tick(action);

	if (!(action->flags & IRQF_DISABLED))
		local_irq_enable_in_hardirq();

	do {
		if (action->flags & IRQF_VERBOSE)
			ret = action->handler_verbose(irq, action->dev_id);
		else
                	ret = action->handler(action->dev_id);
		if (ret == IRQ_HANDLED)
			status |= action->flags;
		retval |= ret;
		action = action->next;
	} while (action);

	if (status & IRQF_SAMPLE_RANDOM)
		add_interrupt_randomness(irq);
	local_irq_disable();

	return retval;
}

And then:

typedef irqreturn_t (*irq_handler_verbose_t)(int, void *);
typedef irqreturn_t (*irq_handler_t)(void *);

struct irqaction {
	union {
		irq_handler_verbose_t handler_verbose;
		irq_handler_t handler;
        };
	unsigned long flags;
	cpumask_t mask;
	const char *name;
	void *dev_id;
	struct irqaction *next;
	int irq;
	struct proc_dir_entry *dir;
};

int request_irq(unsigned int irq, irq_handler_t handler,
		unsigned long irqflags, const char *devname, void *dev_id)

int request_verbose_irq(unsigned int irq, irq_handler_verbose_t handler,
		unsigned long irqflags, const char *devname, void *dev_id)

Then we just need to go through all of the drivers and either change
their interrupt handler prototype or change the flavor of request_irq.

It is a bit of a pain but we should be able to do that without breaking
any drivers.  Which it looks like we are in real danger of if someone
goes through them all interrupt handlers that are using the irq
argument and change them all at once.  Especially since most of those
drivers are old an rarely used right now.

Eric
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 0/9] Remove 'irq' argument from all irq handlers, Thomas Gleixner, (Fri Oct 19, 10:53 am)
Re: [PATCH 0/9] Remove 'irq' argument from all irq handlers, Eric W. Biederman, (Fri Oct 19, 2:38 pm)
Re: [PATCH 0/9] Remove 'irq' argument from all irq handlers, Eric W. Biederman, (Fri Oct 19, 3:35 pm)
Re: [PATCH 0/9] Remove 'irq' argument from all irq handlers, Thomas Gleixner, (Fri Oct 19, 3:41 pm)
[PATCH 8/9] irq-remove: driver trivial, Jeff Garzik, (Fri Oct 19, 3:58 am)
[PATCH 9/9] irq-remove: misc fixes and cleanups, Jeff Garzik, (Fri Oct 19, 3:59 am)
[PATCH 5/9] irq-remove: net driver trivial, Jeff Garzik, (Fri Oct 19, 3:57 am)
[PATCH 6/9] irq-remove: sound driver trivial, Jeff Garzik, (Fri Oct 19, 3:57 am)
[PATCH 7/9] irq-remove: scsi driver trivial, Jeff Garzik, (Fri Oct 19, 3:58 am)
RE: [PATCH 7/9] irq-remove: scsi driver trivial, Salyzyn, Mark, (Fri Oct 19, 9:00 am)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Andrew Morton, (Fri Oct 26, 5:35 pm)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Jeff Garzik, (Fri Oct 26, 5:47 pm)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Arjan van de Ven, (Fri Oct 26, 7:50 pm)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Jeff Garzik, (Fri Oct 26, 8:12 pm)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Arjan van de Ven, (Fri Oct 26, 8:16 pm)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Jeff Garzik, (Fri Oct 26, 8:37 pm)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Arjan van de Ven, (Sat Oct 27, 1:31 am)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Jeff Garzik, (Sat Oct 27, 3:06 am)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Eric W. Biederman, (Sat Oct 27, 3:46 am)
Re: [PATCH 7/9] irq-remove: scsi driver trivial, Arjan van de Ven, (Sat Oct 27, 10:17 am)
[PATCH 4/9] irq-remove: driver non-trivial, Jeff Garzik, (Fri Oct 19, 3:56 am)
Re: [PATCH 4/9] irq-remove: driver non-trivial, Eric W. Biederman, (Fri Oct 19, 2:19 pm)
Re: [PATCH 4/9] irq-remove: driver non-trivial, Jeff Garzik, (Fri Oct 19, 2:36 pm)
[PATCH 3/9] irq-remove: arch trivial, Jeff Garzik, (Fri Oct 19, 3:56 am)
[PATCH 2/9] irq-remove: arch non-trivial, Jeff Garzik, (Fri Oct 19, 3:55 am)
Re: [PATCH 2/9] irq-remove: arch non-trivial, Eric W. Biederman, (Fri Oct 19, 1:11 pm)
Re: [PATCH 2/9] irq-remove: arch non-trivial, Jeff Garzik, (Fri Oct 19, 1:16 pm)
Re: [PATCH 2/9] irq-remove: arch non-trivial, Eric W. Biederman, (Fri Oct 19, 3:38 pm)
Re: [PATCH 2/9] irq-remove: arch non-trivial, Jeremy Fitzhardinge, (Fri Oct 19, 12:54 pm)
Re: [PATCH 2/9] irq-remove: arch non-trivial, Jeff Garzik, (Fri Oct 19, 1:50 pm)
Re: [PATCH 2/9] irq-remove: arch non-trivial, Jeff Garzik, (Fri Oct 19, 1:31 pm)
[PATCH 1/9] irq-remove: core, Jeff Garzik, (Fri Oct 19, 3:55 am)
Re: [PATCH 1/9] irq-remove: core, Eric W. Biederman, (Fri Oct 19, 2:04 pm)
Re: [PATCH 1/9] irq-remove: core, Jeff Garzik, (Fri Oct 19, 2:21 pm)
Re: [PATCH 1/9] irq-remove: core, Eric W. Biederman, (Fri Oct 19, 3:50 pm)
Re: [PATCH 1/9] irq-remove: core, Jeff Garzik, (Fri Oct 19, 3:58 pm)
Re: [PATCH 1/9] irq-remove: core, Eric W. Biederman, (Fri Oct 19, 7:13 pm)
Re: [PATCH 1/9] irq-remove: core, Jeff Garzik, (Fri Oct 19, 7:53 pm)
Re: [PATCH 1/9] irq-remove: core, Jeff Garzik, (Fri Oct 19, 7:46 pm)
Re: [PATCH 1/9] irq-remove: core, Eric W. Biederman, (Fri Oct 19, 1:27 pm)
Re: [PATCH 1/9] irq-remove: core, Jeff Garzik, (Fri Oct 19, 1:48 pm)
speck-geostationary