Skip to contentSkip to conversation

ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

PATCH New Mark Brown 4 participants 15 messages Nov 25, 2010 – Dec 8, 2010

Subsystems (3)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/3 ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

Kernel 2.6.37 adds new interrupt methods which take a struct irq_data rather than an irq number. Begin converting Samsung platforms over to these methods by converting s3c_irqext_wake() with a simple textual substitution.

---
 arch/arm/mach-s3c64xx/irq-eint.c        |    2 +-
 arch/arm/mach-s5pv310/irq-eint.c        |    2 +-
 arch/arm/plat-s3c24xx/irq.c             |    2 +-
 arch/arm/plat-s5p/irq-eint.c            |    4 ++--
 arch/arm/plat-samsung/include/plat/pm.h |    4 +++-
 arch/arm/plat-samsung/pm.c              |    6 +++---
 6 files changed, 11 insertions(+), 9 deletions(-)
arch/arm/mach-s3c64xx/irq-eint.c +1 -1
index 5682d6a..1a1aa5d 100644
@@ -145,7 +145,7 @@ static struct irq_chip s3c_irq_eint = {
 	.mask_ack	= s3c_irq_eint_maskack,
 	.ack		= s3c_irq_eint_ack,
 	.set_type	= s3c_irq_eint_set_type,
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 };
 
 /* s3c_irq_demux_eint
arch/arm/mach-s5pv310/irq-eint.c +1 -1
index 5877503..f5a415e 100644
@@ -152,7 +152,7 @@ static struct irq_chip s5pv310_irq_eint = {
 	.ack		= s5pv310_irq_eint_ack,
 	.set_type	= s5pv310_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
arch/arm/plat-s3c24xx/irq.c +1 -1
index ad0d44e..91ce383 100644
@@ -238,7 +238,7 @@ static struct irq_chip s3c_irqext_chip = {
 	.unmask		= s3c_irqext_unmask,
 	.ack		= s3c_irqext_ack,
 	.set_type	= s3c_irqext_type,
-	.set_wake	= s3c_irqext_wake
+	.irq_set_wake	= s3c_irqext_wake
 };
 
 static struct irq_chip s3c_irq_eint0t4 = {
arch/arm/plat-s5p/irq-eint.c +2 -2
index 752f1a6..f2f2e1c 100644
@@ -125,7 +125,7 @@ static struct irq_chip s5p_irq_eint = {
 	.ack		= s5p_irq_eint_ack,
 	.set_type	= s5p_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
@@ -194,7 +194,7 @@ static struct irq_chip s5p_irq_vic_eint = {
 	.ack		= s5p_irq_vic_eint_ack,
 	.set_type	= s5p_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
arch/arm/plat-samsung/include/plat/pm.h +3 -1
index 245836d..d9025e3 100644
@@ -15,6 +15,8 @@
  * management
 */
 
+#include <linux/irq.h>
+
 #ifdef CONFIG_PM
 
 extern __init int s3c_pm_init(void);
@@ -100,7 +102,7 @@ extern void s3c_pm_do_restore(struct sleep_save *ptr, int count);
 extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count);
 
 #ifdef CONFIG_PM
-extern int s3c_irqext_wake(unsigned int irqno, unsigned int state);
+extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
 extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
 extern int s3c24xx_irq_resume(struct sys_device *dev);
 #else
arch/arm/plat-samsung/pm.c +3 -3
index 5bf3f2f..02d531f 100644
@@ -136,15 +136,15 @@ static void s3c_pm_restore_uarts(void) { }
 unsigned long s3c_irqwake_intmask	= 0xffffffffL;
 unsigned long s3c_irqwake_eintmask	= 0xffffffffL;
 
-int s3c_irqext_wake(unsigned int irqno, unsigned int state)
+int s3c_irqext_wake(struct irq_data *data, unsigned int state)
 {
-	unsigned long bit = 1L << IRQ_EINT_BIT(irqno);
+	unsigned long bit = 1L << IRQ_EINT_BIT(data->irq);
 
 	if (!(s3c_irqwake_eintallow & bit))
 		return -ENOENT;
 
 	printk(KERN_INFO "wake %s for irq %d\n",
-	       state ? "enabled" : "disabled", irqno);
+	       state ? "enabled" : "disabled", data->irq);
 
 	if (!state)
 		s3c_irqwake_eintmask |= bit;
Signature · 1 line
1.7.1
author
#1 lore raw

PATCH 2/3 ARM: S3C64XX: Convert S3C64xx irq-eint to use new irq_ methods

Kernel 2.6.37 adds new interrupt methods which take a struct irq_data rather than an irq number. Conver S3C64xx irq-eint to use this with a simple textual substitution.

---
 arch/arm/mach-s3c64xx/irq-eint.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)
arch/arm/mach-s3c64xx/irq-eint.c +16 -16
index 1a1aa5d..169ee29 100644
@@ -32,39 +32,39 @@
 #define eint_offset(irq)	((irq) - IRQ_EINT(0))
 #define eint_irq_to_bit(irq)	(1 << eint_offset(irq))
 
-static inline void s3c_irq_eint_mask(unsigned int irq)
+static inline void s3c_irq_eint_mask(struct irq_data *data)
 {
 	u32 mask;
 
 	mask = __raw_readl(S3C64XX_EINT0MASK);
-	mask |= eint_irq_to_bit(irq);
+	mask |= eint_irq_to_bit(data->irq);
 	__raw_writel(mask, S3C64XX_EINT0MASK);
 }
 
-static void s3c_irq_eint_unmask(unsigned int irq)
+static void s3c_irq_eint_unmask(struct irq_data *data)
 {
 	u32 mask;
 
 	mask = __raw_readl(S3C64XX_EINT0MASK);
-	mask &= ~eint_irq_to_bit(irq);
+	mask &= ~eint_irq_to_bit(data->irq);
 	__raw_writel(mask, S3C64XX_EINT0MASK);
 }
 
-static inline void s3c_irq_eint_ack(unsigned int irq)
+static inline void s3c_irq_eint_ack(struct irq_data *data)
 {
-	__raw_writel(eint_irq_to_bit(irq), S3C64XX_EINT0PEND);
+	__raw_writel(eint_irq_to_bit(data->irq), S3C64XX_EINT0PEND);
 }
 
-static void s3c_irq_eint_maskack(unsigned int irq)
+static void s3c_irq_eint_maskack(struct irq_data *data)
 {
 	/* compiler should in-line these */
-	s3c_irq_eint_mask(irq);
-	s3c_irq_eint_ack(irq);
+	s3c_irq_eint_mask(data);
+	s3c_irq_eint_ack(data);
 }
 
-static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
+static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int type)
 {
-	int offs = eint_offset(irq);
+	int offs = eint_offset(data->irq);
 	int pin, pin_val;
 	int shift;
 	u32 ctrl, mask;
@@ -140,11 +140,11 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
 
 static struct irq_chip s3c_irq_eint = {
 	.name		= "s3c-eint",
-	.mask		= s3c_irq_eint_mask,
-	.unmask		= s3c_irq_eint_unmask,
-	.mask_ack	= s3c_irq_eint_maskack,
-	.ack		= s3c_irq_eint_ack,
-	.set_type	= s3c_irq_eint_set_type,
+	.irq_mask	= s3c_irq_eint_mask,
+	.irq_unmask	= s3c_irq_eint_unmask,
+	.irq_mask_ack	= s3c_irq_eint_maskack,
+	.irq_ack	= s3c_irq_eint_ack,
+	.irq_set_type	= s3c_irq_eint_set_type,
 	.irq_set_wake	= s3c_irqext_wake,
 };
 
Signature · 1 line
1.7.1
#2 lore raw

PATCH 2/3 ARM: S3C64XX: Convert S3C64xx irq-eint to use new irq_ methods

Quoted 50 lines · Mark Brown

Kernel 2.6.37 adds new interrupt methods which take a struct irq_data rather than an irq number. Conver S3C64xx irq-eint to use this with a simple textual substitution.

---
 arch/arm/mach-s3c64xx/irq-eint.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)
arch/arm/mach-s3c64xx/irq- renamed from arch/arm/mach-s3c64xx/irq-eint.c +0 -0

eint.c
index 1a1aa5d..169ee29 100644

arch/arm/mach-s3c64xx/irq-eint.c +7 -7
@@ -32,39 +32,39 @@
 #define eint_offset(irq)	((irq) - IRQ_EINT(0))
 #define eint_irq_to_bit(irq)	(1 << eint_offset(irq))
 
-static inline void s3c_irq_eint_mask(unsigned int irq)
+static inline void s3c_irq_eint_mask(struct irq_data *data)
 {
 	u32 mask;
 
 	mask = __raw_readl(S3C64XX_EINT0MASK);
-	mask |= eint_irq_to_bit(irq);
+	mask |= eint_irq_to_bit(data->irq);
 	__raw_writel(mask, S3C64XX_EINT0MASK);
 }
 
-static void s3c_irq_eint_unmask(unsigned int irq)
+static void s3c_irq_eint_unmask(struct irq_data *data)
 {
 	u32 mask;
 
 	mask = __raw_readl(S3C64XX_EINT0MASK);
-	mask &= ~eint_irq_to_bit(irq);
+	mask &= ~eint_irq_to_bit(data->irq);
 	__raw_writel(mask, S3C64XX_EINT0MASK);
 }
 
-static inline void s3c_irq_eint_ack(unsigned int irq)
+static inline void s3c_irq_eint_ack(struct irq_data *data)
 {
-	__raw_writel(eint_irq_to_bit(irq), S3C64XX_EINT0PEND);
+	__raw_writel(eint_irq_to_bit(data->irq), S3C64XX_EINT0PEND);
 }
 
-static void s3c_irq_eint_maskack(unsigned int irq)
+static void s3c_irq_eint_maskack(struct irq_data *data)

arch/arm/mach-s3c64xx/irq-eint.c line 65

Quoted 10 lines
arch/arm/mach-s3c64xx/irq-eint.c +3 -3
 {
 	/* compiler should in-line these */
-	s3c_irq_eint_mask(irq);
-	s3c_irq_eint_ack(irq);
+	s3c_irq_eint_mask(data);
+	s3c_irq_eint_ack(data);
 }
 
-static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)
+static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int

type)

Quoted 15 lines
arch/arm/mach-s3c64xx/irq-eint.c +1 -5
 {
-	int offs = eint_offset(irq);
+	int offs = eint_offset(data->irq);
 	int pin, pin_val;
 	int shift;
 	u32 ctrl, mask;
@@ -140,11 +140,11 @@ static int s3c_irq_eint_set_type(unsigned int irq,
 unsigned int type)
 
 static struct irq_chip s3c_irq_eint = {
 	.name		= "s3c-eint",
-	.mask		= s3c_irq_eint_mask,
-	.unmask		= s3c_irq_eint_unmask,
-	.mask_ack	= s3c_irq_eint_maskack,
-	.ack		= s3c_irq_eint_ack,

arch/arm/mach-s3c64xx/irq-eint.c static int s3c_irq_eint_set_type(unsigned int irq,

Quoted 10 lines
arch/arm/mach-s3c64xx/irq-eint.c +5 -2
-	.set_type	= s3c_irq_eint_set_type,
+	.irq_mask	= s3c_irq_eint_mask,
+	.irq_unmask	= s3c_irq_eint_unmask,
+	.irq_mask_ack	= s3c_irq_eint_maskack,
+	.irq_ack	= s3c_irq_eint_ack,
+	.irq_set_type	= s3c_irq_eint_set_type,
 	.irq_set_wake	= s3c_irqext_wake,
 };
 
--

Ok...will apply.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#3 lore raw

PATCH 3/3 ARM: S3C64XX: Use chip_data to store the shift for EINTs

In reply to Mark Brown

This makes all the functions that use the shift slightly smaller, one instruction in most cases but more for ack() and maskack().

---
 arch/arm/mach-s3c64xx/irq-eint.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/mach-s3c64xx/irq-eint.c +5 -4
index 169ee29..2ead818 100644
@@ -30,14 +30,14 @@
 #include <plat/pm.h>
 
 #define eint_offset(irq)	((irq) - IRQ_EINT(0))
-#define eint_irq_to_bit(irq)	(1 << eint_offset(irq))
+#define eint_irq_to_bit(irq)	((u32)(1 << eint_offset(irq)))
 
 static inline void s3c_irq_eint_mask(struct irq_data *data)
 {
 	u32 mask;
 
 	mask = __raw_readl(S3C64XX_EINT0MASK);
-	mask |= eint_irq_to_bit(data->irq);
+	mask |= (u32)data->chip_data;
 	__raw_writel(mask, S3C64XX_EINT0MASK);
 }
 
@@ -46,13 +46,13 @@ static void s3c_irq_eint_unmask(struct irq_data *data)
 	u32 mask;
 
 	mask = __raw_readl(S3C64XX_EINT0MASK);
-	mask &= ~eint_irq_to_bit(data->irq);
+	mask &= ~((u32)data->chip_data);
 	__raw_writel(mask, S3C64XX_EINT0MASK);
 }
 
 static inline void s3c_irq_eint_ack(struct irq_data *data)
 {
-	__raw_writel(eint_irq_to_bit(data->irq), S3C64XX_EINT0PEND);
+	__raw_writel((u32)data->chip_data, S3C64XX_EINT0PEND);
 }
 
 static void s3c_irq_eint_maskack(struct irq_data *data)
@@ -198,6 +198,7 @@ static int __init s3c64xx_init_irq_eint(void)
 
 	for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
 		set_irq_chip(irq, &s3c_irq_eint);
+		set_irq_chip_data(irq, (void *)eint_irq_to_bit(irq));
 		set_irq_handler(irq, handle_level_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
Signature · 1 line
1.7.1
#4 lore raw

PATCH 3/3 ARM: S3C64XX: Use chip_data to store the shift for EINTs

Quoted 4 lines · Mark Brown

This makes all the functions that use the shift slightly smaller, one instruction in most cases but more for ack() and maskack().

Hi Mark,

Uhm...I'm not sure to use chip_data for the eint_irq_to_bit() is best to us.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Quoted 52 lines
---
 arch/arm/mach-s3c64xx/irq-eint.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/mach-s3c64xx/irq- renamed from arch/arm/mach-s3c64xx/irq-eint.c +0 -0

eint.c
index 169ee29..2ead818 100644

arch/arm/mach-s3c64xx/irq-eint.c +5 -5
@@ -30,14 +30,14 @@
 #include <plat/pm.h>
 
 #define eint_offset(irq)	((irq) - IRQ_EINT(0))
-#define eint_irq_to_bit(irq)	(1 << eint_offset(irq))
+#define eint_irq_to_bit(irq)	((u32)(1 << eint_offset(irq)))
 
 static inline void s3c_irq_eint_mask(struct irq_data *data)
 {
 	u32 mask;
 
 	mask = __raw_readl(S3C64XX_EINT0MASK);
-	mask |= eint_irq_to_bit(data->irq);
+	mask |= (u32)data->chip_data;
 	__raw_writel(mask, S3C64XX_EINT0MASK);
 }
 
@@ -46,13 +46,13 @@ static void s3c_irq_eint_unmask(struct irq_data *data)
 	u32 mask;
 
 	mask = __raw_readl(S3C64XX_EINT0MASK);
-	mask &= ~eint_irq_to_bit(data->irq);
+	mask &= ~((u32)data->chip_data);
 	__raw_writel(mask, S3C64XX_EINT0MASK);
 }
 
 static inline void s3c_irq_eint_ack(struct irq_data *data)
 {
-	__raw_writel(eint_irq_to_bit(data->irq), S3C64XX_EINT0PEND);
+	__raw_writel((u32)data->chip_data, S3C64XX_EINT0PEND);
 }
 
 static void s3c_irq_eint_maskack(struct irq_data *data)
@@ -198,6 +198,7 @@ static int __init s3c64xx_init_irq_eint(void)
 
 	for (irq = IRQ_EINT(0); irq <= IRQ_EINT(27); irq++) {
 		set_irq_chip(irq, &s3c_irq_eint);
+		set_irq_chip_data(irq, (void *)eint_irq_to_bit(irq));
 		set_irq_handler(irq, handle_level_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
--
author
#5 lore raw

PATCH 3/3 ARM: S3C64XX: Use chip_data to store the shift for EINTs

Quoted 6 lines · Kukjin Kim
Quoted 2 lines · Mark Brown

This makes all the functions that use the shift slightly smaller, one instruction in most cases but more for ack() and maskack().

Uhm...I'm not sure to use chip_data for the eint_irq_to_bit() is best to us.

Could you elaborate on your concern here? I can't think of anything else we might want to include in the data, and avoiding the shifts and/or dereferences seems useful for anyone doing interrupt heavy work.

#6 lore raw

PATCH 3/3 ARM: S3C64XX: Use chip_data to store the shift for EINTs

Quoted 8 lines · Mark Brown
Quoted 6 lines · Kukjin Kim
Quoted 2 lines · Mark Brown

This makes all the functions that use the shift slightly smaller, one instruction in most cases but more for ack() and maskack().

Uhm...I'm not sure to use chip_data for the eint_irq_to_bit() is best to

us.

Quoted 4 lines

Could you elaborate on your concern here? I can't think of anything else we might want to include in the data, and avoiding the shifts and/or dereferences seems useful for anyone doing interrupt heavy work.

Hehehe :-)
I just thought it again, I agree with you. Your patch looks ok to me...will apply.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#7 lore raw

PATCH 3/3 ARM: S3C64XX: Use chip_data to store the shift for EINTs

In reply to Mark Brown
Quoted 11 lines · Mark Brown
Quoted 6 lines · Kukjin Kim
Quoted 2 lines · Mark Brown

This makes all the functions that use the shift slightly smaller, one instruction in most cases but more for ack() and maskack().

Uhm...I'm not sure to use chip_data for the eint_irq_to_bit() is best to us.

Could you elaborate on your concern here? I can't think of anything else we might want to include in the data, and avoiding the shifts and/or dereferences seems useful for anyone doing interrupt heavy work.

Hi, post code to show difference in output would be good!

#8 lore raw

PATCH 1/3 ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

In reply to Mark Brown
Quoted 6 lines · Mark Brown

Kernel 2.6.37 adds new interrupt methods which take a struct irq_data rather than an irq number. Begin converting Samsung platforms over to these methods by converting s3c_irqext_wake() with a simple textual substitution.

Quoted 8 lines
---
 arch/arm/mach-s3c64xx/irq-eint.c        |    2 +-
 arch/arm/mach-s5pv310/irq-eint.c        |    2 +-
 arch/arm/plat-s3c24xx/irq.c             |    2 +-
 arch/arm/plat-s5p/irq-eint.c            |    4 ++--
 arch/arm/plat-samsung/include/plat/pm.h |    4 +++-
 arch/arm/plat-samsung/pm.c              |    6 +++---
 6 files changed, 11 insertions(+), 9 deletions(-)

It would seem that this patch breaks s3c:

./mach-s3c64xx/irq-eint.c: .irq_set_wake = s3c_irqext_wake,
./plat-s3c24xx/irq.c: .irq_set_wake = s3c_irqext_wake

Quoted 114 lines
arch/arm/mach-s3c64xx/irq-eint.c +1 -1
index 5682d6a..1a1aa5d 100644
@@ -145,7 +145,7 @@ static struct irq_chip s3c_irq_eint = {
 	.mask_ack	= s3c_irq_eint_maskack,
 	.ack		= s3c_irq_eint_ack,
 	.set_type	= s3c_irq_eint_set_type,
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 };
 
 /* s3c_irq_demux_eint
arch/arm/mach-s5pv310/irq-eint.c +1 -1
index 5877503..f5a415e 100644
@@ -152,7 +152,7 @@ static struct irq_chip s5pv310_irq_eint = {
 	.ack		= s5pv310_irq_eint_ack,
 	.set_type	= s5pv310_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
arch/arm/plat-s3c24xx/irq.c +1 -1
index ad0d44e..91ce383 100644
@@ -238,7 +238,7 @@ static struct irq_chip s3c_irqext_chip = {
 	.unmask		= s3c_irqext_unmask,
 	.ack		= s3c_irqext_ack,
 	.set_type	= s3c_irqext_type,
-	.set_wake	= s3c_irqext_wake
+	.irq_set_wake	= s3c_irqext_wake
 };
 
 static struct irq_chip s3c_irq_eint0t4 = {
arch/arm/plat-s5p/irq-eint.c +2 -2
index 752f1a6..f2f2e1c 100644
@@ -125,7 +125,7 @@ static struct irq_chip s5p_irq_eint = {
 	.ack		= s5p_irq_eint_ack,
 	.set_type	= s5p_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
@@ -194,7 +194,7 @@ static struct irq_chip s5p_irq_vic_eint = {
 	.ack		= s5p_irq_vic_eint_ack,
 	.set_type	= s5p_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
arch/arm/plat-samsung/include/plat/pm.h +3 -1
index 245836d..d9025e3 100644
@@ -15,6 +15,8 @@
  * management
 */
 
+#include <linux/irq.h>
+
 #ifdef CONFIG_PM
 
 extern __init int s3c_pm_init(void);
@@ -100,7 +102,7 @@ extern void s3c_pm_do_restore(struct sleep_save *ptr, int count);
 extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count);
 
 #ifdef CONFIG_PM
-extern int s3c_irqext_wake(unsigned int irqno, unsigned int state);
+extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
 extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state);
 extern int s3c24xx_irq_resume(struct sys_device *dev);
 #else
arch/arm/plat-samsung/pm.c +3 -3
index 5bf3f2f..02d531f 100644
@@ -136,15 +136,15 @@ static void s3c_pm_restore_uarts(void) { }
 unsigned long s3c_irqwake_intmask	= 0xffffffffL;
 unsigned long s3c_irqwake_eintmask	= 0xffffffffL;
 
-int s3c_irqext_wake(unsigned int irqno, unsigned int state)
+int s3c_irqext_wake(struct irq_data *data, unsigned int state)
 {
-	unsigned long bit = 1L << IRQ_EINT_BIT(irqno);
+	unsigned long bit = 1L << IRQ_EINT_BIT(data->irq);
 
 	if (!(s3c_irqwake_eintallow & bit))
 		return -ENOENT;
 
 	printk(KERN_INFO "wake %s for irq %d\n",
-	       state ? "enabled" : "disabled", irqno);
+	       state ? "enabled" : "disabled", data->irq);
 
 	if (!state)
 		s3c_irqwake_eintmask |= bit;
Signature · 7 lines
1.7.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
author
#9 lore raw

PATCH 1/3 ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

Quoted 4 lines · Lennert Buytenhek

It would seem that this patch breaks s3c:

./mach-s3c64xx/irq-eint.c: .irq_set_wake = s3c_irqext_wake,
./plat-s3c24xx/irq.c: .irq_set_wake = s3c_irqext_wake

Could you please elaborate on what you mean by "s3c" and why you think it has been broken?

#10 lore raw

PATCH 1/3 ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

Quoted 7 lines · Mark Brown
Quoted 4 lines

It would seem that this patch breaks s3c:

./mach-s3c64xx/irq-eint.c: .irq_set_wake = s3c_irqext_wake,
./plat-s3c24xx/irq.c: .irq_set_wake = s3c_irqext_wake

Could you please elaborate on what you mean by "s3c" and why you think it has been broken?

My mistake, sorry -- I thought you had missed the two uses of s3c_irqext_wake in ./mach-s3c64xx/irq-eint.c and ./plat-s3c24xx/irq.c, but your patch does actually fix those up as well.

author
#11 lore raw

PATCH 1/3 ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

Quoted 3 lines · Lennert Buytenhek

My mistake, sorry -- I thought you had missed the two uses of s3c_irqext_wake in ./mach-s3c64xx/irq-eint.c and ./plat-s3c24xx/irq.c, but your patch does actually fix those up as well.

No problem, no wonder I couldn't figure out what you were talking about!

#12 lore raw

PATCH 1/3 ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

In reply to Mark Brown

arch/arm/plat-samsung/include/plat/pm.h extern void s3c_pm_do_restore(struct sleep_save *ptr,

Quoted 94 lines · Mark Brown

Kernel 2.6.37 adds new interrupt methods which take a struct irq_data rather than an irq number. Begin converting Samsung platforms over to these methods by converting s3c_irqext_wake() with a simple textual substitution.

---
 arch/arm/mach-s3c64xx/irq-eint.c        |    2 +-
 arch/arm/mach-s5pv310/irq-eint.c        |    2 +-
 arch/arm/plat-s3c24xx/irq.c             |    2 +-
 arch/arm/plat-s5p/irq-eint.c            |    4 ++--
 arch/arm/plat-samsung/include/plat/pm.h |    4 +++-
 arch/arm/plat-samsung/pm.c              |    6 +++---
 6 files changed, 11 insertions(+), 9 deletions(-)
arch/arm/mach-s3c64xx/irq- renamed from arch/arm/mach-s3c64xx/irq-eint.c +0 -0

eint.c
index 5682d6a..1a1aa5d 100644

arch/arm/mach-s3c64xx/irq-eint.c +1 -1
@@ -145,7 +145,7 @@ static struct irq_chip s3c_irq_eint = {
 	.mask_ack	= s3c_irq_eint_maskack,
 	.ack		= s3c_irq_eint_ack,
 	.set_type	= s3c_irq_eint_set_type,
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 };
 
 /* s3c_irq_demux_eint
arch/arm/mach-s5pv310/irq- renamed from arch/arm/mach-s5pv310/irq-eint.c +0 -0

eint.c
index 5877503..f5a415e 100644

arch/arm/mach-s5pv310/irq-eint.c +1 -1
@@ -152,7 +152,7 @@ static struct irq_chip s5pv310_irq_eint = {
 	.ack		= s5pv310_irq_eint_ack,
 	.set_type	= s5pv310_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
arch/arm/plat-s3c24xx/irq.c +1 -1
index ad0d44e..91ce383 100644
@@ -238,7 +238,7 @@ static struct irq_chip s3c_irqext_chip = {
 	.unmask		= s3c_irqext_unmask,
 	.ack		= s3c_irqext_ack,
 	.set_type	= s3c_irqext_type,
-	.set_wake	= s3c_irqext_wake
+	.irq_set_wake	= s3c_irqext_wake
 };
 
 static struct irq_chip s3c_irq_eint0t4 = {
arch/arm/plat-s5p/irq-eint.c +2 -2
index 752f1a6..f2f2e1c 100644
@@ -125,7 +125,7 @@ static struct irq_chip s5p_irq_eint = {
 	.ack		= s5p_irq_eint_ack,
 	.set_type	= s5p_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
@@ -194,7 +194,7 @@ static struct irq_chip s5p_irq_vic_eint = {
 	.ack		= s5p_irq_vic_eint_ack,
 	.set_type	= s5p_irq_eint_set_type,
 #ifdef CONFIG_PM
-	.set_wake	= s3c_irqext_wake,
+	.irq_set_wake	= s3c_irqext_wake,
 #endif
 };
 
arch/arm/plat- renamed from arch/arm/plat-samsung/include/plat/pm.h +0 -0

samsung/include/plat/pm.h
index 245836d..d9025e3 100644

arch/arm/plat-samsung/include/plat/pm.h +2 -0
@@ -15,6 +15,8 @@
  * management
 */
 
+#include <linux/irq.h>
+
 #ifdef CONFIG_PM
 
 extern __init int s3c_pm_init(void);
@@ -100,7 +102,7 @@ extern void s3c_pm_do_restore(struct sleep_save *ptr,

int

arch/arm/plat-samsung/include/plat/pm.h extern void s3c_pm_do_restore(struct sleep_save *ptr, int count);

Quoted 7 lines
arch/arm/plat-samsung/include/plat/pm.h +1 -1
 count);
 extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count);
 
 #ifdef CONFIG_PM
-extern int s3c_irqext_wake(unsigned int irqno, unsigned int state);
+extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
 extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t

state);

Quoted 16 lines
arch/arm/plat-samsung/include/plat/pm.h +0 -0
 extern int s3c24xx_irq_resume(struct sys_device *dev);

#else

arch/arm/plat-samsung/pm.c +2 -2
index 5bf3f2f..02d531f 100644
@@ -136,15 +136,15 @@ static void s3c_pm_restore_uarts(void) { }
 unsigned long s3c_irqwake_intmask	= 0xffffffffL;
 unsigned long s3c_irqwake_eintmask	= 0xffffffffL;
 
-int s3c_irqext_wake(unsigned int irqno, unsigned int state)
+int s3c_irqext_wake(struct irq_data *data, unsigned int state)
 {
-	unsigned long bit = 1L << IRQ_EINT_BIT(irqno);
+	unsigned long bit = 1L << IRQ_EINT_BIT(data->irq);
 

arch/arm/plat-samsung/pm.c static void s3c_pm_restore_uarts(void) { }

Quoted 10 lines
arch/arm/plat-samsung/pm.c +1 -2
 	if (!(s3c_irqwake_eintallow & bit))
 		return -ENOENT;
 
 	printk(KERN_INFO "wake %s for irq %d\n",
-	       state ? "enabled" : "disabled", irqno);
+	       state ? "enabled" : "disabled", data->irq);
 
 	if (!state)
 		s3c_irqwake_eintmask |= bit;
--

Looks ok to me...will apply.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

#13 lore raw

PATCH 1/3 ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

In reply to Mark Brown
Quoted 5 lines · Mark Brown

Kernel 2.6.37 adds new interrupt methods which take a struct irq_data rather than an irq number. Begin converting Samsung platforms over to these methods by converting s3c_irqext_wake() with a simple textual substitution.

And...as you know, need to convert s3c_irq_wake() to new irq_ interrupt method also.
Ok...I will do it or will check Lennert Buytenhek's patch for it :-)

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

author
#14 lore raw

PATCH 1/3 ARM: SAMSUNG: Convert s3c_irqext_wake() to new irq_ interrupt methods

Quoted 3 lines · Kukjin Kim

And...as you know, need to convert s3c_irq_wake() to new irq_ interrupt method also.
Ok...I will do it or will check Lennert Buytenhek's patch for it :-)

Yup, there's a lot of other IRQ stuff in the various Samsung platforms that can be converted - as you can see I was working through the various interrupts one at a time. Lennart's patch covers everything but only does the mechanical side of things.