Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83c6590cb83d3106df12fee36ac2a261951b8c88
Commit:     83c6590cb83d3106df12fee36ac2a261951b8c88
Parent:     621e59a771f310358ade8f14cb745d5d5f1c410e
Author:     David Brownell <[EMAIL PROTECTED]>
AuthorDate: Wed May 16 22:11:13 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu May 17 05:23:05 2007 -0700

    gpio interface loosens call restrictions
    
    Loosen gpio_{request,free}() and gpio_direction_{in,out}put() call context
    restrictions slightly, so a common idiom is no longer an error: board init
    code setting up spinlock-safe GPIOs before tasking is enabled.
    
    The issue was caught by some paranoid code with might_sleep() checks.  The
    legacy platform-specific GPIO interfaces stick to spinlock-safe GPIOs, so 
this
    change reflects current implementations and won't break anything.
    
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 Documentation/gpio.txt |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index e8be0ab..36af58e 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -111,7 +111,9 @@ setting up a platform_device using the GPIO, is mark its 
direction:
 
 The return value is zero for success, else a negative errno.  It should
 be checked, since the get/set calls don't have error returns and since
-misconfiguration is possible.  (These calls could sleep.)
+misconfiguration is possible.  You should normally issue these calls from
+a task context.  However, for spinlock-safe GPIOs it's OK to use them
+before tasking is enabled, as part of early board setup.
 
 For output GPIOs, the value provided becomes the initial output value.
 This helps avoid signal glitching during system startup.
@@ -197,7 +199,9 @@ However, many platforms don't currently support this 
mechanism.
 
 Passing invalid GPIO numbers to gpio_request() will fail, as will requesting
 GPIOs that have already been claimed with that call.  The return value of
-gpio_request() must be checked.  (These calls could sleep.)
+gpio_request() must be checked.  You should normally issue these calls from
+a task context.  However, for spinlock-safe GPIOs it's OK to request GPIOs
+before tasking is enabled, as part of early board setup.
 
 These calls serve two basic purposes.  One is marking the signals which
 are actually in use as GPIOs, for better diagnostics; systems may have
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to