01 Nov, 2011

40 commits

  • __bitmap_parse() and __bitmap_parselist() both take a pointer to a kernel
    buffer as a parameter and then cast it to a pointer to user buffer for use
    in cases when the parameter is_user indicates that the buffer is actually
    located in user space. This casting, and the casts in the callers,
    results in sparse noise like the following:

    warning: incorrect type in initializer (different address spaces)
    expected char const [noderef] *ubuf
    got char const *buf
    warning: cast removes address space of expression

    Since these casts are intentional, use __force to quiet the noise.

    Signed-off-by: H Hartley Sweeten
    Cc: Len Brown
    Cc: Huang Ying
    Cc: Andy Shevchenko
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    H Hartley Sweeten
     
  • When SPIN_BUG_ON is triggered, the lock owner information is reported.
    But it is omitted when spinlock lockup is detected.

    This information is useful especially on the architectures which don't
    implement trigger_all_cpu_backtrace() that is called just after detecting
    lockup. So report it and also avoid message format duplication.

    Signed-off-by: Akinobu Mita
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Currently termination logic (\0 or \n\0) is hardcoded in _kstrtoull(),
    avoid that for code reuse between kstrto*() and simple_strtoull().
    Essentially, make them different only in termination logic.

    simple_strtoull() (and scanf(), BTW) ignores integer overflow, that's a
    bug we currently don't have guts to fix, making KSTRTOX_OVERFLOW hack
    necessary.

    Almost forgot: patch shrinks code size by about ~80 bytes on x86_64.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Make sure that the reset is successful by issuing a dummy read to R
    channel current register and check its default value. On some platforms,
    without this dummy read, any further access to {R/G/B}_EXEC will not have
    any impact.

    [akpm@linux-foundation.org: fix up code comment]
    Signed-off-by: srinidhi kasagar
    Tested-by: Naga Radhesh
    Acked-by: Linus Walleij
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Srinidhi KASAGAR
     
  • Depending on the implementation of the hardware blinking function in
    blink_set(), the led can support hardware blinking for some values of
    delay_on and delay_off and fall-back to software blinking for some other
    values.

    Turning off the blink_timer unconditionally before starting to blink
    make sure that a sequence like:

    OFF
    hardware blinking
    software blinking
    hardware blinking

    does not leave the software blinking timer active.

    Signed-off-by: Antonio Ospite
    Reviewed-by: Johannes Berg
    Cc: Richard Purdie
    Cc:
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Antonio Ospite
     
  • When calling the hardware blinking function implemented by blink_set(),
    the delay_on and delay_off values are not preserved across calls.

    Fix that and make the "timer" trigger work as expected when hardware
    blinking is available.

    BEFORE the fix:
    $ cd /sys/class/leds/someled
    $ echo timer > trigger
    $ cat delay_on delay_off
    0
    0
    $ echo 100 > delay_on
    $ cat delay_on delay_off
    0
    0
    $ echo 100 > delay_off
    $ cat delay_on delay_off
    0
    0

    AFTER the fix:
    $ cd /sys/class/leds/someled
    $ echo timer > trigger
    $ cat delay_on delay_off
    0
    0
    $ echo 100 > delay_on
    $ cat delay_on delay_off
    100
    0
    $ echo 100 > delay_off
    $ cat delay_on delay_off
    100
    100

    Signed-off-by: Antonio Ospite
    Reviewed-by: Johannes Berg
    Cc: Richard Purdie
    Cc:
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Antonio Ospite
     
  • I get the following warning:

    ------------[ cut here ]------------
    WARNING: at drivers/gpio/gpiolib.c:1559 __gpio_get_value+0x90/0x98()
    Modules linked in:
    Call Trace:
    [] dump_stack+0x8/0x34
    [] warn_slowpath_common+0x78/0xa0
    [] __gpio_get_value+0x90/0x98
    [] create_gpio_led+0xdc/0x194
    [] gpio_led_probe+0x290/0x36c
    [] driver_probe_device+0x78/0x1b0
    [] __driver_attach+0xc0/0xc8
    [] bus_for_each_dev+0x64/0xb0
    [] bus_add_driver+0x1c8/0x2a8
    [] driver_register+0x90/0x180
    [] 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: David Daney
    Cc: Richard Purdie
    Acked-by: Trent Piepho
    Cc: Grant Likely
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Daney
     
  • According to the comments in include/linux/init.h:

    "Pointers to __devexit functions must use __devexit_p(function_name), the
    wrapper will insert either the function_name or NULL, depending on the config
    options."

    We have __devexit annotation for lm3530_remove(), so add __devexit_p to
    the `struct i2c_driver'.

    Signed-off-by: Axel Lin
    Cc: Shreshtha Kumar SAHU
    Cc: Richard Purdie
    Acked-by: Linus Walleij
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • If lp5521_read fails, engine_state variable is not initialized.
    If lp5521_read fails, we should return error.
    This patch fixes below warning.

    CC drivers/leds/leds-lp5521.o
    drivers/leds/leds-lp5521.c: In function 'lp5521_set_engine_mode':
    drivers/leds/leds-lp5521.c:168: warning: 'engine_state' may be used uninitialized in this function

    [akpm@linux-foundation.org: remove unneeded "ret |="]
    Signed-off-by: Axel Lin
    Cc: Samu Onkalo
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • Use the platform_data include directory for the TPU LED driver, as
    suggested by Paul Mundt.

    Signed-off-by: Magnus Damm
    Cc: Paul Mundt
    Cc: Richard Purdie
    Cc: Grant Likely
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Magnus Damm
     
  • Use a workqueue in the Renesas TPU LED driver to allow the Runtime PM code
    to sleep.

    Signed-off-by: Magnus Damm
    Cc: Paul Mundt
    Cc: Richard Purdie
    Cc: Grant Likely
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Magnus Damm
     
  • A few new i2c-drivers came into the kernel which clear the
    clientdata-pointer on exit or error. This is obsolete meanwhile, the core
    will do it.

    Signed-off-by: Wolfram Sang
    Cc: Richard Purdie
    Acked-by: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • The memory for struct led_trigger should be kfreed in the
    led_trigger_register() error path. Also this function should return NULL
    on error.

    Signed-off-by: Masakazu Mokuno
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masakazu Mokuno
     
  • Add V2 of the LED driver for a single timer channel for the TPU hardware
    block commonly found in Renesas SoCs.

    The driver has been written with optimal Power Management in mind, so to
    save power the LED is driven as a regular GPIO pin in case of maximum
    brightness and power off which allows the TPU hardware to be idle and
    which in turn allows the clocks to be stopped and the power domain to be
    turned off transparently.

    Any other brightness level requires use of the TPU hardware in PWM mode.
    TPU hardware device clocks and power are managed through Runtime PM.
    System suspend and resume is known to be working - during suspend the LED
    is set to off by the generic LED code.

    The TPU hardware timer is equipeed with a 16-bit counter together with an
    up-to-divide-by-64 prescaler which makes the hardware suitable for
    brightness control. Hardware blink is unsupported.

    The LED PWM waveform has been verified with a Fluke 123 Scope meter on a
    sh7372 Mackerel board. Tested with experimental sh7372 A3SP power domain
    patches. Platform device bind/unbind tested ok.

    V2 has been tested on the DS2 LED of the sh73a0-based AG5EVM.

    [axel.lin@gmail.com: include linux/module.h]
    Signed-off-by: Magnus Damm
    Cc: Paul Mundt
    Cc: Richard Purdie
    Cc: Grant Likely
    Signed-off-by: Axel Lin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Magnus Damm
     
  • The rename of corgibl_limit_intensity is missed in commit d00ba726
    ("backlight: Rename the corgi backlight driver to generic"). Let's fix it
    now.

    Signed-off-by: Axel Lin
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Axel Lin
     
  • Using gpio_request_one can make the error handling simpler.

    Signed-off-by: Fabio Estevam
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabio Estevam
     
  • The regulator support in the l4f00242t03 is very non-idiomatic. Rather
    than requesting the regulators based on the device name and the supply
    names used by the device the driver requires boards to pass system
    specific supply names around through platform data. The driver also
    conditionally requests the regulators based on this platform data, adding
    unneeded conditional code to the driver.

    Fix this by removing the platform data and converting to the standard
    idiom, also updating all in tree users of the driver. As no datasheet
    appears to be available for the LCD I'm guessing the names for the
    supplies based on the existing users and I've no ability to do anything
    more than compile test.

    The use of regulator_set_voltage() in the driver is also problematic,
    since fixed voltages are required the expectation would be that the
    voltages would be fixed in the constraints set by the machines rather than
    manually configured by the driver, but is less problematic.

    Signed-off-by: Mark Brown
    Tested-by: Fabio Estevam
    Cc: Richard Purdie
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Brown
     
  • A few new i2c-drivers came into the kernel which clear the
    clientdata-pointer on exit or error. This is obsolete meanwhile, the core
    will do it.

    Signed-off-by: Wolfram Sang
    Cc: Richard Purdie
    Cc: Paul Mundt
    Acked-by: Jean Delvare
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Wolfram Sang
     
  • Since achieving the full ASLR by merging the PIE randomization in commit
    cc503c1b43 ("x86: PIE executable randomization"), I have been dealing with
    most (if not all) of the bugreports reported against userspace address
    space randomization, so it might be a good idea to provide a decent
    contact point in MAINTAINERS.

    Signed-off-by: Jiri Kosina
    Cc: Josh Boyer
    Cc: Nicolas Pitre
    Cc: Ingo Molnar
    Cc: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     
  • While ego surfing, I noticed an email address problem.

    Signed-off-by: Linas Vepstas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Linas Vepstas
     
  • Signed-off-by: Ike Panhc
    Cc: Matthew Garrett
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ike Panhc
     
  • Standardize the style for compiler based printf format verification.
    Standardized the location of __printf too.

    Done via script and a little typing.

    $ grep -rPl --include=*.[ch] -w "__attribute__" * | \
    grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
    xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

    [akpm@linux-foundation.org: revert arch bits]
    Signed-off-by: Joe Perches
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Currently log_prefix is testing that the first character of the log level
    and facility is less than '0' and greater than '9' (which is always
    false).

    Since the code being updated works because strtoul bombs out (endp isn't
    updated) and 0 is returned anyway just remove the check and don't change
    the behavior of the function.

    Signed-off-by: William Douglas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    William Douglas
     
  • Currently log_prefix is testing that the first character of the log level
    and facility is less than '0' and greater than '9' (which is always
    false). It should be testing to see if the character less than '0' or
    greater than '9' instead. This patch makes that change.

    The code being changed worked because strtoul bombs out (endp isn't
    updated) and 0 is returned anyway.

    Signed-off-by: William Douglas
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    William Douglas
     
  • We are enabling some power features on medfield. To test suspend-2-RAM
    conveniently, we need turn on/off console_suspend_enabled frequently.

    Add a module parameter, so users could change it by:
    /sys/module/printk/parameters/console_suspend

    Signed-off-by: Yanmin Zhang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yanmin Zhang
     
  • We are enabling some power features on medfield. To test suspend-2-RAM
    conveniently, we need turn on/off ignore_loglevel frequently without
    rebooting.

    Add a module parameter, so users can change it by:
    /sys/module/printk/parameters/ignore_loglevel

    Signed-off-by: Yanmin Zhang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yanmin Zhang
     
  • Userspace needs to know the highest valid capability of the running
    kernel, which right now cannot reliably be retrieved from the header files
    only. The fact that this value cannot be determined properly right now
    creates various problems for libraries compiled on newer header files
    which are run on older kernels. They assume capabilities are available
    which actually aren't. libcap-ng is one example. And we ran into the
    same problem with systemd too.

    Now the capability is exported in /proc/sys/kernel/cap_last_cap.

    [akpm@linux-foundation.org: make cap_last_cap const, per Ulrich]
    Signed-off-by: Dan Ballard
    Cc: Randy Dunlap
    Cc: Ingo Molnar
    Cc: Lennart Poettering
    Cc: Kay Sievers
    Cc: Ulrich Drepper
    Cc: James Morris
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Ballard
     
  • Fix compilation warnings for CONFIG_SYSCTL=n:

    fixed compilation warnings in case of disabled CONFIG_SYSCTL
    kernel/watchdog.c:483:13: warning: `watchdog_enable_all_cpus' defined but not used
    kernel/watchdog.c:500:13: warning: `watchdog_disable_all_cpus' defined but not used

    these functions are static and are used only in sysctl handler, so move
    them inside #ifdef CONFIG_SYSCTL too

    Signed-off-by: Vasily Averin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     
  • Make stop_machine() safe to call early in boot, before SMP has been set
    up, by simply calling the callback function directly if there's only one
    CPU online.

    [ Fixes from AKPM:
    - add comment
    - local_irq_flags, not save_flags
    - also call hard_irq_disable() for systems which need it

    Tejun suggested using an explicit flag rather than just looking at
    the online cpu count. ]

    Cc: Tejun Heo
    Acked-by: Rusty Russell
    Cc: Peter Zijlstra
    Cc: H. Peter Anvin
    Cc: Ingo Molnar
    Cc: Steven Rostedt
    Acked-by: Tejun Heo
    Cc: Konrad Rzeszutek Wilk
    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeremy Fitzhardinge
     
  • Commit 6c536e4ce8e ("ad525x_dpot: add support for SPI parts") added
    support for the AD5161 through SPI, but the device supports both I2C and
    SPI (depending on the DIS pin), so add it to -i2c as well.

    Signed-off-by: Peter Korsgaard
    Acked-by: Mike Frysinger
    Acked-by: Michael Hennerich
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Korsgaard
     
  • Signed-off-by: Jonghwan Choi
    Cc: Donggeun Kim
    Cc: Kyungmin Park
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jonghwan Choi
     
  • The regulator API contains a range of features for stubbing itself out
    when not in use and for transparently restricting the actual effect of
    regulator API calls where they can't be supported on a particular system
    so that drivers don't need to individually implement this. Simplify the
    driver slightly by making use of this idiom.

    The only in tree user is ecovec24 which does not use the regulator API.

    Signed-off-by: Mark Brown
    Cc: Éric Piel
    Cc: Ilkka Koskinen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Brown
     
  • [ilkka.koskinen@nokia.com: fix arg to lis3->read()]
    Signed-off-by: Ilkka Koskinen
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Subject: lis3-remove-the-references-to-the-global-variable-in-core-driver-fix
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Change exported functions to use the device given as parameter
    instead of the global one.

    Signed-off-by: Ilkka Koskinen
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Signed-off-by: Ilkka Koskinen
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Signed-off-by: Ilkka Koskinen
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Add axis correction for HP ProBook 6555b.

    Signed-off-by: Malte Starostik
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Add axis correction for HP EliteBook 8540w.

    Reported-by: Lyall Pearce
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Malte Starostik
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • Add axis correction for HP EliteBook 2730p.

    Tested-by: Witold Pilat
    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel
     
  • In the move of the lis3 driver, the hp_accel.c file got dropped from the
    MAINTAINER file. Make it explicit again that this file is tied to lis3
    again.

    Signed-off-by: Éric Piel
    Cc: Matthew Garrett
    Cc: Witold Pilat
    Cc: Lyall Pearce
    Cc: Malte Starostik
    Cc: Ilkka Koskinen
    Cc: Thadeu Lima de Souza Cascardo
    Cc: Christian Lamparter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Éric Piel