public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 02/23] arm: tegra: Remove unused function which fiddles with irq_desc
       [not found] <20110325131617.258789658@linutronix.de>
@ 2011-03-25 13:21 ` Thomas Gleixner
       [not found]   ` <20110325132047.552074703-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2011-03-25 13:21 UTC (permalink / raw)
  To: LKML; +Cc: linux-tegra, Russell King, Lennert Buytenhek, LAK, Colin Cross

[-- Attachment #1: arm-tegra.patch --]
[-- Type: text/plain, Size: 3314 bytes --]

These functions are unused and in the way of cleanups in the core
code. If you have special requirements vs. irqs and PM then please
talk to me. Access to the generic core internals is going away.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Colin Cross <ccross@android.com>
Cc: linux-tegra@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
---
 arch/arm/mach-tegra/gpio.c                 |   63 -----------------------------
 arch/arm/mach-tegra/include/mach/suspend.h |    2 
 2 files changed, 65 deletions(-)

Index: linux-2.6/arch/arm/mach-tegra/gpio.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-tegra/gpio.c
+++ linux-2.6/arch/arm/mach-tegra/gpio.c
@@ -254,69 +254,6 @@ static void tegra_gpio_irq_handler(unsig
 }
 
 #ifdef CONFIG_PM
-void tegra_gpio_resume(void)
-{
-	unsigned long flags;
-	int b, p, i;
-
-	local_irq_save(flags);
-
-	for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) {
-		struct tegra_gpio_bank *bank = &tegra_gpio_banks[b];
-
-		for (p = 0; p < ARRAY_SIZE(bank->oe); p++) {
-			unsigned int gpio = (b<<5) | (p<<3);
-			__raw_writel(bank->cnf[p], GPIO_CNF(gpio));
-			__raw_writel(bank->out[p], GPIO_OUT(gpio));
-			__raw_writel(bank->oe[p], GPIO_OE(gpio));
-			__raw_writel(bank->int_lvl[p], GPIO_INT_LVL(gpio));
-			__raw_writel(bank->int_enb[p], GPIO_INT_ENB(gpio));
-		}
-	}
-
-	local_irq_restore(flags);
-
-	for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
-		struct irq_desc *desc = irq_to_desc(i);
-		if (!desc || (desc->status & IRQ_WAKEUP))
-			continue;
-		enable_irq(i);
-	}
-}
-
-void tegra_gpio_suspend(void)
-{
-	unsigned long flags;
-	int b, p, i;
-
-	for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
-		struct irq_desc *desc = irq_to_desc(i);
-		if (!desc)
-			continue;
-		if (desc->status & IRQ_WAKEUP) {
-			int gpio = i - INT_GPIO_BASE;
-			pr_debug("gpio %d.%d is wakeup\n", gpio/8, gpio&7);
-			continue;
-		}
-		disable_irq(i);
-	}
-
-	local_irq_save(flags);
-	for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) {
-		struct tegra_gpio_bank *bank = &tegra_gpio_banks[b];
-
-		for (p = 0; p < ARRAY_SIZE(bank->oe); p++) {
-			unsigned int gpio = (b<<5) | (p<<3);
-			bank->cnf[p] = __raw_readl(GPIO_CNF(gpio));
-			bank->out[p] = __raw_readl(GPIO_OUT(gpio));
-			bank->oe[p] = __raw_readl(GPIO_OE(gpio));
-			bank->int_enb[p] = __raw_readl(GPIO_INT_ENB(gpio));
-			bank->int_lvl[p] = __raw_readl(GPIO_INT_LVL(gpio));
-		}
-	}
-	local_irq_restore(flags);
-}
-
 static int tegra_gpio_wake_enable(struct irq_data *d, unsigned int enable)
 {
 	struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d);
Index: linux-2.6/arch/arm/mach-tegra/include/mach/suspend.h
===================================================================
--- linux-2.6.orig/arch/arm/mach-tegra/include/mach/suspend.h
+++ linux-2.6/arch/arm/mach-tegra/include/mach/suspend.h
@@ -23,14 +23,12 @@
 
 void tegra_pinmux_suspend(void);
 void tegra_irq_suspend(void);
-void tegra_gpio_suspend(void);
 void tegra_clk_suspend(void);
 void tegra_dma_suspend(void);
 void tegra_timer_suspend(void);
 
 void tegra_pinmux_resume(void);
 void tegra_irq_resume(void);
-void tegra_gpio_resume(void);
 void tegra_clk_resume(void);
 void tegra_dma_resume(void);
 void tegra_timer_resume(void);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 02/23] arm: tegra: Remove unused function which fiddles with irq_desc
       [not found]   ` <20110325132047.552074703-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
@ 2011-03-26 20:12     ` Varun Wadekar
       [not found]       ` <4D8E4897.5030705-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Varun Wadekar @ 2011-03-26 20:12 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: LKML, LAK, Russell King, Lennert Buytenhek, Colin Cross,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org


Thomas, then how do you think we should handle restoring of gpio states
across suspend-resume cycles?

On Friday 25 March 2011 06:51 PM, Thomas Gleixner wrote:
> These functions are unused and in the way of cleanups in the core
> code. If you have special requirements vs. irqs and PM then please
> talk to me. Access to the generic core internals is going away.
>
> Signed-off-by: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
> Cc: Colin Cross <ccross-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org>
> Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> ---
>  arch/arm/mach-tegra/gpio.c                 |   63 -----------------------------
>  arch/arm/mach-tegra/include/mach/suspend.h |    2 
>  2 files changed, 65 deletions(-)
>
> Index: linux-2.6/arch/arm/mach-tegra/gpio.c
> ===================================================================
> --- linux-2.6.orig/arch/arm/mach-tegra/gpio.c
> +++ linux-2.6/arch/arm/mach-tegra/gpio.c
> @@ -254,69 +254,6 @@ static void tegra_gpio_irq_handler(unsig
>  }
>  
>  #ifdef CONFIG_PM
> -void tegra_gpio_resume(void)
> -{
> -	unsigned long flags;
> -	int b, p, i;
> -
> -	local_irq_save(flags);
> -
> -	for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) {
> -		struct tegra_gpio_bank *bank = &tegra_gpio_banks[b];
> -
> -		for (p = 0; p < ARRAY_SIZE(bank->oe); p++) {
> -			unsigned int gpio = (b<<5) | (p<<3);
> -			__raw_writel(bank->cnf[p], GPIO_CNF(gpio));
> -			__raw_writel(bank->out[p], GPIO_OUT(gpio));
> -			__raw_writel(bank->oe[p], GPIO_OE(gpio));
> -			__raw_writel(bank->int_lvl[p], GPIO_INT_LVL(gpio));
> -			__raw_writel(bank->int_enb[p], GPIO_INT_ENB(gpio));
> -		}
> -	}
> -
> -	local_irq_restore(flags);
> -
> -	for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
> -		struct irq_desc *desc = irq_to_desc(i);
> -		if (!desc || (desc->status & IRQ_WAKEUP))
> -			continue;
> -		enable_irq(i);
> -	}
> -}
> -
> -void tegra_gpio_suspend(void)
> -{
> -	unsigned long flags;
> -	int b, p, i;
> -
> -	for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
> -		struct irq_desc *desc = irq_to_desc(i);
> -		if (!desc)
> -			continue;
> -		if (desc->status & IRQ_WAKEUP) {
> -			int gpio = i - INT_GPIO_BASE;
> -			pr_debug("gpio %d.%d is wakeup\n", gpio/8, gpio&7);
> -			continue;
> -		}
> -		disable_irq(i);
> -	}
> -
> -	local_irq_save(flags);
> -	for (b = 0; b < ARRAY_SIZE(tegra_gpio_banks); b++) {
> -		struct tegra_gpio_bank *bank = &tegra_gpio_banks[b];
> -
> -		for (p = 0; p < ARRAY_SIZE(bank->oe); p++) {
> -			unsigned int gpio = (b<<5) | (p<<3);
> -			bank->cnf[p] = __raw_readl(GPIO_CNF(gpio));
> -			bank->out[p] = __raw_readl(GPIO_OUT(gpio));
> -			bank->oe[p] = __raw_readl(GPIO_OE(gpio));
> -			bank->int_enb[p] = __raw_readl(GPIO_INT_ENB(gpio));
> -			bank->int_lvl[p] = __raw_readl(GPIO_INT_LVL(gpio));
> -		}
> -	}
> -	local_irq_restore(flags);
> -}
> -
>  static int tegra_gpio_wake_enable(struct irq_data *d, unsigned int enable)
>  {
>  	struct tegra_gpio_bank *bank = irq_data_get_irq_chip_data(d);
> Index: linux-2.6/arch/arm/mach-tegra/include/mach/suspend.h
> ===================================================================
> --- linux-2.6.orig/arch/arm/mach-tegra/include/mach/suspend.h
> +++ linux-2.6/arch/arm/mach-tegra/include/mach/suspend.h
> @@ -23,14 +23,12 @@
>  
>  void tegra_pinmux_suspend(void);
>  void tegra_irq_suspend(void);
> -void tegra_gpio_suspend(void);
>  void tegra_clk_suspend(void);
>  void tegra_dma_suspend(void);
>  void tegra_timer_suspend(void);
>  
>  void tegra_pinmux_resume(void);
>  void tegra_irq_resume(void);
> -void tegra_gpio_resume(void);
>  void tegra_clk_resume(void);
>  void tegra_dma_resume(void);
>  void tegra_timer_resume(void);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 02/23] arm: tegra: Remove unused function which fiddles with irq_desc
       [not found]       ` <4D8E4897.5030705-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
@ 2011-03-26 20:24         ` Thomas Gleixner
       [not found]           ` <alpine.LFD.2.00.1103262118010.31464-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2011-03-26 20:24 UTC (permalink / raw)
  To: Varun Wadekar
  Cc: LKML, LAK, Russell King, Lennert Buytenhek, Colin Cross,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Sun, 27 Mar 2011, Varun Wadekar wrote:
> 
> Thomas, then how do you think we should handle restoring of gpio states
> across suspend-resume cycles?

That code is unused. Period. No caller, nothing nada. So what does it
handle?
 
> > -
> > -	for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
> > -		struct irq_desc *desc = irq_to_desc(i);
> > -		if (!desc || (desc->status & IRQ_WAKEUP))
> > -			continue;
> > -		enable_irq(i);
> > -	}

And this part is totally unacceptable and should have never been
merged. Further it is in the way of cleanups to the core code and as
there is no user I'm not willing to even think about what it does and
why it is there.

FYI, the core code deals with interrupt suspending/resuming
already. So if there is a problem with that which does not cover your
specific problem, then you better talk to me before hacking up such
private workarounds and expecting that I tolerate them in unused code.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 02/23] arm: tegra: Remove unused function which fiddles with irq_desc
       [not found]           ` <alpine.LFD.2.00.1103262118010.31464-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
@ 2011-03-26 22:37             ` Colin Cross
       [not found]               ` <AANLkTi=y9JkpJVCq5G151G9k3d0rAcSH13gi6uGB_gDX-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Colin Cross @ 2011-03-26 22:37 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Varun Wadekar, LKML, LAK, Russell King, Lennert Buytenhek,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

On Sat, Mar 26, 2011 at 1:24 PM, Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> wrote:
> On Sun, 27 Mar 2011, Varun Wadekar wrote:
>>
>> Thomas, then how do you think we should handle restoring of gpio states
>> across suspend-resume cycles?
>
> That code is unused. Period. No caller, nothing nada. So what does it
> handle?

Tegra suspend support didn't make it into 2.6.39, but should get
merged in 2.6.40, and will call tegra_gpio_suspend/resume.

>> > -
>> > -   for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
>> > -           struct irq_desc *desc = irq_to_desc(i);
>> > -           if (!desc || (desc->status & IRQ_WAKEUP))
>> > -                   continue;
>> > -           enable_irq(i);
>> > -   }
>
> And this part is totally unacceptable and should have never been
> merged. Further it is in the way of cleanups to the core code and as
> there is no user I'm not willing to even think about what it does and
> why it is there.
>
> FYI, the core code deals with interrupt suspending/resuming
> already. So if there is a problem with that which does not cover your
> specific problem, then you better talk to me before hacking up such
> private workarounds and expecting that I tolerate them in unused code.

Yes, the existing code wrong, and unnecessary.  It was copied from
mach-tegra/irq.c, which I later fixed, but I missed this one.  I'll
take this patch for 2.6.39-rc1, which will prevent merge conflicts
between your tree and the tegra tree in 2.6.40.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch 02/23] arm: tegra: Remove unused function which fiddles with irq_desc
       [not found]               ` <AANLkTi=y9JkpJVCq5G151G9k3d0rAcSH13gi6uGB_gDX-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-03-27  8:07                 ` Thomas Gleixner
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2011-03-27  8:07 UTC (permalink / raw)
  To: Colin Cross
  Cc: Varun Wadekar, LKML, LAK, Russell King, Lennert Buytenhek,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1756 bytes --]

On Sat, 26 Mar 2011, Colin Cross wrote:

> On Sat, Mar 26, 2011 at 1:24 PM, Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> wrote:
> > On Sun, 27 Mar 2011, Varun Wadekar wrote:
> >>
> >> Thomas, then how do you think we should handle restoring of gpio states
> >> across suspend-resume cycles?
> >
> > That code is unused. Period. No caller, nothing nada. So what does it
> > handle?
> 
> Tegra suspend support didn't make it into 2.6.39, but should get
> merged in 2.6.40, and will call tegra_gpio_suspend/resume.
> 
> >> > -
> >> > -   for (i = INT_GPIO_BASE; i < (INT_GPIO_BASE + TEGRA_NR_GPIOS); i++) {
> >> > -           struct irq_desc *desc = irq_to_desc(i);
> >> > -           if (!desc || (desc->status & IRQ_WAKEUP))
> >> > -                   continue;
> >> > -           enable_irq(i);
> >> > -   }
> >
> > And this part is totally unacceptable and should have never been
> > merged. Further it is in the way of cleanups to the core code and as
> > there is no user I'm not willing to even think about what it does and
> > why it is there.
> >
> > FYI, the core code deals with interrupt suspending/resuming
> > already. So if there is a problem with that which does not cover your
> > specific problem, then you better talk to me before hacking up such
> > private workarounds and expecting that I tolerate them in unused code.
> 
> Yes, the existing code wrong, and unnecessary.  It was copied from
> mach-tegra/irq.c, which I later fixed, but I missed this one.  I'll
> take this patch for 2.6.39-rc1, which will prevent merge conflicts
> between your tree and the tegra tree in 2.6.40.

You can keep the functions if you need them anyway, but the irq
fiddling needs to go now as it blocks core code cleanups.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-27  8:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20110325131617.258789658@linutronix.de>
2011-03-25 13:21 ` [patch 02/23] arm: tegra: Remove unused function which fiddles with irq_desc Thomas Gleixner
     [not found]   ` <20110325132047.552074703-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2011-03-26 20:12     ` Varun Wadekar
     [not found]       ` <4D8E4897.5030705-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2011-03-26 20:24         ` Thomas Gleixner
     [not found]           ` <alpine.LFD.2.00.1103262118010.31464-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2011-03-26 22:37             ` Colin Cross
     [not found]               ` <AANLkTi=y9JkpJVCq5G151G9k3d0rAcSH13gi6uGB_gDX-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-03-27  8:07                 ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox