Skip to contentSkip to conversation

pxa: Fix warning in zeus.c

PATCH Superseded Marek Vasut 3 participants 12 messages Jan 9, 2011 – Jan 10, 2011

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

PATCH 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 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
Applied
#2 lore raw

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

Quoted 1 line · Marek Vasut

Applied.

Quoted 20 lines

---
?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]; --
1.7.2.3

#3 lore raw

PATCH 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
Applied
#4 lore raw

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

Quoted 1 line · Marek Vasut

Applied.

Quoted 21 lines

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

arch/arm/mach-pxa/irq.c +1 -2
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));
 
--

1.7.2.3

#5 lore raw

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

In reply to Marek Vasut
---
 arch/arm/mach-pxa/irq.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-pxa/irq.c +5 -5
index 78f0e0c..81edf97 100644
@@ -194,14 +194,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 
 #ifdef CONFIG_PM
 static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
-static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
+static unsigned long saved_ipr[MAX_INTERNAL_IRQS/32];
 
 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) {
-		void __iomem *base = irq_base(i);
+	for (i = 0; i < pxa_internal_irq_nr; i++) {
+		void __iomem *base = irq_base(i << 5);
 
 		saved_icmr[i] = __raw_readl(base + ICMR);
 		__raw_writel(0, base + ICMR);
@@ -219,8 +219,8 @@ static int pxa_irq_resume(struct sys_device *dev)
 {
 	int i;
 
-	for (i = 0; i < pxa_internal_irq_nr; i += 32) {
-		void __iomem *base = irq_base(i);
+	for (i = 0; i < pxa_internal_irq_nr; i++) {
+		void __iomem *base = irq_base(i << 5);
 
 		__raw_writel(saved_icmr[i], base + ICMR);
 		__raw_writel(0, base + ICLR);
Signature · 1 line
1.7.2.3
#6 lore raw

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

Quoted 13 lines · Marek Vasut
---
  arch/arm/mach-pxa/irq.c |   10 +++++-----
  1 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-pxa/irq.c +0 -0
index 78f0e0c..81edf97 100644
@@ -194,14 +194,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 
  #ifdef CONFIG_PM
  static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];

arch/arm/mach-pxa/irq.c void __init pxa_init_irq(int irq_nr, set_wake_t fn) · line 203

Quoted 10 lines
arch/arm/mach-pxa/irq.c +2 -3
-static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
+static unsigned long saved_ipr[MAX_INTERNAL_IRQS/32];
 
  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) {
-		void __iomem *base = irq_base(i);
+	for (i = 0; i < pxa_internal_irq_nr; i++) {

Won't the loop condition also have to change?

arch/arm/mach-pxa/irq.c static int pxa_irq_resume(struct sys_device *dev) · line 222

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

Same question here...

arch/arm/mach-pxa/irq.c static int pxa_irq_resume(struct sys_device *dev) · line 226

Quoted 4 lines
arch/arm/mach-pxa/irq.c +1 -0
+		void __iomem *base = irq_base(i << 5);
 
  		__raw_writel(saved_icmr[i], base + ICMR);
  		__raw_writel(0, base + ICLR);

WBR, Sergei

#7 lore raw

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

In reply to Marek Vasut
Quoted 14 lines · Marek Vasut

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

arch/arm/mach-pxa/irq.c +0 -0
index 78f0e0c..81edf97 100644
@@ -194,14 +194,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 

?#ifdef CONFIG_PM
?static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];

arch/arm/mach-pxa/irq.c void __init pxa_init_irq(int irq_nr, set_wake_t fn) · line 197

Quoted 2 lines
arch/arm/mach-pxa/irq.c +1 -1
-static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
+static unsigned long saved_ipr[MAX_INTERNAL_IRQS/32];

This isn't right I'm afraid. Unlike other IRQ registers, each interrupt line has its own IPR register. So the changes below are also invalid.

Quoted 26 lines

?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) {
- ? ? ? ? ? ? ? void __iomem *base = irq_base(i);
+ ? ? ? for (i = 0; i < pxa_internal_irq_nr; i++) {
+ ? ? ? ? ? ? ? void __iomem *base = irq_base(i << 5);

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

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

1.7.2.3

#8 lore raw

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

Quoted 12 lines · On Monday 10 January 2011 23:49:07 Eric Miao wrote:
Quoted 11 lines · Marek Vasut
---
 arch/arm/mach-pxa/irq.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/mach-pxa/irq.c +0 -0
index 78f0e0c..81edf97 100644
@@ -194,14 +194,14 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
 
Quoted 7 lines

arch/arm/mach-pxa/irq.c void __init pxa_init_irq(int irq_nr, set_wake_t fn) · line 197

Quoted 4 lines
arch/arm/mach-pxa/irq.c +1 -1
 #ifdef CONFIG_PM
 static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
-static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
+static unsigned long saved_ipr[MAX_INTERNAL_IRQS/32];

This isn't right I'm afraid. Unlike other IRQ registers, each interrupt line has its own IPR register. So the changes below are also invalid.

You're right, stupid me ... I just noticed it too (unlike your email). Can you check v2 please ?

Cheers

Quoted 25 lines
Quoted 25 lines
arch/arm/mach-pxa/irq.c +4 -5
 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) {
-               void __iomem *base = irq_base(i);
+       for (i = 0; i < pxa_internal_irq_nr; i++) {
+               void __iomem *base = irq_base(i << 5);
 
               saved_icmr[i] = __raw_readl(base + ICMR);
               __raw_writel(0, base + ICMR);
@@ -219,8 +219,8 @@ static int pxa_irq_resume(struct sys_device *dev)
 {
       int i;
 
-       for (i = 0; i < pxa_internal_irq_nr; i += 32) {
-               void __iomem *base = irq_base(i);
+       for (i = 0; i < pxa_internal_irq_nr; i++) {
+               void __iomem *base = irq_base(i << 5);
 
               __raw_writel(saved_icmr[i], base + ICMR);
               __raw_writel(0, base + ICLR);
--

1.7.2.3

#9 lore raw

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

In reply to Marek Vasut
---
 arch/arm/mach-pxa/irq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-pxa/irq.c +2 -2
index 81edf97..96571fe 100644
@@ -112,14 +112,14 @@ 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
#10 lore raw

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

Hello.

Quoted 1 line · Marek Vasut

[...]

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

Quoted 7 lines
arch/arm/mach-pxa/irq.c +0 -0
index 81edf97..96571fe 100644
@@ -112,14 +112,14 @@ static void pxa_mask_low_gpio(unsigned int irq)
  {
  	struct irq_desc *desc = irq_to_desc(irq);

You should have removed that variable too as it's not unused.

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

Quoted 7 lines
arch/arm/mach-pxa/irq.c +1 -1
-	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);

Same here...

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

Quoted 3 lines
arch/arm/mach-pxa/irq.c +1 -1
-	desc->chip->unmask(irq);
+	pxa_unmask_irq(irq);
  }

WBR, Sergei

Applied
#11 lore raw

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

In reply to Marek Vasut
Quoted 1 line · Marek Vasut

Applied.

Quoted 23 lines

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

arch/arm/mach-pxa/zeus.c +0 -0
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);

--
1.7.2.3