+ gpio_free-might-sleep-generic-part.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     gpio_free might sleep, generic part
has been added to the -mm tree.  Its filename is
     gpio_free-might-sleep-generic-part.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: gpio_free might sleep, generic part
From: Uwe Kleine-König <ukleinek@xxxxxxxxxxxxxxxxxxxxxxxxxx>

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 is the generic part which changes gpiolib and the fallback
implementation only.

Signed-off-by: Uwe Kleine-König <ukleinek@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Cc: David Brownell <david-b@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/gpio/gpiolib.c |    2 ++
 include/linux/gpio.h   |    3 +++
 2 files changed, 5 insertions(+)

diff -puN drivers/gpio/gpiolib.c~gpio_free-might-sleep-generic-part drivers/gpio/gpiolib.c
--- a/drivers/gpio/gpiolib.c~gpio_free-might-sleep-generic-part
+++ a/drivers/gpio/gpiolib.c
@@ -792,6 +792,8 @@ void gpio_free(unsigned gpio)
 	unsigned long		flags;
 	struct gpio_desc	*desc;
 
+	might_sleep();
+
 	if (!gpio_is_valid(gpio)) {
 		WARN_ON(extra_checks);
 		return;
diff -puN include/linux/gpio.h~gpio_free-might-sleep-generic-part include/linux/gpio.h
--- a/include/linux/gpio.h~gpio_free-might-sleep-generic-part
+++ a/include/linux/gpio.h
@@ -8,6 +8,7 @@
 
 #else
 
+#include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/errno.h>
 
@@ -32,6 +33,8 @@ static inline int gpio_request(unsigned 
 
 static inline void gpio_free(unsigned gpio)
 {
+	might_sleep();
+
 	/* GPIO can never have been requested */
 	WARN_ON(1);
 }
_

Patches currently in -mm which might be from ukleinek@xxxxxxxxxxxxxxxxxxxxxxxxxx are

linux-next.patch
snd-aica-platform-driver-fix-section-mismatch.patch
gpio_free-might-sleep-generic-part.patch
gpio_free-might-sleep-arm-architecture.patch
gpio_free-might-sleep-mips-architecture.patch
gpio_free-might-sleep-blackfin-architecture.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux