* [PATCH 1/5 resend] pxa: Fix warning in zeus.c
@ 2011-01-10 22:53 Marek Vasut
2011-01-10 22:53 ` [PATCH 2/5 resend] pxa: Remove unused variable in clock-pxa3xx.c Marek Vasut
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Marek Vasut @ 2011-01-10 22:53 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
---
arch/arm/mach-pxa/zeus.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index c87f2b3..29830a3 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -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
^ permalink raw reply related [flat|nested] 12+ messages in thread* [PATCH 2/5 resend] pxa: Remove unused variable in clock-pxa3xx.c 2011-01-10 22:53 [PATCH 1/5 resend] pxa: Fix warning in zeus.c Marek Vasut @ 2011-01-10 22:53 ` Marek Vasut 2011-01-10 22:53 ` [PATCH 3/5 resend] ARM: pxa: Use cpu_has_ipr() consistently in irq.c Marek Vasut ` (2 subsequent siblings) 3 siblings, 0 replies; 12+ messages in thread From: Marek Vasut @ 2011-01-10 22:53 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Marek Vasut <marek.vasut@gmail.com> --- arch/arm/mach-pxa/clock-pxa3xx.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c index 1b08a34..3f864cd 100644 --- a/arch/arm/mach-pxa/clock-pxa3xx.c +++ b/arch/arm/mach-pxa/clock-pxa3xx.c @@ -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 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/5 resend] ARM: pxa: Use cpu_has_ipr() consistently in irq.c 2011-01-10 22:53 [PATCH 1/5 resend] pxa: Fix warning in zeus.c Marek Vasut 2011-01-10 22:53 ` [PATCH 2/5 resend] pxa: Remove unused variable in clock-pxa3xx.c Marek Vasut @ 2011-01-10 22:53 ` Marek Vasut 2011-01-10 22:53 ` [PATCH 4/5 v2] ARM: pxa: Fix suspend/resume array index miscalculation Marek Vasut 2011-01-10 22:53 ` [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() Marek Vasut 3 siblings, 0 replies; 12+ messages in thread From: Marek Vasut @ 2011-01-10 22:53 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Marek Vasut <marek.vasut@gmail.com> --- arch/arm/mach-pxa/irq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 54e91c9..78f0e0c 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -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 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/5 v2] ARM: pxa: Fix suspend/resume array index miscalculation 2011-01-10 22:53 [PATCH 1/5 resend] pxa: Fix warning in zeus.c Marek Vasut 2011-01-10 22:53 ` [PATCH 2/5 resend] pxa: Remove unused variable in clock-pxa3xx.c Marek Vasut 2011-01-10 22:53 ` [PATCH 3/5 resend] ARM: pxa: Use cpu_has_ipr() consistently in irq.c Marek Vasut @ 2011-01-10 22:53 ` Marek Vasut 2011-01-10 23:41 ` Eric Miao 2011-01-10 22:53 ` [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() Marek Vasut 3 siblings, 1 reply; 12+ messages in thread From: Marek Vasut @ 2011-01-10 22:53 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Marek Vasut <marek.vasut@gmail.com> --- v2: Fix loop condition as proposed by Sergei arch/arm/mach-pxa/irq.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 78f0e0c..a7deff5 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -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); -- 1.7.2.3 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/5 v2] ARM: pxa: Fix suspend/resume array index miscalculation 2011-01-10 22:53 ` [PATCH 4/5 v2] ARM: pxa: Fix suspend/resume array index miscalculation Marek Vasut @ 2011-01-10 23:41 ` Eric Miao 2011-01-10 23:46 ` Marek Vasut 0 siblings, 1 reply; 12+ messages in thread From: Eric Miao @ 2011-01-10 23:41 UTC (permalink / raw) To: linux-arm-kernel On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut <marek.vasut@gmail.com> wrote: > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> > --- > v2: Fix loop condition as proposed by Sergei > > ?arch/arm/mach-pxa/irq.c | ? ?8 ++++---- > ?1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > index 78f0e0c..a7deff5 100644 > --- a/arch/arm/mach-pxa/irq.c > +++ b/arch/arm/mach-pxa/irq.c > @@ -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); I prefer it to be IRQ number based instead of IRQ bank based, in other word, I'd rather to change the statement below: > > ? ? ? ? ? ? ? ?saved_icmr[i] = __raw_readl(base + ICMR); to something: saved_icmr[i / 32] = __raw_read(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); > -- > 1.7.2.3 > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/5 v2] ARM: pxa: Fix suspend/resume array index miscalculation 2011-01-10 23:41 ` Eric Miao @ 2011-01-10 23:46 ` Marek Vasut 2011-01-11 22:45 ` Eric Miao 0 siblings, 1 reply; 12+ messages in thread From: Marek Vasut @ 2011-01-10 23:46 UTC (permalink / raw) To: linux-arm-kernel On Tuesday 11 January 2011 00:41:26 Eric Miao wrote: > On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut <marek.vasut@gmail.com> wrote: > > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> > > --- > > v2: Fix loop condition as proposed by Sergei > > > > arch/arm/mach-pxa/irq.c | 8 ++++---- > > 1 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > > index 78f0e0c..a7deff5 100644 > > --- a/arch/arm/mach-pxa/irq.c > > +++ b/arch/arm/mach-pxa/irq.c > > @@ -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); > > I prefer it to be IRQ number based instead of IRQ bank based, > > in other word, I'd rather to change the statement below: > > 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 ? > > > @@ -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 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/5 v2] ARM: pxa: Fix suspend/resume array index miscalculation 2011-01-10 23:46 ` Marek Vasut @ 2011-01-11 22:45 ` Eric Miao 0 siblings, 0 replies; 12+ messages in thread From: Eric Miao @ 2011-01-11 22:45 UTC (permalink / raw) To: linux-arm-kernel On Mon, Jan 10, 2011 at 5:46 PM, Marek Vasut <marek.vasut@gmail.com> wrote: > On Tuesday 11 January 2011 00:41:26 Eric Miao wrote: >> On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut <marek.vasut@gmail.com> wrote: >> > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> >> > --- >> > v2: Fix loop condition as proposed by Sergei >> > >> > ?arch/arm/mach-pxa/irq.c | ? ?8 ++++---- >> > ?1 files changed, 4 insertions(+), 4 deletions(-) >> > >> > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c >> > index 78f0e0c..a7deff5 100644 >> > --- a/arch/arm/mach-pxa/irq.c >> > +++ b/arch/arm/mach-pxa/irq.c >> > @@ -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); >> >> I prefer it to be IRQ number based instead of IRQ bank based, >> >> in other word, I'd rather to change the statement below: >> > ? ? ? ? ? ? ? ?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. >> >> > @@ -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 > ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() 2011-01-10 22:53 [PATCH 1/5 resend] pxa: Fix warning in zeus.c Marek Vasut ` (2 preceding siblings ...) 2011-01-10 22:53 ` [PATCH 4/5 v2] ARM: pxa: Fix suspend/resume array index miscalculation Marek Vasut @ 2011-01-10 22:53 ` Marek Vasut 2011-01-11 23:16 ` Eric Miao 2011-01-12 12:48 ` Sergei Shtylyov 3 siblings, 2 replies; 12+ messages in thread From: Marek Vasut @ 2011-01-10 22:53 UTC (permalink / raw) To: linux-arm-kernel Signed-off-by: Marek Vasut <marek.vasut@gmail.com> --- v2: Remove dead code as proposed by Sergei arch/arm/mach-pxa/irq.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index a7deff5..76e69cf 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -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 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() 2011-01-10 22:53 ` [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() Marek Vasut @ 2011-01-11 23:16 ` Eric Miao 2011-01-12 22:29 ` Marek Vasut 2011-01-12 22:30 ` Marek Vasut 2011-01-12 12:48 ` Sergei Shtylyov 1 sibling, 2 replies; 12+ messages in thread From: Eric Miao @ 2011-01-11 23:16 UTC (permalink / raw) To: linux-arm-kernel 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. diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index a7deff5..6107253 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c @@ -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; On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut <marek.vasut@gmail.com> wrote: > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> > --- > v2: Remove dead code as proposed by Sergei > > ?arch/arm/mach-pxa/irq.c | ? ?8 ++------ > ?1 files changed, 2 insertions(+), 6 deletions(-) > > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > index a7deff5..76e69cf 100644 > --- a/arch/arm/mach-pxa/irq.c > +++ b/arch/arm/mach-pxa/irq.c > @@ -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 > > ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() 2011-01-11 23:16 ` Eric Miao @ 2011-01-12 22:29 ` Marek Vasut 2011-01-12 22:30 ` Marek Vasut 1 sibling, 0 replies; 12+ messages in thread From: Marek Vasut @ 2011-01-12 22:29 UTC (permalink / raw) To: linux-arm-kernel 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. > > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > index a7deff5..6107253 100644 > --- a/arch/arm/mach-pxa/irq.c > +++ b/arch/arm/mach-pxa/irq.c > @@ -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; Way better indeed Acked-by: Marek Vasut <marek.vasut@gmail.com> > > On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut <marek.vasut@gmail.com> wrote: > > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> > > --- > > v2: Remove dead code as proposed by Sergei > > > > arch/arm/mach-pxa/irq.c | 8 ++------ > > 1 files changed, 2 insertions(+), 6 deletions(-) > > > > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > > index a7deff5..76e69cf 100644 > > --- a/arch/arm/mach-pxa/irq.c > > +++ b/arch/arm/mach-pxa/irq.c > > @@ -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 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() 2011-01-11 23:16 ` Eric Miao 2011-01-12 22:29 ` Marek Vasut @ 2011-01-12 22:30 ` Marek Vasut 1 sibling, 0 replies; 12+ messages in thread From: Marek Vasut @ 2011-01-12 22:30 UTC (permalink / raw) To: linux-arm-kernel 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-by: Marek Vasut <marek.vasut@gmail.com> Tested on Zipit Z2 > > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > index a7deff5..6107253 100644 > --- a/arch/arm/mach-pxa/irq.c > +++ b/arch/arm/mach-pxa/irq.c > @@ -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; > > On Mon, Jan 10, 2011 at 4:53 PM, Marek Vasut <marek.vasut@gmail.com> wrote: > > Signed-off-by: Marek Vasut <marek.vasut@gmail.com> > > --- > > v2: Remove dead code as proposed by Sergei > > > > arch/arm/mach-pxa/irq.c | 8 ++------ > > 1 files changed, 2 insertions(+), 6 deletions(-) > > > > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > > index a7deff5..76e69cf 100644 > > --- a/arch/arm/mach-pxa/irq.c > > +++ b/arch/arm/mach-pxa/irq.c > > @@ -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 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() 2011-01-10 22:53 ` [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() Marek Vasut 2011-01-11 23:16 ` Eric Miao @ 2011-01-12 12:48 ` Sergei Shtylyov 1 sibling, 0 replies; 12+ messages in thread From: Sergei Shtylyov @ 2011-01-12 12:48 UTC (permalink / raw) To: linux-arm-kernel Hello. On 11-01-2011 1:53, Marek Vasut wrote: > Signed-off-by: Marek Vasut<marek.vasut@gmail.com> > --- > v2: Remove dead code as proposed by Sergei > arch/arm/mach-pxa/irq.c | 8 ++------ > 1 files changed, 2 insertions(+), 6 deletions(-) > diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c > index a7deff5..76e69cf 100644 > --- a/arch/arm/mach-pxa/irq.c > +++ b/arch/arm/mach-pxa/irq.c > @@ -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 = { 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 ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-01-12 22:30 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-01-10 22:53 [PATCH 1/5 resend] pxa: Fix warning in zeus.c Marek Vasut 2011-01-10 22:53 ` [PATCH 2/5 resend] pxa: Remove unused variable in clock-pxa3xx.c Marek Vasut 2011-01-10 22:53 ` [PATCH 3/5 resend] ARM: pxa: Use cpu_has_ipr() consistently in irq.c Marek Vasut 2011-01-10 22:53 ` [PATCH 4/5 v2] ARM: pxa: Fix suspend/resume array index miscalculation Marek Vasut 2011-01-10 23:41 ` Eric Miao 2011-01-10 23:46 ` Marek Vasut 2011-01-11 22:45 ` Eric Miao 2011-01-10 22:53 ` [PATCH 5/5 v2] ARM: pxa: Fix recursive call of pxa_(un)mask_low_gpio() Marek Vasut 2011-01-11 23:16 ` Eric Miao 2011-01-12 22:29 ` Marek Vasut 2011-01-12 22:30 ` Marek Vasut 2011-01-12 12:48 ` Sergei Shtylyov
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).