Skip to content
Snippets Groups Projects
This project is mirrored from https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git. Pull mirroring updated .
  1. Nov 01, 2011
    • David Daney's avatar
      drivers/leds/leds-gpio.c: use gpio_get_value_cansleep() when initializing · dabc69c2
      David Daney authored
      
      I get the following warning:
      
      ------------[ cut here ]------------
      WARNING: at drivers/gpio/gpiolib.c:1559 __gpio_get_value+0x90/0x98()
      Modules linked in:
      Call Trace:
      [<ffffffff81440950>] dump_stack+0x8/0x34
      [<ffffffff81141478>] warn_slowpath_common+0x78/0xa0
      [<ffffffff812f0958>] __gpio_get_value+0x90/0x98
      [<ffffffff81434f04>] create_gpio_led+0xdc/0x194
      [<ffffffff8143524c>] gpio_led_probe+0x290/0x36c
      [<ffffffff8130e8b0>] driver_probe_device+0x78/0x1b0
      [<ffffffff8130eaa8>] __driver_attach+0xc0/0xc8
      [<ffffffff8130d7ac>] bus_for_each_dev+0x64/0xb0
      [<ffffffff8130e130>] bus_add_driver+0x1c8/0x2a8
      [<ffffffff8130f100>] driver_register+0x90/0x180
      [<ffffffff81100438>] do_one_initcall+0x38/0x160
      
      ---[ end trace ee38723fbefcd65c ]---
      
      My GPIOs are on an I2C port expander, so we must use the *_cansleep()
      variant of the GPIO functions.  This is was not being done in
      create_gpio_led().
      
      We can change gpio_get_value() to gpio_get_value_cansleep() because it is
      only called from the platform_driver probe function, which is a context
      where we can sleep.
      
      Only tested on my gpio_cansleep() system, but it seems safe for all
      systems.
      
      Signed-off-by: default avatarDavid Daney <david.daney@cavium.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Acked-by: default avatarTrent Piepho <tpiepho@gmail.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      dabc69c2
  2. Jun 03, 2011
  3. Feb 28, 2011
  4. Nov 12, 2010
  5. Aug 06, 2010
  6. May 28, 2010
  7. May 26, 2010
  8. May 22, 2010
    • Grant Likely's avatar
      of: Remove duplicate fields from of_platform_driver · 4018294b
      Grant Likely authored
      
      .name, .match_table and .owner are duplicated in both of_platform_driver
      and device_driver.  This patch is a removes the extra copies from struct
      of_platform_driver and converts all users to the device_driver members.
      
      This patch is a pretty mechanical change.  The usage model doesn't change
      and if any drivers have been missed, or if anything has been fixed up
      incorrectly, then it will fail with a compile time error, and the fixup
      will be trivial.  This patch looks big and scary because it touches so
      many files, but it should be pretty safe.
      
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Acked-by: default avatarSean MacLennan <smaclennan@pikatech.com>
      4018294b
  9. May 18, 2010
  10. Mar 30, 2010
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  11. Mar 16, 2010
  12. Nov 16, 2009
  13. Sep 07, 2009
  14. Jun 23, 2009
    • Trent Piepho's avatar
      leds: Add options to have GPIO LEDs start on or keep their state · ed88bae6
      Trent Piepho authored
      
      There already is a "default-on" trigger but there are problems with it.
      
      For one, it's a inefficient way to do it and requires led trigger support
      to be compiled in.
      
      But the real reason is that is produces a glitch on the LED.  The GPIO is
      allocate with the LED *off*, then *later* when the trigger runs it is
      turned back on.  If the LED was already on via the GPIO's reset default or
      action of the firmware, this produces a glitch where the LED goes from on
      to off to on.  While normally this is fast enough that it wouldn't be
      noticeable to a human observer, there are still serious problems.
      
      One is that there may be something else on the GPIO line, like a hardware
      alarm or watchdog, that is fast enough to notice the glitch.
      
      Another is that the kernel may panic before the LED is turned back on, thus
      hanging with the LED in the wrong state.  This is not just speculation, but
      actually happened to me with an embedded system that has an LED which
      should turn off when the kernel finishes booting, which was left in the
      incorrect state due to a bug in the OF LED binding code.
      
      We also let GPIO LEDs get their initial value from whatever the current
      state of the GPIO line is.  On some systems the LEDs are put into some
      state by the firmware or hardware before Linux boots, and it is desired to
      have them keep this state which is otherwise unknown to Linux.
      
      This requires that the underlying GPIO driver support reading the value of
      output GPIOs.  Some drivers support this and some do not.
      
      The platform device binding gains a field in the platform data
      "default_state" that controls this.  There are three constants defined to
      select from on, off, or keeping the current state.  The OpenFirmware
      binding uses a property named "default-state" that can be set to "on",
      "off", or "keep".  The default if the property isn't present is off.
      
      Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
      Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      Acked-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Acked-by: default avatarSean MacLennan <smaclennan@pikatech.com>
      Signed-off-by: default avatarRichard Purdie <rpurdie@linux.intel.com>
      ed88bae6
    • Zhenwen Xu's avatar
      leds: leds-gpio - fix a section mismatch · 7fd02170
      Zhenwen Xu authored
      
      WARNING: drivers/leds/leds-gpio.o(.text+0x153): Section mismatch in reference from the function gpio_led_probe() to the function .devinit.text:create_gpio_led()
      
      The function gpio_led_probe() references the function __devinit
      create_gpio_led().  This is often because gpio_led_probe lacks a __devinit
      annotation or the annotation of create_gpio_led is wrong.
      
      Signed-off-by: default avatarZhenwen Xu <helight.xu@gmail.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarRichard Purdie <rpurdie@linux.intel.com>
      7fd02170
  15. Apr 08, 2009
  16. Apr 06, 2009
  17. Jan 08, 2009
    • Richard Purdie's avatar
      leds: Add suspend/resume to the core class · 859cb7f2
      Richard Purdie authored
      Add suspend/resume to the core class and remove all the now unneeded
      code from various drivers. Originally the class code couldn't support
      suspend/resume but since class_device can there is no reason for
      each driver doing its own suspend/resume anymore.
      859cb7f2
  18. Apr 24, 2008
  19. Apr 16, 2008
  20. Mar 31, 2008
  21. Feb 07, 2008
  22. Nov 05, 2007
    • David Brownell's avatar
      leds: bugfixes for leds-gpio · 199fb21d
      David Brownell authored
      
      Three bugfixes to the leds-gpio driver, plus minor whitespace tweaks:
      
       - Do the INIT_WORK() before registering each LED, so if its trigger
         becomes immediately active it can schedule work without oopsing..
      
       - Use normal registration, not platform_driver_probe(), so that
         devices appearing "late" (hotplug type) can still be bound.
      
       - Mark the driver remove code as "__devexit", preventing oopses
         when the underlying device is removed.
      
      These issues came up when using this driver with some GPIO expanders
      living on serial busses, which act unlike "normal" platform devices:
      they can appear and vanish along with the serial bus driver.
      
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarRichard Purdie <rpurdie@rpsys.net>
      199fb21d
  23. Jul 16, 2007
Loading