Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] gpio_free might sleep, mips architecture
       [not found]   ` <1221508963-27259-2-git-send-email-ukleinek@informatik.uni-freiburg.de>
@ 2008-09-15 20:02     ` Uwe Kleine-König
  2008-09-17 21:39       ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2008-09-15 20:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: David Brownell, Ralf Baechle, linux-mips, Guennadi Liakhovetski,
	Greg KH, Kay Sievers, Andrew Morton, Russell King

According to the documentation gpio_free should only be called from task
context only.  To make this more explicit add a might sleep to all
implementations.

This patch changes the gpio_free implementations for the mips
architecture.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Cc: David Brownell <david-b@pacbell.net>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Cc: Greg KH <greg@kroah.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
---
 include/asm-mips/mach-au1x00/gpio.h  |    2 ++
 include/asm-mips/mach-bcm47xx/gpio.h |    3 +++
 include/asm-mips/mach-rc32434/gpio.h |    2 ++
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/asm-mips/mach-au1x00/gpio.h b/include/asm-mips/mach-au1x00/gpio.h
index 2dc61e0..31eddba 100644
--- a/include/asm-mips/mach-au1x00/gpio.h
+++ b/include/asm-mips/mach-au1x00/gpio.h
@@ -1,6 +1,7 @@
 #ifndef _AU1XXX_GPIO_H_
 #define _AU1XXX_GPIO_H_
 
+#include <linux/kernel.h>
 #include <linux/types.h>
 
 #define AU1XXX_GPIO_BASE	200
@@ -31,6 +32,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
 static inline void gpio_free(unsigned gpio)
 {
 	/* Not yet implemented */
+	might_sleep();
 }
 
 static inline int gpio_direction_input(unsigned gpio)
diff --git a/include/asm-mips/mach-bcm47xx/gpio.h b/include/asm-mips/mach-bcm47xx/gpio.h
index cfc8f4d..af17ccd 100644
--- a/include/asm-mips/mach-bcm47xx/gpio.h
+++ b/include/asm-mips/mach-bcm47xx/gpio.h
@@ -9,6 +9,8 @@
 #ifndef __BCM47XX_GPIO_H
 #define __BCM47XX_GPIO_H
 
+#include <linux/kernel.h>
+
 #define BCM47XX_EXTIF_GPIO_LINES	5
 #define BCM47XX_CHIPCO_GPIO_LINES	16
 
@@ -25,6 +27,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
 
 static inline void gpio_free(unsigned gpio)
 {
+	might_sleep();
 }
 
 static inline int gpio_to_irq(unsigned gpio)
diff --git a/include/asm-mips/mach-rc32434/gpio.h b/include/asm-mips/mach-rc32434/gpio.h
index f946f5f..9b4722e 100644
--- a/include/asm-mips/mach-rc32434/gpio.h
+++ b/include/asm-mips/mach-rc32434/gpio.h
@@ -13,6 +13,7 @@
 #ifndef _RC32434_GPIO_H_
 #define _RC32434_GPIO_H_
 
+#include <linux/kernel.h>
 #include <linux/types.h>
 
 struct rb532_gpio_reg {
@@ -88,6 +89,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
 static inline void gpio_free(unsigned gpio)
 {
 	/* Not yet implemented */
+	might_sleep();
 }
 
 static inline int gpio_direction_input(unsigned gpio)
-- 
1.5.6.5

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

* Re: [PATCH] gpio_free might sleep, mips architecture
  2008-09-15 20:02     ` [PATCH] gpio_free might sleep, mips architecture Uwe Kleine-König
@ 2008-09-17 21:39       ` Andrew Morton
  2008-09-18  9:32         ` Uwe Kleine-König
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2008-09-17 21:39 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-kernel, david-b, ralf, linux-mips, g.liakhovetski, greg,
	kay.sievers, rmk+kernel

On Mon, 15 Sep 2008 22:02:41 +0200
Uwe Kleine-K__nig <ukleinek@informatik.uni-freiburg.de> wrote:

> According to the documentation gpio_free should only be called from task
> context only.  To make this more explicit add a might sleep to all
> implementations.
> 
> This patch changes the gpio_free implementations for the mips
> architecture.
> 
> Signed-off-by: Uwe Kleine-K__nig <ukleinek@informatik.uni-freiburg.de>
> Cc: David Brownell <david-b@pacbell.net>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: linux-mips@linux-mips.org
> Cc: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
> Cc: Greg KH <greg@kroah.com>
> Cc: Kay Sievers <kay.sievers@vrfy.org>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  include/asm-mips/mach-au1x00/gpio.h  |    2 ++
>  include/asm-mips/mach-bcm47xx/gpio.h |    3 +++
>  include/asm-mips/mach-rc32434/gpio.h |    2 ++
>  3 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/include/asm-mips/mach-au1x00/gpio.h b/include/asm-mips/mach-au1x00/gpio.h
> index 2dc61e0..31eddba 100644
> --- a/include/asm-mips/mach-au1x00/gpio.h
> +++ b/include/asm-mips/mach-au1x00/gpio.h
> @@ -1,6 +1,7 @@
>  #ifndef _AU1XXX_GPIO_H_
>  #define _AU1XXX_GPIO_H_
>  
> +#include <linux/kernel.h>
>  #include <linux/types.h>
>  
>  #define AU1XXX_GPIO_BASE	200
> @@ -31,6 +32,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
>  static inline void gpio_free(unsigned gpio)
>  {
>  	/* Not yet implemented */
> +	might_sleep();
>  }
>  
>  static inline int gpio_direction_input(unsigned gpio)
> diff --git a/include/asm-mips/mach-bcm47xx/gpio.h b/include/asm-mips/mach-bcm47xx/gpio.h
> index cfc8f4d..af17ccd 100644
> --- a/include/asm-mips/mach-bcm47xx/gpio.h
> +++ b/include/asm-mips/mach-bcm47xx/gpio.h
> @@ -9,6 +9,8 @@
>  #ifndef __BCM47XX_GPIO_H
>  #define __BCM47XX_GPIO_H
>  
> +#include <linux/kernel.h>
> +
>  #define BCM47XX_EXTIF_GPIO_LINES	5
>  #define BCM47XX_CHIPCO_GPIO_LINES	16
>  
> @@ -25,6 +27,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
>  
>  static inline void gpio_free(unsigned gpio)
>  {
> +	might_sleep();
>  }
>  
>  static inline int gpio_to_irq(unsigned gpio)
> diff --git a/include/asm-mips/mach-rc32434/gpio.h b/include/asm-mips/mach-rc32434/gpio.h
> index f946f5f..9b4722e 100644
> --- a/include/asm-mips/mach-rc32434/gpio.h
> +++ b/include/asm-mips/mach-rc32434/gpio.h
> @@ -13,6 +13,7 @@
>  #ifndef _RC32434_GPIO_H_
>  #define _RC32434_GPIO_H_
>  
> +#include <linux/kernel.h>
>  #include <linux/types.h>
>  
>  struct rb532_gpio_reg {
> @@ -88,6 +89,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
>  static inline void gpio_free(unsigned gpio)
>  {
>  	/* Not yet implemented */
> +	might_sleep();
>  }
>  

There is no gpio_free() in linux-next's include/asm-mips/mach-rc32434/gpio.h

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

* Re: [PATCH] gpio_free might sleep, mips architecture
  2008-09-17 21:39       ` Andrew Morton
@ 2008-09-18  9:32         ` Uwe Kleine-König
  2008-09-18 13:59           ` Ralf Baechle
  0 siblings, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2008-09-18  9:32 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, david-b, ralf, linux-mips, g.liakhovetski, greg,
	kay.sievers, rmk+kernel

Hello,

Andrew Morton wrote:
> > diff --git a/include/asm-mips/mach-rc32434/gpio.h b/include/asm-mips/mach-rc32434/gpio.h
> > index f946f5f..9b4722e 100644
> > --- a/include/asm-mips/mach-rc32434/gpio.h
> > +++ b/include/asm-mips/mach-rc32434/gpio.h
> > @@ -13,6 +13,7 @@
> >  #ifndef _RC32434_GPIO_H_
> >  #define _RC32434_GPIO_H_
> >  
> > +#include <linux/kernel.h>
> >  #include <linux/types.h>
> >  
> >  struct rb532_gpio_reg {
> > @@ -88,6 +89,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
> >  static inline void gpio_free(unsigned gpio)
> >  {
> >  	/* Not yet implemented */
> > +	might_sleep();
> >  }
> >  
> 
> There is no gpio_free() in linux-next's include/asm-mips/mach-rc32434/gpio.h
This is OK.  This machine type is converted to GPIO lib in linus-next.
So just drop the two hunks for this file.  (Note, you only dropped the
addition of might_sleep, but then including linux/kernel.h isn't needed
either.)

Best regards and thanks
Uwe

-- 
Uwe Kleine-König

exit vi, lesson II:
: w q ! <CR>

NB: write the current file

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

* Re: [PATCH] gpio_free might sleep, mips architecture
  2008-09-18  9:32         ` Uwe Kleine-König
@ 2008-09-18 13:59           ` Ralf Baechle
  0 siblings, 0 replies; 4+ messages in thread
From: Ralf Baechle @ 2008-09-18 13:59 UTC (permalink / raw)
  To: Uwe Kleine-König, Andrew Morton, linux-kernel, david-b,
	linux-mips, g.liakhovetski, greg, kay.sievers, rmk+kernel

On Thu, Sep 18, 2008 at 11:32:42AM +0200, Uwe Kleine-König wrote:

> Andrew Morton wrote:
> > > diff --git a/include/asm-mips/mach-rc32434/gpio.h b/include/asm-mips/mach-rc32434/gpio.h
> > > index f946f5f..9b4722e 100644
> > > --- a/include/asm-mips/mach-rc32434/gpio.h
> > > +++ b/include/asm-mips/mach-rc32434/gpio.h
> > > @@ -13,6 +13,7 @@
> > >  #ifndef _RC32434_GPIO_H_
> > >  #define _RC32434_GPIO_H_
> > >  
> > > +#include <linux/kernel.h>
> > >  #include <linux/types.h>
> > >  
> > >  struct rb532_gpio_reg {
> > > @@ -88,6 +89,7 @@ static inline int gpio_request(unsigned gpio, const char *label)
> > >  static inline void gpio_free(unsigned gpio)
> > >  {
> > >  	/* Not yet implemented */
> > > +	might_sleep();
> > >  }
> > >  
> > 
> > There is no gpio_free() in linux-next's include/asm-mips/mach-rc32434/gpio.h
> This is OK.  This machine type is converted to GPIO lib in linus-next.
> So just drop the two hunks for this file.  (Note, you only dropped the
> addition of might_sleep, but then including linux/kernel.h isn't needed
> either.)

A few days ago I've put a patch to move include/asm-mips/ to arch/ like
several other architectures already did so you patch may conflict ...

  Ralf

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

end of thread, other threads:[~2008-09-18 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1216884515-12084-1-git-send-email-Uwe.Kleine-Koenig@digi.com>
     [not found] ` <1221508963-27259-1-git-send-email-ukleinek@informatik.uni-freiburg.de>
     [not found]   ` <1221508963-27259-2-git-send-email-ukleinek@informatik.uni-freiburg.de>
2008-09-15 20:02     ` [PATCH] gpio_free might sleep, mips architecture Uwe Kleine-König
2008-09-17 21:39       ` Andrew Morton
2008-09-18  9:32         ` Uwe Kleine-König
2008-09-18 13:59           ` Ralf Baechle

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