Re: [PATCH] genirq: Provide reverse compat handling for irq_chip methods.

Previous thread: When was ASLR introduced in the Linux kernel? by Victor van der Veen on Tuesday, November 30, 2010 - 4:47 am. (4 messages)

Next thread: [stable] Linux 2.6.32.26+drm33.12 by Stefan Bader on Tuesday, November 30, 2010 - 6:23 am. (1 message)
From: Lennert Buytenhek
Date: Tuesday, November 30, 2010 - 5:08 am

kernel/irq/chip.c provides compat wrappers for when users of the
new-style (->irq_foo()) irq_chip methods try to call into irq_chips
that provide only old-style (->foo()) methods, but doesn't currently
provide compatibility in the other direction.

As there exist chained irq flow handlers outside kernel/irq/ that have
not been converted over to call the new methods yet, this means that
the irq_chips that they are chained off can't be converted to the new
methods yet.

This patch adds reverse compat wrappers, so that old-style flow
handlers can call into new-style irq_chips, too, and the flow handlers
and irq_chips can be converted to the new API independently.

Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
---
 kernel/irq/chip.c |  142 +++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 138 insertions(+), 4 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index baa5c4a..9a73b0e 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -298,15 +298,106 @@ static int compat_irq_retrigger(struct irq_data *data)
 	return data->chip->retrigger(data->irq);
 }
 
-static void compat_bus_lock(struct irq_data *data)
+static void compat_irq_bus_lock(struct irq_data *data)
 {
 	data->chip->bus_lock(data->irq);
 }
 
-static void compat_bus_sync_unlock(struct irq_data *data)
+static void compat_irq_bus_sync_unlock(struct irq_data *data)
 {
 	data->chip->bus_sync_unlock(data->irq);
 }
+
+/* And the other way around */
+static void compat_mask(unsigned int irq)
+{
+	struct irq_data *data = irq_get_irq_data(irq);
+	data->chip->irq_mask(data);
+}
+
+static void compat_unmask(unsigned int irq)
+{
+	struct irq_data *data = irq_get_irq_data(irq);
+	data->chip->irq_unmask(data);
+}
+
+static void compat_ack(unsigned int irq)
+{
+	struct irq_data *data = irq_get_irq_data(irq);
+	data->chip->irq_ack(data);
+}
+
+static void compat_mask_ack(unsigned int irq)
+{
+	struct irq_data *data = ...
From: Yong Zhang
Date: Tuesday, November 30, 2010 - 7:46 pm

On Tue, Nov 30, 2010 at 8:08 PM, Lennert Buytenhek

This looks just going backward.

If someone introduce a new-style irq-chip, but do not change the
related handler function, there will be compiling error if
GENERIC_HARDIRQS_NO_DEPRECATED is set.
So I think it will encourage the user to use the new API.

Thanks,
--

From: Thomas Gleixner
Date: Wednesday, December 1, 2010 - 3:28 am

Uuurg. That's backwards. Why not fixing the flow handlers first ?
 
Thanks,

	tglx
--

Previous thread: When was ASLR introduced in the Linux kernel? by Victor van der Veen on Tuesday, November 30, 2010 - 4:47 am. (4 messages)

Next thread: [stable] Linux 2.6.32.26+drm33.12 by Stefan Bader on Tuesday, November 30, 2010 - 6:23 am. (1 message)