Skip to contentSkip to conversation

pxa: Fix warning in zeus.c

PATCH RESEND New Marek Vasut 3 participants 12 messages Jan 10, 2011 – Jan 12, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/5 pxa: Fix warning in zeus.c

---
 arch/arm/mach-pxa/zeus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-pxa/zeus.c +2 -2
index c87f2b3..29830a3 100644
@@ -830,8 +830,8 @@ static void __init zeus_init(void)
 	pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f));
 
 	/* Fix timings for dm9000s (CS1/CS2)*/
-	msc0 = __raw_readl(MSC0) & 0x0000ffff | (dm9000_msc << 16);
-	msc1 = __raw_readl(MSC1) & 0xffff0000 | dm9000_msc;
+	msc0 = (__raw_readl(MSC0) & 0x0000ffff) | (dm9000_msc << 16);
+	msc1 = (__raw_readl(MSC1) & 0xffff0000) | dm9000_msc;
 	__raw_writel(msc0, MSC0);
 	__raw_writel(msc1, MSC1);
 
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH RESEND 2/5 pxa: Remove unused variable in clock-pxa3xx.c

---
 arch/arm/mach-pxa/clock-pxa3xx.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-pxa/clock-pxa3xx.c +0 -1
index 1b08a34..3f864cd 100644
@@ -115,7 +115,6 @@ static unsigned long clk_pxa3xx_smemc_getrate(struct clk *clk)
 {
 	unsigned long acsr = ACSR;
 	unsigned long memclkcfg = __raw_readl(MEMCLKCFG);
-	unsigned int smcfs = (acsr >> 23) & 0x7;
 
 	return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] /
 			df_clkdiv[(memclkcfg >> 16) & 0x3];
Signature · 1 line
1.7.2.3
#2 lore raw

PATCH RESEND 3/5 ARM: pxa: Use cpu_has_ipr() consistently in irq.c

In reply to Marek Vasut
---
 arch/arm/mach-pxa/irq.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-pxa/irq.c +1 -1
index 54e91c9..78f0e0c 100644
@@ -226,7 +226,7 @@ static int pxa_irq_resume(struct sys_device *dev)
 		__raw_writel(0, base + ICLR);
 	}
 
-	if (!cpu_is_pxa25x())
+	if (cpu_has_ipr())
 		for (i = 0; i < pxa_internal_irq_nr; i++)
 			__raw_writel(saved_ipr[i], IRQ_BASE + IPR(i));
 
Signature · 1 line
1.7.2.3
#3 lore raw

PATCH v2 4/5 ARM: pxa: Fix suspend/resume array index miscalculation

In reply to Marek Vasut

---
v2: Fix loop condition as proposed by Sergei

 arch/arm/mach-pxa/irq.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-pxa/irq.c +4 -4
index 78f0e0c..a7deff5 100644
@@ -156,7 +156,7 @@ static inline void __iomem *irq_base(int i)
 		0x40d00130,
 	};
 
-	return (void __iomem *)io_p2v(phys_base[i >> 5]);
+	return (void __iomem *)io_p2v(phys_base[i]);
 }
 
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -168,7 +168,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 	pxa_internal_irq_nr = irq_nr;
 
 	for (n = 0; n < irq_nr; n += 32) {
-		void __iomem *base = irq_base(n);
+		void __iomem *base = irq_base(n >> 5);
 
 		__raw_writel(0, base + ICMR);	/* disable all IRQs */
 		__raw_writel(0, base + ICLR);	/* all IRQs are IRQ, not FIQ */
@@ -200,7 +200,7 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
 {
 	int i;
 
-	for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+	for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
 		void __iomem *base = irq_base(i);
 
 		saved_icmr[i] = __raw_readl(base + ICMR);
@@ -219,7 +219,7 @@ static int pxa_irq_resume(struct sys_device *dev)
 {
 	int i;
 
-	for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+	for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
 		void __iomem *base = irq_base(i);
 
 		__raw_writel(saved_icmr[i], base + ICMR);
Signature · 1 line
1.7.2.3
#4 lore raw

PATCH v2 4/5 ARM: pxa: Fix suspend/resume array index miscalculation

Quoted 30 lines · Marek Vasut

---
v2: Fix loop condition as proposed by Sergei

?arch/arm/mach-pxa/irq.c | ? ?8 ++++----
?1 files changed, 4 insertions(+), 4 deletions(-)

arch/arm/mach-pxa/irq.c +2 -2
index 78f0e0c..a7deff5 100644
@@ -156,7 +156,7 @@ static inline void __iomem *irq_base(int i)
 ? ? ? ? ? ? ? ?0x40d00130,
 ? ? ? ?};
 
- ? ? ? return (void __iomem *)io_p2v(phys_base[i >> 5]);
+ ? ? ? return (void __iomem *)io_p2v(phys_base[i]);
 ?}
 
 ?void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -168,7 +168,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 ? ? ? ?pxa_internal_irq_nr = irq_nr;
 
 ? ? ? ?for (n = 0; n < irq_nr; n += 32) {
- ? ? ? ? ? ? ? void __iomem *base = irq_base(n);
+ ? ? ? ? ? ? ? void __iomem *base = irq_base(n >> 5);
 

? ? ? ? ? ? ? ?__raw_writel(0, base + ICMR); ? /* disable all IRQs */ ? ? ? ? ? ? ? ?__raw_writel(0, base + ICLR); ? /* all IRQs are IRQ, not FIQ */

arch/arm/mach-pxa/irq.c static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) · line 204

Quoted 6 lines
arch/arm/mach-pxa/irq.c +1 -1
@@ -200,7 +200,7 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
 ?{
 ? ? ? ?int i;
 
- ? ? ? for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
 ? ? ? ? ? ? ? ?void __iomem *base = irq_base(i);

I prefer it to be IRQ number based instead of IRQ bank based, in other word, I'd rather to change the statement below:

arch/arm/mach-pxa/irq.c static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) · line 205

Quoted 2 lines
arch/arm/mach-pxa/irq.c +0 -0
 ? ? ? ? ? ? ? ?saved_icmr[i] = __raw_readl(base + ICMR);

to something:

saved_icmr[i / 32] = __raw_read(base + ICMR);

Quoted 13 lines
arch/arm/mach-pxa/irq.c +1 -2
@@ -219,7 +219,7 @@ static int pxa_irq_resume(struct sys_device *dev)
 ?{
 ? ? ? ?int i;
 
- ? ? ? for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
 ? ? ? ? ? ? ? ?void __iomem *base = irq_base(i);
 
 ? ? ? ? ? ? ? ?__raw_writel(saved_icmr[i], base + ICMR);
--

1.7.2.3

#5 lore raw

PATCH v2 4/5 ARM: pxa: Fix suspend/resume array index miscalculation

Quoted 40 lines · On Tuesday 11 January 2011 00:41:26 Eric Miao wrote:
Quoted 33 lines · Marek Vasut

---
v2: Fix loop condition as proposed by Sergei

 arch/arm/mach-pxa/irq.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-pxa/irq.c +2 -2
index 78f0e0c..a7deff5 100644
@@ -156,7 +156,7 @@ static inline void __iomem *irq_base(int i)
               0x40d00130,
       };
 
-       return (void __iomem *)io_p2v(phys_base[i >> 5]);
+       return (void __iomem *)io_p2v(phys_base[i]);
 }
 
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -168,7 +168,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
       pxa_internal_irq_nr = irq_nr;
 
       for (n = 0; n < irq_nr; n += 32) {
-               void __iomem *base = irq_base(n);
+               void __iomem *base = irq_base(n >> 5);
 
               __raw_writel(0, base + ICMR);   /* disable all IRQs */
               __raw_writel(0, base + ICLR);   /* all IRQs are IRQ, not

FIQ */ @@ -200,7 +200,7 @@ static int pxa_irq_suspend(struct sys_device

*dev, pm_message_t state) {
       int i;

arch/arm/mach-pxa/irq.c static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) · line 204

Quoted 3 lines
arch/arm/mach-pxa/irq.c +1 -1
-       for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+       for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
               void __iomem *base = irq_base(i);

I prefer it to be IRQ number based instead of IRQ bank based,

Quoted 6 lines

in other word, I'd rather to change the statement below:

Quoted 1 line
               saved_icmr[i] = __raw_readl(base + ICMR);

to something:

saved_icmr[i / 32] = __raw_read(base + ICMR);

Exactly what I wanted to avoid ... won't you be doing a division "# of bank"- times instead of once there ?

Quoted 12 lines
Quoted 12 lines
arch/arm/mach-pxa/irq.c +1 -2
@@ -219,7 +219,7 @@ static int pxa_irq_resume(struct sys_device *dev)
 {
       int i;
 
-       for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+       for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
               void __iomem *base = irq_base(i);
 
               __raw_writel(saved_icmr[i], base + ICMR);
--

1.7.2.3

#6 lore raw

PATCH v2 4/5 ARM: pxa: Fix suspend/resume array index miscalculation

Quoted 42 lines · Marek Vasut
Quoted 41 lines · On Tuesday 11 January 2011 00:41:26 Eric Miao wrote:
Quoted 33 lines · Marek Vasut

---
v2: Fix loop condition as proposed by Sergei

?arch/arm/mach-pxa/irq.c | ? ?8 ++++----
?1 files changed, 4 insertions(+), 4 deletions(-)

arch/arm/mach-pxa/irq.c +2 -2
index 78f0e0c..a7deff5 100644
@@ -156,7 +156,7 @@ static inline void __iomem *irq_base(int i)
 ? ? ? ? ? ? ? ?0x40d00130,
 ? ? ? ?};
 
- ? ? ? return (void __iomem *)io_p2v(phys_base[i >> 5]);
+ ? ? ? return (void __iomem *)io_p2v(phys_base[i]);
 ?}
 
 ?void __init pxa_init_irq(int irq_nr, set_wake_t fn)
@@ -168,7 +168,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 ? ? ? ?pxa_internal_irq_nr = irq_nr;
 
 ? ? ? ?for (n = 0; n < irq_nr; n += 32) {
- ? ? ? ? ? ? ? void __iomem *base = irq_base(n);
+ ? ? ? ? ? ? ? void __iomem *base = irq_base(n >> 5);
 

? ? ? ? ? ? ? ?__raw_writel(0, base + ICMR); ? /* disable all IRQs */ ? ? ? ? ? ? ? ?__raw_writel(0, base + ICLR); ? /* all IRQs are IRQ, not FIQ */ @@ -200,7 +200,7 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) {
? ? ? ?int i;

Quoted 3 lines

- ? ? ? for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr / 32; i++) { ? ? ? ? ? ? ? ?void __iomem *base = irq_base(i);

I prefer it to be IRQ number based instead of IRQ bank based,

in other word, I'd rather to change the statement below:

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

? ? ? ? ? ? ? ?saved_icmr[i] = __raw_readl(base + ICMR);

to something:

saved_icmr[i / 32] = __raw_read(base + ICMR);

Exactly what I wanted to avoid ... won't you be doing a division "# of bank"- times instead of once there ?

I'm fine with either way. Applied.

Quoted 13 lines
Quoted 12 lines
Quoted 12 lines
arch/arm/mach-pxa/irq.c +1 -2
@@ -219,7 +219,7 @@ static int pxa_irq_resume(struct sys_device *dev)
 ?{
 ? ? ? ?int i;
 
- ? ? ? for (i = 0; i < pxa_internal_irq_nr; i += 32) {
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
 ? ? ? ? ? ? ? ?void __iomem *base = irq_base(i);
 
 ? ? ? ? ? ? ? ?__raw_writel(saved_icmr[i], base + ICMR);
--

1.7.2.3

#7 lore raw

PATCH v2 5/5 ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio()

In reply to Marek Vasut

---
v2: Remove dead code as proposed by Sergei

 arch/arm/mach-pxa/irq.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-pxa/irq.c +2 -6
index a7deff5..76e69cf 100644
@@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
 
 static void pxa_mask_low_gpio(unsigned int irq)
 {
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->mask(irq);
+	pxa_mask_irq(irq);
 }
 
 static void pxa_unmask_low_gpio(unsigned int irq)
 {
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->unmask(irq);
+	pxa_unmask_irq(irq);
 }
 
 static struct irq_chip pxa_low_gpio_chip = {
Signature · 1 line
1.7.2.3
#8 lore raw

PATCH v2 5/5 ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio()

The original intention is to re-use pxa_{mask,unmask}_irq(), will the change below looks better? The move of irq_base() is to avoid the error of function not declared.

arch/arm/mach-pxa/irq.c +14 -27
index a7deff5..6107253 100644
@@ -53,6 +53,17 @@ static inline int cpu_has_ipr(void)
 	return !cpu_is_pxa25x();
 }
 
+static inline void __iomem *irq_base(int i)
+{
+	static unsigned long phys_base[] = {
+		0x40d00000,
+		0x40d0009c,
+		0x40d00130,
+	};
+
+	return (void __iomem *)io_p2v(phys_base[i]);
+}
+
 static void pxa_mask_irq(unsigned int irq)
 {
 	void __iomem *base = get_irq_chip_data(irq);
@@ -108,25 +119,11 @@ static void pxa_ack_low_gpio(unsigned int irq)
 	GEDR0 = (1 << (irq - IRQ_GPIO0));
 }
 
-static void pxa_mask_low_gpio(unsigned int irq)
-{
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->mask(irq);
-}
-
-static void pxa_unmask_low_gpio(unsigned int irq)
-{
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->unmask(irq);
-}
-
 static struct irq_chip pxa_low_gpio_chip = {
 	.name		= "GPIO-l",
 	.ack		= pxa_ack_low_gpio,
-	.mask		= pxa_mask_low_gpio,
-	.unmask		= pxa_unmask_low_gpio,
+	.mask		= pxa_mask_irq,
+	.unmask		= pxa_unmask_irq,
 	.set_type	= pxa_set_low_gpio_type,
 };
 
@@ -141,6 +138,7 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		set_irq_chip(irq, &pxa_low_gpio_chip);
+		set_irq_chip_data(irq, irq_base(0));
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
@@ -148,17 +146,6 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 	pxa_low_gpio_chip.set_wake = fn;
 }
 
-static inline void __iomem *irq_base(int i)
-{
-	static unsigned long phys_base[] = {
-		0x40d00000,
-		0x40d0009c,
-		0x40d00130,
-	};
-
-	return (void __iomem *)io_p2v(phys_base[i]);
-}
-
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 {
 	int irq, i, n;
Quoted 34 lines · Marek Vasut

---
v2: Remove dead code as proposed by Sergei

?arch/arm/mach-pxa/irq.c | ? ?8 ++------
?1 files changed, 2 insertions(+), 6 deletions(-)

arch/arm/mach-pxa/irq.c +2 -7
index a7deff5..76e69cf 100644
@@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
 
 ?static void pxa_mask_low_gpio(unsigned int irq)
 ?{
- ? ? ? struct irq_desc *desc = irq_to_desc(irq);
-
- ? ? ? desc->chip->mask(irq);
+ ? ? ? pxa_mask_irq(irq);
 ?}
 
 ?static void pxa_unmask_low_gpio(unsigned int irq)
 ?{
- ? ? ? struct irq_desc *desc = irq_to_desc(irq);
-
- ? ? ? desc->chip->unmask(irq);
+ ? ? ? pxa_unmask_irq(irq);
 ?}
 
 ?static struct irq_chip pxa_low_gpio_chip = {
--

1.7.2.3

#9 lore raw

PATCH v2 5/5 ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio()

Quoted 70 lines · On Wednesday 12 January 2011 00:16:50 Eric Miao wrote:

The original intention is to re-use pxa_{mask,unmask}_irq(), will the change below looks better? The move of irq_base() is to avoid the error of function not declared.

arch/arm/mach-pxa/irq.c +14 -20
index a7deff5..6107253 100644
@@ -53,6 +53,17 @@ static inline int cpu_has_ipr(void)
 	return !cpu_is_pxa25x();
 }
 
+static inline void __iomem *irq_base(int i)
+{
+	static unsigned long phys_base[] = {
+		0x40d00000,
+		0x40d0009c,
+		0x40d00130,
+	};
+
+	return (void __iomem *)io_p2v(phys_base[i]);
+}
+
 static void pxa_mask_irq(unsigned int irq)
 {
 	void __iomem *base = get_irq_chip_data(irq);
@@ -108,25 +119,11 @@ static void pxa_ack_low_gpio(unsigned int irq)
 	GEDR0 = (1 << (irq - IRQ_GPIO0));
 }
 
-static void pxa_mask_low_gpio(unsigned int irq)
-{
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->mask(irq);
-}
-
-static void pxa_unmask_low_gpio(unsigned int irq)
-{
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->unmask(irq);
-}
-
 static struct irq_chip pxa_low_gpio_chip = {
 	.name		= "GPIO-l",
 	.ack		= pxa_ack_low_gpio,
-	.mask		= pxa_mask_low_gpio,
-	.unmask		= pxa_unmask_low_gpio,
+	.mask		= pxa_mask_irq,
+	.unmask		= pxa_unmask_irq,
 	.set_type	= pxa_set_low_gpio_type,
 };
 
@@ -141,6 +138,7 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		set_irq_chip(irq, &pxa_low_gpio_chip);
+		set_irq_chip_data(irq, irq_base(0));
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
@@ -148,17 +146,6 @@ static void __init pxa_init_low_gpio_irq(set_wake_t
 fn) pxa_low_gpio_chip.set_wake = fn;
 }
 
-static inline void __iomem *irq_base(int i)
-{
-	static unsigned long phys_base[] = {
-		0x40d00000,

arch/arm/mach-pxa/irq.c static void __init pxa_init_low_gpio_irq(set_wake_t · line 151

Quoted 10 lines
arch/arm/mach-pxa/irq.c +0 -7
-		0x40d0009c,
-		0x40d00130,
-	};
-
-	return (void __iomem *)io_p2v(phys_base[i]);
-}
-
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 {
 	int irq, i, n;

Way better indeed

Quoted 34 lines · Marek Vasut
Quoted 32 lines

---
v2: Remove dead code as proposed by Sergei

 arch/arm/mach-pxa/irq.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-pxa/irq.c +2 -7
index a7deff5..76e69cf 100644
@@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
 
 static void pxa_mask_low_gpio(unsigned int irq)
 {
-       struct irq_desc *desc = irq_to_desc(irq);
-
-       desc->chip->mask(irq);
+       pxa_mask_irq(irq);
 }
 
 static void pxa_unmask_low_gpio(unsigned int irq)
 {
-       struct irq_desc *desc = irq_to_desc(irq);
-
-       desc->chip->unmask(irq);
+       pxa_unmask_irq(irq);
 }
 
 static struct irq_chip pxa_low_gpio_chip = {
--

1.7.2.3

#10 lore raw

PATCH v2 5/5 ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio()

In reply to Eric Miao
Quoted 3 lines · On Wednesday 12 January 2011 00:16:50 Eric Miao wrote:

The original intention is to re-use pxa_{mask,unmask}_irq(), will the change below looks better? The move of irq_base() is to avoid the error of function not declared.

Here's your :

Tested on Zipit Z2

Quoted 111 lines
arch/arm/mach-pxa/irq.c +14 -27
index a7deff5..6107253 100644
@@ -53,6 +53,17 @@ static inline int cpu_has_ipr(void)
 	return !cpu_is_pxa25x();
 }
 
+static inline void __iomem *irq_base(int i)
+{
+	static unsigned long phys_base[] = {
+		0x40d00000,
+		0x40d0009c,
+		0x40d00130,
+	};
+
+	return (void __iomem *)io_p2v(phys_base[i]);
+}
+
 static void pxa_mask_irq(unsigned int irq)
 {
 	void __iomem *base = get_irq_chip_data(irq);
@@ -108,25 +119,11 @@ static void pxa_ack_low_gpio(unsigned int irq)
 	GEDR0 = (1 << (irq - IRQ_GPIO0));
 }
 
-static void pxa_mask_low_gpio(unsigned int irq)
-{
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->mask(irq);
-}
-
-static void pxa_unmask_low_gpio(unsigned int irq)
-{
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->unmask(irq);
-}
-
 static struct irq_chip pxa_low_gpio_chip = {
 	.name		= "GPIO-l",
 	.ack		= pxa_ack_low_gpio,
-	.mask		= pxa_mask_low_gpio,
-	.unmask		= pxa_unmask_low_gpio,
+	.mask		= pxa_mask_irq,
+	.unmask		= pxa_unmask_irq,
 	.set_type	= pxa_set_low_gpio_type,
 };
 
@@ -141,6 +138,7 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn)
 
 	for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
 		set_irq_chip(irq, &pxa_low_gpio_chip);
+		set_irq_chip_data(irq, irq_base(0));
 		set_irq_handler(irq, handle_edge_irq);
 		set_irq_flags(irq, IRQF_VALID);
 	}
@@ -148,17 +146,6 @@ static void __init pxa_init_low_gpio_irq(set_wake_t
 fn) pxa_low_gpio_chip.set_wake = fn;
 }
 
-static inline void __iomem *irq_base(int i)
-{
-	static unsigned long phys_base[] = {
-		0x40d00000,
-		0x40d0009c,
-		0x40d00130,
-	};
-
-	return (void __iomem *)io_p2v(phys_base[i]);
-}
-
 void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 {
 	int irq, i, n;
Quoted 32 lines · Marek Vasut

---
v2: Remove dead code as proposed by Sergei

 arch/arm/mach-pxa/irq.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-pxa/irq.c +2 -7
index a7deff5..76e69cf 100644
@@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
 
 static void pxa_mask_low_gpio(unsigned int irq)
 {
-       struct irq_desc *desc = irq_to_desc(irq);
-
-       desc->chip->mask(irq);
+       pxa_mask_irq(irq);
 }
 
 static void pxa_unmask_low_gpio(unsigned int irq)
 {
-       struct irq_desc *desc = irq_to_desc(irq);
-
-       desc->chip->unmask(irq);
+       pxa_unmask_irq(irq);
 }
 
 static struct irq_chip pxa_low_gpio_chip = {
--

1.7.2.3

#11 lore raw

PATCH v2 5/5 ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio()

In reply to Marek Vasut

Hello.

Quoted 20 lines · Marek Vasut

---
v2: Remove dead code as proposed by Sergei

  arch/arm/mach-pxa/irq.c |    8 ++------
  1 files changed, 2 insertions(+), 6 deletions(-)
arch/arm/mach-pxa/irq.c +1 -3
index a7deff5..76e69cf 100644
@@ -110,16 +110,12 @@ static void pxa_ack_low_gpio(unsigned int irq)
 
  static void pxa_mask_low_gpio(unsigned int irq)
  {
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->mask(irq);
+	pxa_mask_irq(irq);
  }

arch/arm/mach-pxa/irq.c static void pxa_ack_low_gpio(unsigned int irq) · line 121

Quoted 10 lines
arch/arm/mach-pxa/irq.c +1 -3
 
  static void pxa_unmask_low_gpio(unsigned int irq)
  {
-	struct irq_desc *desc = irq_to_desc(irq);
-
-	desc->chip->unmask(irq);
+	pxa_unmask_irq(irq);
  }
 
  static struct irq_chip pxa_low_gpio_chip = {

If the above two functions are the methods of this IRQ chip, shouldn't you
just replace the initializers and remove the functions altogether?

WBR, Sergei