]> git.openfabrics.org - ~shefty/rdma-dev.git/log
~shefty/rdma-dev.git
11 years agoLEDS: memory leak in blinkm_led_common_set()
Dan Carpenter [Thu, 26 Jul 2012 07:59:51 +0000 (15:59 +0800)]
LEDS: memory leak in blinkm_led_common_set()

This can return without freeing the bl_work struct.  Also there was no
check for allocation failure.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jan-Simon Möller <jansimon.moeller@gmx.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: add new lp8788 led driver
Kim, Milo [Fri, 20 Jul 2012 08:43:59 +0000 (16:43 +0800)]
leds: add new lp8788 led driver

TI LP8788 PMU has the current sink as the keyboard led driver.
The brightness is controlled by the i2c commands.
Configurable parameters can be defined in the platform side.

Patch v2.
(a) use workqueue on changing the brightness

(b) use mutex_lock/unlock when the brightness is set
    and the led block of lp8788 device is enabled

(c) remove err_dev on _probe()
    : just return as returned value if any errors

(d) replace module_init/exit() with module_platform_driver()

(e) add led configuration structure and loading them by default
    if platform data is null

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoLEDS: add BlinkM RGB LED driver, documentation and update MAINTAINERS
Jan-Simon Möller [Fri, 20 Jul 2012 08:49:06 +0000 (16:49 +0800)]
LEDS: add BlinkM RGB LED driver, documentation and update MAINTAINERS

Add driver for BlinkM device to drivers/leds/.
Add entry to MAINTAINERS file.
Add documentation in Documentation/leds/.

A BlinkM is a RGB LED controlled through I2C.

This driver implements an interface to the LED framework
and another sysfs group to access the internal options
of the BlinkM.

rev6: Use module_i2c_driver().
rev5: Removed own workqueue in favor of events wq.
rev4: Fixed comments by Bryan Wu.
rev3: Fixed issues found by Jonathan Neuschäfer.

(bryan.wu@canonical.com: remove 2 trailing whitespace)

Signed-off-by: Jan-Simon Möller <jansimon.moeller@gmx.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: max8997: Simplify max8997_led_set_mode implementation
Axel Lin [Tue, 24 Jul 2012 06:29:47 +0000 (14:29 +0800)]
leds: max8997: Simplify max8997_led_set_mode implementation

It is not necessary to call max8997_update_reg() twice just for updating
MAX8997_REG_LEN_CNTL register. With proper val and mask arguments to
max8997_update_reg() call, this can be done in one max8997_update_reg() call.
And then we can remove max8997_led_clear_mode() function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds/leds-s3c24xx: use devm_gpio_request
Devendra Naga [Wed, 11 Jul 2012 09:50:32 +0000 (17:50 +0800)]
leds/leds-s3c24xx: use devm_gpio_request

why?
because if the led_classdev_register fails we wont do gpio free
because using devm_ functions, there is no need for error paths

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert Network Space v2 LED driver to devm_kzalloc() and cleanup error exit...
Bryan Wu [Wed, 4 Jul 2012 04:30:50 +0000 (12:30 +0800)]
leds: convert Network Space v2 LED driver to devm_kzalloc() and cleanup error exit path

Cc: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert DAC124S085 LED driver to devm_kzalloc()
Bryan Wu [Wed, 4 Jul 2012 04:27:40 +0000 (12:27 +0800)]
leds: convert DAC124S085 LED driver to devm_kzalloc()

Cc: Guennadi Liakhovetski <lg@denx.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert LM3530 LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Wed, 4 Jul 2012 04:24:40 +0000 (12:24 +0800)]
leds: convert LM3530 LED driver to devm_kzalloc() and cleanup error exit path

Cc: Shreshtha Kumar SAHU <shreshthakumar.sahu@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert TCA6507 LED driver to devm_kzalloc()
Bryan Wu [Wed, 4 Jul 2012 04:20:41 +0000 (12:20 +0800)]
leds: convert TCA6507 LED driver to devm_kzalloc()

Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert Freescale MC13783 LED driver to devm_kzalloc() and cleanup error exit...
Bryan Wu [Wed, 4 Jul 2012 04:18:35 +0000 (12:18 +0800)]
leds: convert Freescale MC13783 LED driver to devm_kzalloc() and cleanup error exit path

Cc: Philippe Retornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert ADP5520 LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Wed, 4 Jul 2012 04:11:40 +0000 (12:11 +0800)]
leds: convert ADP5520 LED driver to devm_kzalloc() and cleanup error exit path

Cc: Michael Hennerich <hennerich@blackfin.uclinux.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert PCA955x LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Wed, 4 Jul 2012 04:09:05 +0000 (12:09 +0800)]
leds: convert PCA955x LED driver to devm_kzalloc() and cleanup error exit path

Cc: Nate Case <ncase@xes-inc.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert Sun Fire LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Wed, 4 Jul 2012 04:04:48 +0000 (12:04 +0800)]
leds: convert Sun Fire LED driver to devm_kzalloc() and cleanup error exit path

Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert PCA9532 LED driver to devm_kzalloc()
Bryan Wu [Wed, 4 Jul 2012 03:59:19 +0000 (11:59 +0800)]
leds: convert PCA9532 LED driver to devm_kzalloc()

Cc: Riku Voipio <riku.voipio@iki.fi>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert LT3593 LED driver to devm_kzalloc()
Bryan Wu [Wed, 4 Jul 2012 03:51:51 +0000 (11:51 +0800)]
leds: convert LT3593 LED driver to devm_kzalloc()

Cc: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert Renesas TPU LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Wed, 4 Jul 2012 03:48:57 +0000 (11:48 +0800)]
leds: convert Renesas TPU LED driver to devm_kzalloc() and cleanup error exit path

Cc: Magnus Damm <damm@opensource.se>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Wed, 4 Jul 2012 03:44:18 +0000 (11:44 +0800)]
leds: convert LP5523 LED driver to devm_kzalloc() and cleanup error exit path

Cc: Mathias Nyman <mathias.nyman@nokia.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert PCA9633 LED driver to devm_kzalloc()
Bryan Wu [Wed, 4 Jul 2012 03:40:10 +0000 (11:40 +0800)]
leds: convert PCA9633 LED driver to devm_kzalloc()

Cc: Peter Meerwald <p.meerwald@bct-electronic.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert BD2802 RGB LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Wed, 4 Jul 2012 03:35:03 +0000 (11:35 +0800)]
leds: convert BD2802 RGB LED driver to devm_kzalloc() and cleanup error exit path

Cc: Kim Kyuwon <q1.kim@samsung.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert LP5521 LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Wed, 4 Jul 2012 03:16:09 +0000 (11:16 +0800)]
leds: convert LP5521 LED driver to devm_kzalloc() and cleanup error exit path

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert DA9030/DA9034 LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Tue, 3 Jul 2012 05:07:53 +0000 (13:07 +0800)]
leds: convert DA9030/DA9034 LED driver to devm_kzalloc() and cleanup error exit path

Cc: Eric Miao <eric.miao@canonical.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert LP3944 LED driver to devm_kzalloc()
Bryan Wu [Tue, 3 Jul 2012 05:04:32 +0000 (13:04 +0800)]
leds: convert LP3944 LED driver to devm_kzalloc()

Cc: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert Atmel PWM LED driver to devm_kzalloc()
Bryan Wu [Tue, 3 Jul 2012 05:01:37 +0000 (13:01 +0800)]
leds: convert Atmel PWM LED driver to devm_kzalloc()

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert HTC ASIC3 LED driver to devm_kzalloc() and cleanup error exit path
Bryan Wu [Tue, 3 Jul 2012 04:47:16 +0000 (12:47 +0800)]
leds: convert HTC ASIC3 LED driver to devm_kzalloc() and cleanup error exit path

Cc: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert Big Networks LED driver to devm_kzalloc()
Bryan Wu [Tue, 3 Jul 2012 04:42:55 +0000 (12:42 +0800)]
leds: convert Big Networks LED driver to devm_kzalloc()

Cc: Simon Guinot <sguinot@lacie.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Use devm_kzalloc in leds-gpio.c file
Sachin Kamat [Wed, 4 Jul 2012 03:35:44 +0000 (11:35 +0800)]
leds: Use devm_kzalloc in leds-gpio.c file

devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Use devm_kzalloc in leds-max8997.c file
Sachin Kamat [Wed, 4 Jul 2012 03:21:36 +0000 (11:21 +0800)]
leds: Use devm_kzalloc in leds-max8997.c file

devm_kzalloc() makes code cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Use devm_kzalloc in leds-regulator.c file
Sachin Kamat [Tue, 3 Jul 2012 11:47:54 +0000 (19:47 +0800)]
leds: Use devm_kzalloc in leds-regulator.c file

devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Use devm_kzalloc in leds-pwm.c file
Sachin Kamat [Tue, 3 Jul 2012 11:47:53 +0000 (19:47 +0800)]
leds: Use devm_kzalloc in leds-pwm.c file

devm_kzalloc() makes cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Use module_platform_driver() in leds-max8997.c file
Sachin Kamat [Tue, 3 Jul 2012 11:47:51 +0000 (19:47 +0800)]
leds: Use module_platform_driver() in leds-max8997.c file

module_platform_driver() makes the code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: convert tca6507 driver to module_i2c_driver()
Peter Meerwald [Tue, 3 Jul 2012 08:03:38 +0000 (16:03 +0800)]
leds: convert tca6507 driver to module_i2c_driver()

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
Cc: NeilBrown <neilb@suse.de>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Convert S3C24XX LED driver to gpiolib API
Sylwester Nawrocki [Sat, 30 Jun 2012 12:30:26 +0000 (20:30 +0800)]
leds: Convert S3C24XX LED driver to gpiolib API

The s3c2410_gpio* calls are obsolete and have been scheduled for
removal since several kernel releases. Remove them and use common
gpiolib API instead.
This patch also adds gpio_request/gpio_free call for API corectness.

It is a prerequisite for removal of the S3C24XX SoC specific
arch/arm/plat-samsung/include/gpio-fns.h header.

Tested on Micro2440-SDK.

Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Convert S3C24XX LED driver to devm_kzalloc()
Sylwester Nawrocki [Sat, 30 Jun 2012 12:30:25 +0000 (20:30 +0800)]
leds: Convert S3C24XX LED driver to devm_kzalloc()

Use the device managed resource API for simplifying
the error/driver remove paths.

Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds-mc13783: set platform data to NULL at mc13783_led_remove
Devendra Naga [Mon, 2 Jul 2012 08:40:20 +0000 (16:40 +0800)]
leds-mc13783: set platform data to NULL at mc13783_led_remove

the platform_set_drvdata (pdev, NULL) to be set at the remove of the
driver, as we have set the platform data to led at probe.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds-88pm860x: use devm_kzalloc function
Devendra Naga [Mon, 2 Jul 2012 10:15:43 +0000 (18:15 +0800)]
leds-88pm860x: use devm_kzalloc function

Using devm_kzalloc will remove all the error checks and the frees are automatically done at the driver unload side.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds-lp5523: BUG() in error handling in probe()
Dan Carpenter [Wed, 27 Jun 2012 09:10:56 +0000 (17:10 +0800)]
leds-lp5523: BUG() in error handling in probe()

Inside the error handling in lp5523_init_led(), there is a place that
calls to led_classdev_unregister().  When we unregister the LED drivers,
it tries to set the brightness to OFF.  In this driver setting the
brightness is done through a work queue and the work queue hasn't been
initialized yet.

The result is that we trigger a WARN_ON() in the __queue_work().

The fix is to move the INIT_WORK() in front of the call to
lp5523_init_led().

Matt Renzelmann found this using a bug finding tool.

Reported-by: Matt Renzelmann <mjr@cs.wisc.edu>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Add LED driver for lm3556 chip
G.Shark Jeong [Fri, 22 Jun 2012 00:12:06 +0000 (08:12 +0800)]
leds: Add LED driver for lm3556 chip

LM3556 :
The LM3556 is a 4 MHz fixed-frequency synchronous boost
converter plus 1.5A constant current driver for a high-current white LED.
Datasheet: www.national.com/ds/LM/LM3556.pdf

Tested on OMAP4430

(bryan.wu@canonical.com: use module_i2c_driver() rather than
lm3556_init/lm3556_exit for code simplicity; fixed some typo
pointed out by Rob Landley)

Signed-off-by: G.Shark Jeong <gshark.jeong@gmail.com>
Reviewed-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Kim, Milo <Milo.Kim@ti.com>
Acked-by: Rob Landley <rob@landley.net>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: [trivial]Remove unnecesary return
Devendra Naga [Tue, 19 Jun 2012 18:22:39 +0000 (02:22 +0800)]
leds: [trivial]Remove unnecesary return

the ret is got the status returned by the
led_classdev_register, returning ret if the
led_classdev_register fails and returning 0
if the led_classdev_register success, can be done
by doing just "return ret" at the end.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: fix sparse warnings due to missing static
Bryan Wu [Fri, 15 Jun 2012 14:15:27 +0000 (22:15 +0800)]
leds: fix sparse warnings due to missing static

drivers/leds/led-core.c:56:6: sparse: symbol 'led_blink_setup' was not declared. Should it be static?
drivers/leds/led-triggers.c:233:6: sparse: symbol 'led_trigger_blink_setup' was not declared. Should it be static?

Reported-by: Fengguang Wu <wfg@linux.intel.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: correct trivial type in drivers/leds/Kconfig
Jesper Dangaard Brouer [Fri, 15 Jun 2012 10:13:25 +0000 (18:13 +0800)]
leds: correct trivial type in drivers/leds/Kconfig

Correct "hadrware" to "hardware", for LEDS_TRIGGER_TRANSIENT.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: use led_set_brightness in led_trigger_event
Fabio Baltieri [Thu, 14 Jun 2012 18:33:35 +0000 (02:33 +0800)]
leds: use led_set_brightness in led_trigger_event

Fix led_trigger_event() to use led_set_brightness() instead of
__led_set_brightness(), so that any pending blink timer is stopped before
setting the new brightness value.  Without this fix LED status may be
overridden by a pending timer.

This allows a trigger to use a mix of led_trigger_event(),
led_trigger_blink() and led_trigger_blink_oneshot() without races.

(applied over: leds: Rename led_brightness_set() to led_set_brightness())

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Cc: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Rename led_brightness_set() to led_set_brightness()
Shuah Khan [Wed, 13 Jun 2012 20:34:30 +0000 (04:34 +0800)]
leds: Rename led_brightness_set() to led_set_brightness()

Rename leds external interface led_brightness_set() to led_set_brightness().
This is the second phase of the change to reduce confusion between the
leds internal and external interfaces that set brightness. With this change,
now the external interface is led_set_brightness(). The first phase renamed
the internal interface led_set_brightness() to __led_set_brightness().
There are no changes to the interface implementations.

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: Rename led_set_brightness() to __led_set_brightness()
Shuah Khan [Wed, 13 Jun 2012 02:01:37 +0000 (10:01 +0800)]
leds: Rename led_set_brightness() to __led_set_brightness()

Rename leds internal interface led_set_brightness() to __led_set_brightness()
to reduce confusion between led_set_brightness() and the external interface
led_brightness_set(). led_brightness_set() cancels the timer and then calls
led_set_brightness().

Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: add oneshot trigger
Fabio Baltieri [Wed, 6 Jun 2012 22:11:05 +0000 (06:11 +0800)]
leds: add oneshot trigger

Add oneshot trigger to blink a led with configurale parameters via
sysfs.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Cc: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: fix led_brightness_set when soft-blinking
Fabio Baltieri [Wed, 6 Jun 2012 19:12:34 +0000 (03:12 +0800)]
leds: fix led_brightness_set when soft-blinking

Move led_stop_software_blink() code into led_brightness_set() to ensure
software blink timer is stopped and cleared when changing trigger.

Also use led_set_brightness() instead of calling
led_cdev->brightness_set() directly to keep led_cdev->brightness
consistent with current LED status.

This ensure proper cleaning when changing triggers, as without this fix
a LED may be turned off while leaving it's led_cdev->brightness = 1,
leading to an erratic software-blink behaviour.

The problem was easy to reproduce by changing the trigger from "timer"
to "oneshot".

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoledtrig-ide-disk: use generic one-shot blink api
Fabio Baltieri [Sat, 26 May 2012 23:19:23 +0000 (07:19 +0800)]
ledtrig-ide-disk: use generic one-shot blink api

Convert ledtrig-ide-disk code to use the generic API for one-shot LED
blinking.

This patch changes slightly the behaviour of the trigger, as while the
original version kept the LED on under heavy activity, the new one keeps
a constant on-off blink at 1 / (2 * BLINK_DELAY) Hz.

(bryan.wu@canonical.com: remove 2 useless included header files)

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoleds: add oneshot blink functions
Fabio Baltieri [Sat, 26 May 2012 23:19:22 +0000 (07:19 +0800)]
leds: add oneshot blink functions

Add two new functions, led_blink_set_oneshot and
led_trigger_blink_oneshot, to be used by triggers for one-shot blink of
led devices.

This is implemented extending the existing software-blink code, and uses
the same timer and handler function.

The behavior of the code is to do a blink-on, blink-off sequence when
the function is called, ignoring other calls until the sequence is
completed so that the leds keep blinking at constant rate if the
functions are called repeatedly.

This is meant to be used by drivers which needs to trigger on sporadic
event, but doesn't have clear busy/idle trigger points.

After the blink sequence the led remains off. This behavior can be
inverted setting the "invert" argument, which blink the led off, than on
and leave the led on after the sequence.

(bryan.wu@canonical.com: rebase to commit 'leds: don't disable blinking
when writing the same value to delay_on or delay_off')

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Acked-by: Shuah Khan <shuahkhan@gmail.com>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoled-triggers: rename *trigger to *trig for unified naming scheme
Bryan Wu [Thu, 19 Apr 2012 03:46:33 +0000 (11:46 +0800)]
led-triggers: rename *trigger to *trig for unified naming scheme

No functional change.

Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
11 years agoLinux 3.5
Linus Torvalds [Sat, 21 Jul 2012 20:58:29 +0000 (13:58 -0700)]
Linux 3.5

11 years agoRemove SYSTEM_SUSPEND_DISK system state
Rafael J. Wysocki [Sat, 21 Jul 2012 18:24:52 +0000 (20:24 +0200)]
Remove SYSTEM_SUSPEND_DISK system state

The SYSTEM_SUSPEND_DISK system state is never used, so drop it.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge branch 'anton-kgdb' (kgdb dmesg fixups)
Linus Torvalds [Sat, 21 Jul 2012 17:34:13 +0000 (10:34 -0700)]
Merge branch 'anton-kgdb' (kgdb dmesg fixups)

Merge emailed kgdb dmesg fixups patches from Anton Vorontsov:
 "The dmesg command appears to be broken after the printk rework.  The
  old logic in the kdb code makes no sense in terms of current
  printk/logging storage format, and KDB simply hangs forever upon
  entering 'dmesg' command.

  The first patch revives the command by switching to kmsg_dumper
  iterator.  As a side-effect, the code is now much more simpler.

  A few changes were needed in the printk.c: we needed unlocked variant
  of the kmsg_dumper iterator, but these can surely wait for 3.6.

  It's probably too late even for the first patch to go to 3.5, but I'll
  try to convince otherwise.  :-) Here we go:

   - The current code is broken for sure, and has no hope to work at
     all.  It is a regression
   - The new code works for me, and probably works for everyone else;
   - If it compiles (and I urge everyone to compile-test it on your
     setup), it hardly can make things worse."

* Merge emailed patches from Anton Vorontsov: (4 commits)
  kdb: Switch to nolock variants of kmsg_dump functions
  printk: Implement some unlocked kmsg_dump functions
  printk: Remove kdb_syslog_data
  kdb: Revive dmesg command

11 years agokdb: Switch to nolock variants of kmsg_dump functions
Anton Vorontsov [Sat, 21 Jul 2012 00:28:25 +0000 (17:28 -0700)]
kdb: Switch to nolock variants of kmsg_dump functions

The locked variants are prone to deadlocks (suppose we got to the
debugger w/ the logbuf lock held), so let's switch to nolock variants.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoprintk: Implement some unlocked kmsg_dump functions
Anton Vorontsov [Sat, 21 Jul 2012 00:28:07 +0000 (17:28 -0700)]
printk: Implement some unlocked kmsg_dump functions

If used from KDB, the locked variants are prone to deadlocks (suppose we
got to the debugger w/ the logbuf lock held).

So, we have to implement a few routines that grab no logbuf lock.

Yet we don't need these functions in modules, so we don't export them.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoprintk: Remove kdb_syslog_data
Anton Vorontsov [Sat, 21 Jul 2012 00:27:54 +0000 (17:27 -0700)]
printk: Remove kdb_syslog_data

The function is no longer needed, so remove it.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agokdb: Revive dmesg command
Anton Vorontsov [Sat, 21 Jul 2012 00:27:37 +0000 (17:27 -0700)]
kdb: Revive dmesg command

The kgdb dmesg command is broken after the printk rework.  The old logic
in kdb code makes no sense in terms of current printk/logging storage
format, and KDB simply hangs forever.

This patch revives the command by switching to kmsg_dumper iterator.

The code is now much more simpler and shorter.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
11 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Fri, 20 Jul 2012 19:02:02 +0000 (12:02 -0700)]
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus

Pull late MIPS fixes from Ralf Baechle:
 "This fixes a number of lose ends in the MIPS code and various bug
  fixes.

  Aside of dropping some patch that should not be in this pull request
  everything has sat in -next for quite a while and there are no known
  issues.

  The biggest patch in this patch set moves the allocation of an array
  that is aliased to a function (for runtime generated code) to
  assembler code.  This avoids an issue with certain toolchains when
  building for microMIPS."

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (35 commits)
  MIPS: PCI: Move fixups from __init to __devinit.
  MIPS: Fix bug.h MIPS build regression
  MIPS: sync-r4k: remove redundant irq operation
  MIPS: smp: Warn on too early irq enable
  MIPS: call set_cpu_online() on cpu being brought up with irq disabled
  MIPS: call ->smp_finish() a little late
  MIPS: Yosemite: delay irq enable to ->smp_finish()
  MIPS: SMTC: delay irq enable to ->smp_finish()
  MIPS: BMIPS: delay irq enable to ->smp_finish()
  MIPS: Octeon: delay enable irq to ->smp_finish()
  MIPS: Oprofile: Fix build as a module.
  MIPS: BCM63XX: Fix BCM6368 IPSec clock bit
  MIPS: perf: Fix build error caused by unused counters_per_cpu_to_total()
  MIPS: Fix Magic SysRq L kernel crash.
  MIPS: BMIPS: Fix duplicate header inclusion.
  mips: mark const init data with __initconst instead of __initdata
  MIPS: cmpxchg.h: Add missing include
  MIPS: Malta may also be equipped with MIPS64 R2 processors.
  MIPS: Fix typo multipy -> multiply
  MIPS: Cavium: Fix duplicate ARCH_SPARSEMEM_ENABLE in kconfig.
  ...

11 years agoMerge tag 'dm-3.5-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm
Linus Torvalds [Fri, 20 Jul 2012 18:51:22 +0000 (11:51 -0700)]
Merge tag 'dm-3.5-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm

Pull device-mapper discard fixes from Alasdair G Kergon:
  - avoid a crash in dm-raid1 when discards coincide with mirror
    recovery;
  - avoid discarding shared data that's still needed in dm-thin;
  - don't guarantee that discarded blocks will be wiped in dm-raid1.

* tag 'dm-3.5-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
  dm raid1: set discard_zeroes_data_unsupported
  dm thin: do not send discards to shared blocks
  dm raid1: fix crash with mirror recovery and discard

11 years agoMerge branch 'for-linus' of git://git.open-osd.org/linux-open-osd
Linus Torvalds [Fri, 20 Jul 2012 18:43:53 +0000 (11:43 -0700)]
Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osd

Pull pnfs/ore fixes from Boaz Harrosh:
 "These are catastrophic fixes to the pnfs objects-layout that were just
  discovered.  They are also destined for @stable.

  I have found these and worked on them at around RC1 time but
  unfortunately went to the hospital for kidney stones and had a very
  slow recovery.  I refrained from sending them as is, before proper
  testing, and surly I have found a bug just yesterday.

  So now they are all well tested, and have my sign-off.  Other then
  fixing the problem at hand, and assuming there are no bugs at the new
  code, there is low risk to any surrounding code.  And in anyway they
  affect only these paths that are now broken.  That is RAID5 in pnfs
  objects-layout code.  It does also affect exofs (which was not broken)
  but I have tested exofs and it is lower priority then objects-layout
  because no one is using exofs, but objects-layout has lots of users."

* 'for-linus' of git://git.open-osd.org/linux-open-osd:
  pnfs-obj: Fix __r4w_get_page when offset is beyond i_size
  pnfs-obj: don't leak objio_state if ore_write/read fails
  ore: Unlock r4w pages in exact reverse order of locking
  ore: Remove support of partial IO request (NFS crash)
  ore: Fix NFS crash by supporting any unaligned RAID IO

11 years agoMerge tag 'upstream-3.5-rc8' of git://git.infradead.org/linux-ubifs
Linus Torvalds [Fri, 20 Jul 2012 18:42:30 +0000 (11:42 -0700)]
Merge tag 'upstream-3.5-rc8' of git://git.infradead.org/linux-ubifs

Pull UBIFS free space fix-up bugfix from Artem Bityutskiy:
 "It's been reported already twice recently:

    http://lists.infradead.org/pipermail/linux-mtd/2012-May/041408.html
    http://lists.infradead.org/pipermail/linux-mtd/2012-June/042422.html

  and we finally have the fix.  I am quite confident the fix is correct
  because I could reproduce the problem with nandsim and verify the fix.
  It was also verified by Iwo (the reporter).

  I am also confident that this is OK to merge the fix so late because
  this patch affects only the fixup functionality, which is not used by
  most users."

* tag 'upstream-3.5-rc8' of git://git.infradead.org/linux-ubifs:
  UBIFS: fix a bug in empty space fix-up

12 years agodm raid1: set discard_zeroes_data_unsupported
Mikulas Patocka [Fri, 20 Jul 2012 13:25:07 +0000 (14:25 +0100)]
dm raid1: set discard_zeroes_data_unsupported

We can't guarantee that REQ_DISCARD on dm-mirror zeroes the data even if
the underlying disks support zero on discard.  So this patch sets
ti->discard_zeroes_data_unsupported.

For example, if the mirror is in the process of resynchronizing, it may
happen that kcopyd reads a piece of data, then discard is sent on the
same area and then kcopyd writes the piece of data to another leg.
Consequently, the data is not zeroed.

The flag was made available by commit 983c7db347db8ce2d8453fd1d89b7a4bb6920d56
(dm crypt: always disable discard_zeroes_data).

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm thin: do not send discards to shared blocks
Mikulas Patocka [Fri, 20 Jul 2012 13:25:05 +0000 (14:25 +0100)]
dm thin: do not send discards to shared blocks

When process_discard receives a partial discard that doesn't cover a
full block, it sends this discard down to that block. Unfortunately, the
block can be shared and the discard would corrupt the other snapshots
sharing this block.

This patch detects block sharing and ends the discard with success when
sending it to the shared block.

The above change means that if the device supports discard it can't be
guaranteed that a discard request zeroes data. Therefore, we set
ti->discard_zeroes_data_unsupported.

Thin target discard support with this bug arrived in commit
104655fd4dcebd50068ef30253a001da72e3a081 (dm thin: support discards).

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agodm raid1: fix crash with mirror recovery and discard
Mikulas Patocka [Fri, 20 Jul 2012 13:25:03 +0000 (14:25 +0100)]
dm raid1: fix crash with mirror recovery and discard

This patch fixes a crash when a discard request is sent during mirror
recovery.

Firstly, some background.  Generally, the following sequence happens during
mirror synchronization:
- function do_recovery is called
- do_recovery calls dm_rh_recovery_prepare
- dm_rh_recovery_prepare uses a semaphore to limit the number
  simultaneously recovered regions (by default the semaphore value is 1,
  so only one region at a time is recovered)
- dm_rh_recovery_prepare calls __rh_recovery_prepare,
  __rh_recovery_prepare asks the log driver for the next region to
  recover. Then, it sets the region state to DM_RH_RECOVERING. If there
  are no pending I/Os on this region, the region is added to
  quiesced_regions list. If there are pending I/Os, the region is not
  added to any list. It is added to the quiesced_regions list later (by
  dm_rh_dec function) when all I/Os finish.
- when the region is on quiesced_regions list, there are no I/Os in
  flight on this region. The region is popped from the list in
  dm_rh_recovery_start function. Then, a kcopyd job is started in the
  recover function.
- when the kcopyd job finishes, recovery_complete is called. It calls
  dm_rh_recovery_end. dm_rh_recovery_end adds the region to
  recovered_regions or failed_recovered_regions list (depending on
  whether the copy operation was successful or not).

The above mechanism assumes that if the region is in DM_RH_RECOVERING
state, no new I/Os are started on this region. When I/O is started,
dm_rh_inc_pending is called, which increases reg->pending count. When
I/O is finished, dm_rh_dec is called. It decreases reg->pending count.
If the count is zero and the region was in DM_RH_RECOVERING state,
dm_rh_dec adds it to the quiesced_regions list.

Consequently, if we call dm_rh_inc_pending/dm_rh_dec while the region is
in DM_RH_RECOVERING state, it could be added to quiesced_regions list
multiple times or it could be added to this list when kcopyd is copying
data (it is assumed that the region is not on any list while kcopyd does
its jobs). This results in memory corruption and crash.

There already exist bypasses for REQ_FLUSH requests: REQ_FLUSH requests
do not belong to any region, so they are always added to the sync list
in do_writes. dm_rh_inc_pending does not increase count for REQ_FLUSH
requests. In mirror_end_io, dm_rh_dec is never called for REQ_FLUSH
requests. These bypasses avoid the crash possibility described above.

These bypasses were improperly implemented for REQ_DISCARD when
the mirror target gained discard support in commit
5fc2ffeabb9ee0fc0e71ff16b49f34f0ed3d05b4 (dm raid1: support discard).

In do_writes, REQ_DISCARD requests is always added to the sync queue and
immediately dispatched (even if the region is in DM_RH_RECOVERING).  However,
dm_rh_inc and dm_rh_dec is called for REQ_DISCARD resusts.  So it violates the
rule that no I/Os are started on DM_RH_RECOVERING regions, and causes the list
corruption described above.

This patch changes it so that REQ_DISCARD requests follow the same path
as REQ_FLUSH. This avoids the crash.

Reference: https://bugzilla.redhat.com/837607

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agopnfs-obj: Fix __r4w_get_page when offset is beyond i_size
Boaz Harrosh [Thu, 7 Jun 2012 23:02:30 +0000 (02:02 +0300)]
pnfs-obj: Fix __r4w_get_page when offset is beyond i_size

It is very common for the end of the file to be unaligned on
stripe size. But since we know it's beyond file's end then
the XOR should be preformed with all zeros.

Old code used to just read zeros out of the OSD devices, which is a great
waist. But what scares me more about this situation is that, we now have
pages attached to the file's mapping that are beyond i_size. I don't
like the kind of bugs this calls for.

Fix both birds, by returning a global zero_page, if offset is beyond
i_size.

TODO:
Change the API to ->__r4w_get_page() so a NULL can be
returned without being considered as error, since XOR API
treats NULL entries as zero_pages.

[Bug since 3.2. Should apply the same way to all Kernels since]
CC: Stable Tree <stable@kernel.org>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
12 years agopnfs-obj: don't leak objio_state if ore_write/read fails
Boaz Harrosh [Fri, 8 Jun 2012 02:29:40 +0000 (05:29 +0300)]
pnfs-obj: don't leak objio_state if ore_write/read fails

[Bug since 3.2 Kernel]
CC: Stable Tree <stable@kernel.org>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
12 years agoore: Unlock r4w pages in exact reverse order of locking
Boaz Harrosh [Wed, 11 Jul 2012 12:27:13 +0000 (15:27 +0300)]
ore: Unlock r4w pages in exact reverse order of locking

The read-4-write pages are locked in address ascending order.
But where unlocked in a way easiest for coding. Fix that,
locks should be released in opposite order of locking, .i.e
descending address order.

I have not hit this dead-lock. It was found by inspecting the
dbug print-outs. I suspect there is an higher lock at caller that
protects us, but fix it regardless.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
12 years agoore: Remove support of partial IO request (NFS crash)
Boaz Harrosh [Fri, 8 Jun 2012 01:30:40 +0000 (04:30 +0300)]
ore: Remove support of partial IO request (NFS crash)

Do to OOM situations the ore might fail to allocate all resources
needed for IO of the full request. If some progress was possible
it would proceed with a partial/short request, for the sake of
forward progress.

Since this crashes NFS-core and exofs is just fine without it just
remove this contraption, and fail.

TODO:
Support real forward progress with some reserved allocations
of resources, such as mem pools and/or bio_sets

[Bug since 3.2 Kernel]
CC: Stable Tree <stable@kernel.org>
CC: Benny Halevy <bhalevy@tonian.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
12 years agoore: Fix NFS crash by supporting any unaligned RAID IO
Boaz Harrosh [Thu, 7 Jun 2012 22:19:07 +0000 (01:19 +0300)]
ore: Fix NFS crash by supporting any unaligned RAID IO

In RAID_5/6 We used to not permit an IO that it's end
byte is not stripe_size aligned and spans more than one stripe.
.i.e the caller must check if after submission the actual
transferred bytes is shorter, and would need to resubmit
a new IO with the remainder.

Exofs supports this, and NFS was supposed to support this
as well with it's short write mechanism. But late testing has
exposed a CRASH when this is used with none-RPC layout-drivers.

The change at NFS is deep and risky, in it's place the fix
at ORE to lift the limitation is actually clean and simple.
So here it is below.

The principal here is that in the case of unaligned IO on
both ends, beginning and end, we will send two read requests
one like old code, before the calculation of the first stripe,
and also a new site, before the calculation of the last stripe.
If any "boundary" is aligned or the complete IO is within a single
stripe. we do a single read like before.

The code is clean and simple by splitting the old _read_4_write
into 3 even parts:
1._read_4_write_first_stripe
2. _read_4_write_last_stripe
3. _read_4_write_execute

And calling 1+3 at the same place as before. 2+3 before last
stripe, and in the case of all in a single stripe then 1+2+3
is preformed additively.

Why did I not think of it before. Well I had a strike of
genius because I have stared at this code for 2 years, and did
not find this simple solution, til today. Not that I did not try.

This solution is much better for NFS than the previous supposedly
solution because the short write was dealt  with out-of-band after
IO_done, which would cause for a seeky IO pattern where as in here
we execute in order. At both solutions we do 2 separate reads, only
here we do it within a single IO request. (And actually combine two
writes into a single submission)

NFS/exofs code need not change since the ORE API communicates the new
shorter length on return, what will happen is that this case would not
occur anymore.

hurray!!

[Stable this is an NFS bug since 3.2 Kernel should apply cleanly]
CC: Stable Tree <stable@kernel.org>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
12 years agoUBIFS: fix a bug in empty space fix-up
Artem Bityutskiy [Sat, 14 Jul 2012 11:33:09 +0000 (14:33 +0300)]
UBIFS: fix a bug in empty space fix-up

UBIFS has a feature called "empty space fix-up" which is a quirk to work-around
limitations of dumb flasher programs. Namely, of those flashers that are unable
to skip NAND pages full of 0xFFs while flashing, resulting in empty space at
the end of half-filled eraseblocks to be unusable for UBIFS. This feature is
relatively new (introduced in v3.0).

The fix-up routine (fixup_free_space()) is executed only once at the very first
mount if the superblock has the 'space_fixup' flag set (can be done with -F
option of mkfs.ubifs). It basically reads all the UBIFS data and metadata and
writes it back to the same LEB. The routine assumes the image is pristine and
does not have anything in the journal.

There was a bug in 'fixup_free_space()' where it fixed up the log incorrectly.
All but one LEB of the log of a pristine file-system are empty. And one
contains just a commit start node. And 'fixup_free_space()' just unmapped this
LEB, which resulted in wiping the commit start node. As a result, some users
were unable to mount the file-system next time with the following symptom:

UBIFS error (pid 1): replay_log_leb: first log node at LEB 3:0 is not CS node
UBIFS error (pid 1): replay_log_leb: log error detected while replaying the log at LEB 3:0

The root-cause of this bug was that 'fixup_free_space()' wrongly assumed
that the beginning of empty space in the log head (c->lhead_offs) was known
on mount. However, it is not the case - it was always 0. UBIFS does not store
in it the master node and finds out by scanning the log on every mount.

The fix is simple - just pass commit start node size instead of 0 to
'fixup_leb()'.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com>
Cc: stable@vger.kernel.org [v3.0+]
Reported-by: Iwo Mergler <Iwo.Mergler@netcommwireless.com>
Tested-by: Iwo Mergler <Iwo.Mergler@netcommwireless.com>
Reported-by: James Nute <newten82@gmail.com>
12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
Linus Torvalds [Thu, 19 Jul 2012 23:11:28 +0000 (16:11 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client

Pull last minute Ceph fixes from Sage Weil:
 "The important one fixes a bug in the socket failure handling behavior
  that was turned up in some recent failure injection testing.  The
  other two are minor bug fixes."

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
  rbd: endian bug in rbd_req_cb()
  rbd: Fix ceph_snap_context size calculation
  libceph: fix messenger retry

12 years agoMerge tag 'md-3.5-fixes' of git://neil.brown.name/md
Linus Torvalds [Thu, 19 Jul 2012 15:27:13 +0000 (08:27 -0700)]
Merge tag 'md-3.5-fixes' of git://neil.brown.name/md

Pull three md bugfixes from NeilBrown:
 "One of the bugs was introduced in 3.5-rc1.  Others have been there for
  longer."

* tag 'md-3.5-fixes' of git://neil.brown.name/md:
  md/raid1: close some possible races on write errors during resync
  md: avoid crash when stopping md array races with closing other open fds.
  md: fix bug in handling of new_data_offset

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Thu, 19 Jul 2012 15:21:13 +0000 (08:21 -0700)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking changes from David Miller:
 "Ok, we should be good to go now"

1) We have to statically initialize the init_net device list head rather
   than do so in an initcall, otherwise netprio_cgroup crashes if it's
   built statically rather than modular (Mark D.  Rustad)

2) Fix SKB null oopser in CIPSO ipv4 option processing (Paul Moore)

3) Qlogic maintainers update (Anirban Chakraborty)

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  net: Statically initialize init_net.dev_base_head
  MAINTAINERS: Changes in qlcnic and qlge maintainers list
  cipso: don't follow a NULL pointer when setsockopt() is called

12 years agoMerge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Linus Torvalds [Thu, 19 Jul 2012 15:15:55 +0000 (08:15 -0700)]
Merge branch 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID update from Jiri Kosina:
 "A final round of changes for HID for 3.5: just device ID additions."

* 'upstream-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: hid-multitouch: add support for Zytronic panels
  HID: add Sennheiser BTD500USB device support
  HID: add battery quirk for Apple Wireless ANSI

12 years agocx25821: Remove bad strcpy to read-only char*
Ezequiel Garcia [Wed, 18 Jul 2012 13:05:26 +0000 (10:05 -0300)]
cx25821: Remove bad strcpy to read-only char*

The strcpy was being used to set the name of the board.  Since the
destination char* was read-only and the name is set statically at
compile time; this was both wrong and redundant.

The type of char* is changed to const char* to prevent future errors.

Reported-by: Radek Masin <radek@masin.eu>
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
[ Taking directly due to vacations   - Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoHID: hid-multitouch: add support for Zytronic panels
Benjamin Tissoires [Tue, 19 Jun 2012 12:39:54 +0000 (14:39 +0200)]
HID: hid-multitouch: add support for Zytronic panels

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoMIPS: PCI: Move fixups from __init to __devinit.
Sebastian Andrzej Siewior [Thu, 19 Jul 2012 05:13:54 +0000 (07:13 +0200)]
MIPS: PCI: Move fixups from __init to __devinit.

Fixups are executed once the pci-device is found which is during boot
process so __init seems fine as long as the platform does not support
hotplug.
However it is possible to remove the PCI bus at run time and have it
rediscovered again via "echo 1 > /sys/bus/pci/rescan" and this will call
the fixups again.

[ralf@linux-mips.org: Made piixirqmap[] in malta_piix_func0_fixup()
__initdata.]

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Cc: linux-mips@linux-mips.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Fix bug.h MIPS build regression
Yoichi Yuasa [Thu, 19 Jul 2012 05:13:54 +0000 (07:13 +0200)]
MIPS: Fix bug.h MIPS build regression

Commit: 3777808873b0c49c5cf27e44c948dfb02675d578 [bug.h: need linux/kernel.h
for TAINT_WARN.] breaks all MIPS builds.

  CC      arch/mips/kernel/machine_kexec.o
In file included from include/linux/kernel.h:20:0,
                 from include/asm-generic/bug.h:35,
                 from /home/yuasa/src/linux/kernel/git/linux-2.6/arch/mips/include/asm/bug.h:41,
                 from /home/yuasa/src/linux/kernel/git/linux-2.6/arch/mips/include/asm/bitops.h:20,
                 from include/linux/bitops.h:22,
                 from include/linux/signal.h:38,
                 from include/linux/elfcore.h:5,
                 from include/linux/kexec.h:60,
                 from arch/mips/kernel/machine_kexec.c:9:
include/linux/log2.h: In function '__ilog2_u32':
include/linux/log2.h:34:2: error: implicit declaration of function 'fls' [-Werror=implicit-function-declaration]
include/linux/log2.h: In function '__ilog2_u64':
include/linux/log2.h:42:2: error: implicit declaration of function 'fls64' [-Werror=implicit-function-declaration]
include/linux/log2.h: In function '__roundup_pow_of_two':
include/linux/log2.h:63:2: error: implicit declaration of function 'fls_long' [-Werror=implicit-function-declaration]
In file included from include/linux/bitops.h:22:0,
                 from include/linux/signal.h:38,
                 from include/linux/elfcore.h:5,
                 from include/linux/kexec.h:60,
                 from arch/mips/kernel/machine_kexec.c:9:
/home/yuasa/src/linux/kernel/git/linux-2.6/arch/mips/include/asm/bitops.h: At top level:
/home/yuasa/src/linux/kernel/git/linux-2.6/arch/mips/include/asm/bitops.h:615:19: error: static declaration of 'fls' follows non-static declaration
include/linux/log2.h:34:9: note: previous implicit declaration of 'fls' was here
In file included from /home/yuasa/src/linux/kernel/git/linux-2.6/arch/mips/include/asm/bitops.h:651:0,
                 from include/linux/bitops.h:22,
                 from include/linux/signal.h:38,
                 from include/linux/elfcore.h:5,
                 from include/linux/kexec.h:60,
                 from arch/mips/kernel/machine_kexec.c:9:
include/asm-generic/bitops/fls64.h:18:28: error: static declaration of 'fls64' follows non-static declaration
include/linux/log2.h:42:9: note: previous implicit declaration of 'fls64' was here
In file included from include/linux/signal.h:38:0,
                 from include/linux/elfcore.h:5,
                 from include/linux/kexec.h:60,
                 from arch/mips/kernel/machine_kexec.c:9:
include/linux/bitops.h:160:24: error: conflicting types for 'fls_long'
include/linux/log2.h:63:16: note: previous implicit declaration of 'fls_long' was here
cc1: all warnings being treated as errors

make[2]: *** [arch/mips/kernel/machine_kexec.o] Error 1

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: yuasa@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: Linuxppc-dev <linuxppc-dev@ozlabs.org>
Cc: Linux MIPS Mailing List <linux-mips@linux-mips.org>
Cc: Linux-sh list <linux-sh@vger.kernel.org>
Cc: Chris Zankel <chris@zankel.net>
Patchwork: https://patchwork.linux-mips.org/patch/4000/
Tested-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: sync-r4k: remove redundant irq operation
Yong Zhang [Thu, 19 Jul 2012 07:13:54 +0000 (09:13 +0200)]
MIPS: sync-r4k: remove redundant irq operation

Since we have delayed irq enabling to ->smp_finish()

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: smp: Warn on too early irq enable
Yong Zhang [Thu, 19 Jul 2012 07:13:53 +0000 (09:13 +0200)]
MIPS: smp: Warn on too early irq enable

Just to catch a potential issue.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: https://patchwork.linux-mips.org/patch/3852/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: call set_cpu_online() on cpu being brought up with irq disabled
Yong Zhang [Thu, 19 Jul 2012 07:13:53 +0000 (09:13 +0200)]
MIPS: call set_cpu_online() on cpu being brought up with irq disabled

To prevent a problem as commit 5fbd036b [sched: Cleanup cpu_active madness]
and commit 2baab4e9 [sched: Fix select_fallback_rq() vs cpu_active/cpu_online]
try to resolve, move set_cpu_online() to the brought up CPU and with irq
disabled.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: https://patchwork.linux-mips.org/patch/3851/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: call ->smp_finish() a little late
Yong Zhang [Thu, 19 Jul 2012 07:13:53 +0000 (09:13 +0200)]
MIPS: call ->smp_finish() a little late

We have move irq enable to ->smp_finish. Place ->smp_finish() a little
late to prepare for move set_cpu_online() into start_secondary.
And it's not necessary to call cpu_set(cpu, cpu_callin_map) and
synchronise_count_slave() with irq enabled.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: https://patchwork.linux-mips.org/patch/3850/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Yosemite: delay irq enable to ->smp_finish()
Yong Zhang [Thu, 19 Jul 2012 07:13:53 +0000 (09:13 +0200)]
MIPS: Yosemite: delay irq enable to ->smp_finish()

To prepare for smoothing set_cpu_[active|online]() mess up

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: https://patchwork.linux-mips.org/patch/3848/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: SMTC: delay irq enable to ->smp_finish()
Yong Zhang [Thu, 19 Jul 2012 07:13:53 +0000 (09:13 +0200)]
MIPS: SMTC: delay irq enable to ->smp_finish()

To prepare for smoothing set_cpu_[active|online]() mess up

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: https://patchwork.linux-mips.org/patch/3847/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: BMIPS: delay irq enable to ->smp_finish()
Yong Zhang [Thu, 19 Jul 2012 07:13:53 +0000 (09:13 +0200)]
MIPS: BMIPS: delay irq enable to ->smp_finish()

To prepare for smoothing set_cpu_[active|online]() mess up

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: https://patchwork.linux-mips.org/patch/3846/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Octeon: delay enable irq to ->smp_finish()
Yong Zhang [Thu, 19 Jul 2012 07:13:53 +0000 (09:13 +0200)]
MIPS: Octeon: delay enable irq to ->smp_finish()

To prepare for smoothing set_cpu_[active|online]() mess up

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Cc: Sergei Shtylyov <sshtylyov@mvista.com>
Cc: David Daney <david.daney@cavium.com>
Acked-by: David Daney <david.daney@cavium.com>
Patchwork: https://patchwork.linux-mips.org/patch/3845/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Oprofile: Fix build as a module.
Ralf Baechle [Thu, 19 Jul 2012 07:13:52 +0000 (09:13 +0200)]
MIPS: Oprofile: Fix build as a module.

When building oprofile as a module for R10000 or R7000 class processors,
E9000 or MIPSxx class cores since 3572a2c37f667ee49333f8863722b8f43eac506b
[MIPS: make oprofile use cp0_perfcount_irq if it is set] an

ERROR: "cp0_compare_irq" [arch/mips/oprofile/oprofile.ko] undefined!

error will happen.  Fixed by exporting cp0_compare_irq.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: BCM63XX: Fix BCM6368 IPSec clock bit
Florian Fainelli [Thu, 19 Jul 2012 07:13:52 +0000 (09:13 +0200)]
MIPS: BCM63XX: Fix BCM6368 IPSec clock bit

The IPsec clock bit is 18 and not 17.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: mpm@selenic.com
Cc: herbert@gondor.apana.org.au
Patchwork: https://patchwork.linux-mips.org/patch/3323/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: perf: Fix build error caused by unused counters_per_cpu_to_total()
Florian Fainelli [Thu, 19 Jul 2012 07:13:52 +0000 (09:13 +0200)]
MIPS: perf: Fix build error caused by unused counters_per_cpu_to_total()

cc1: warnings being treated as errors
arch/mips/kernel/perf_event_mipsxx.c:166: error: 'counters_per_cpu_to_total' defined but not used
make[2]: *** [arch/mips/kernel/perf_event_mipsxx.o] Error 1
make[2]: *** Waiting for unfinished jobs....

It was first introduced by 82091564cfd7ab8def42777a9c662dbf655c5d25 [MIPS:
perf: Add support for 64-bit perf counters.] in 3.2.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Cc: linux-mips@linux-mips.org
Cc: david.daney@cavium.com
Patchwork: https://patchwork.linux-mips.org/patch/3357/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Fix Magic SysRq L kernel crash.
Vincent Wen [Thu, 19 Jul 2012 07:11:16 +0000 (09:11 +0200)]
MIPS: Fix Magic SysRq L kernel crash.

show_backtrace() was passed a NULL pointer which caused paging
request fail. Set to current task as other architectures (ARM,
etc) do when passed a NULL task pointer.

Signed-off-by: Vincent Wen <vincentwenlinux@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: cernekee@gmail.com
Patchwork: https://patchwork.linux-mips.org/patch/3524/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: BMIPS: Fix duplicate header inclusion.
Danny Kukawka [Thu, 19 Jul 2012 07:11:16 +0000 (09:11 +0200)]
MIPS: BMIPS: Fix duplicate header inclusion.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Cc: Danny Kukawka <dkukawka@suse.de>
Cc: Kevin Cernekee <cernekee@gmail.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/3369/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agomips: mark const init data with __initconst instead of __initdata
Uwe Kleine-König [Thu, 19 Jul 2012 07:11:16 +0000 (09:11 +0200)]
mips: mark const init data with __initconst instead of __initdata

As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail with

error: $variablename causes a section type conflict

because a section containing const variables is marked read only and so
cannot contain non-const variables.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: linux-mips@linux-mips.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: kernel@pengutronix.de
Patchwork: https://patchwork.linux-mips.org/patch/3565/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: cmpxchg.h: Add missing include
Aaro Koskinen [Thu, 19 Jul 2012 07:11:15 +0000 (09:11 +0200)]
MIPS: cmpxchg.h: Add missing include

Fix the following build breakage in v3.4-rc1:

  CC      kernel/irq_work.o
In file included from include/linux/irq_work.h:4:0,
                 from kernel/irq_work.c:10:
include/linux/llist.h: In function 'llist_del_all':
include/linux/llist.h:178:2: error: implicit declaration of function 'BUILD_BUG_ON' [-Werror=implicit-function-declaration]

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3568/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Malta may also be equipped with MIPS64 R2 processors.
Leonid Yegoshin [Thu, 19 Jul 2012 07:11:15 +0000 (09:11 +0200)]
MIPS: Malta may also be equipped with MIPS64 R2 processors.

Signed-off-by: Leonid Yegoshin <yegoshin@mips.com>
Signed-off-by: Steven J. Hill <sjhill@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3792/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Fix typo multipy -> multiply
Ralf Baechle [Thu, 19 Jul 2012 07:11:15 +0000 (09:11 +0200)]
MIPS: Fix typo multipy -> multiply

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Cavium: Fix duplicate ARCH_SPARSEMEM_ENABLE in kconfig.
Yoichi Yuasa [Thu, 19 Jul 2012 07:11:15 +0000 (09:11 +0200)]
MIPS: Cavium: Fix duplicate ARCH_SPARSEMEM_ENABLE in kconfig.

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3883/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: BCM47xx: Fix BCMA_DRIVER_PCI_HOSTMODE config dependencies
Yoichi Yuasa [Thu, 19 Jul 2012 07:11:15 +0000 (09:11 +0200)]
MIPS: BCM47xx: Fix BCMA_DRIVER_PCI_HOSTMODE config dependencies

warning: (BCM47XX_BCMA) selects BCMA_DRIVER_PCI_HOSTMODE which has unmet direct dependencies (BCMA_POSSIBLE && BCMA && MIPS && BCMA_HOST_PCI)
warning: (BCM47XX_BCMA) selects BCMA_DRIVER_PCI_HOSTMODE which has unmet direct dependencies (BCMA_POSSIBLE && BCMA && MIPS && BCMA_HOST_PCI)

Signed-off-by: Yoichi Yuasa <yuasa@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3882/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: SMTC: Spelling and grammar corrections.
Ralf Baechle [Thu, 19 Jul 2012 07:11:14 +0000 (09:11 +0200)]
MIPS: SMTC: Spelling and grammar corrections.

Extractd from Steven J. Hill's https://patchwork.linux-mips.org/patch/3603/.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Properly align the .data..init_task section.
David Daney [Thu, 19 Jul 2012 07:11:14 +0000 (09:11 +0200)]
MIPS: Properly align the .data..init_task section.

Improper alignment can lead to unbootable systems and/or random
crashes.

[ralf@linux-mips.org: This is a lond standing bug since
6eb10bc9e2deab06630261cd05c4cb1e9a60e980 (kernel.org) rsp.
c422a10917f75fd19fa7fe070aaaa23e384dae6f (lmo) [MIPS: Clean up linker script
using new linker script macros.] so dates back to 2.6.32.]

Signed-off-by: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org>
Patchwork: https://patchwork.linux-mips.org/patch/3881/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Malta: Change start address to avoid conflicts.
Steven J. Hill [Thu, 19 Jul 2012 07:11:14 +0000 (09:11 +0200)]
MIPS: Malta: Change start address to avoid conflicts.

There are ACPI and SMB devices in the 0x1000..0x1fff address range.

Signed-off-by: Steven J. Hill <sjhill@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3581/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Fix race condition with FPU thread task flag during context switch.
Leonid Yegoshin [Thu, 19 Jul 2012 07:11:14 +0000 (09:11 +0200)]
MIPS: Fix race condition with FPU thread task flag during context switch.

[ralf@linux-mips.org: Cosmetic changes; also fixed up r2300_switch.S and
octeon_switch.S which needed similar modifications.]

Signed-off-by: Leonid Yegoshin <yegoshin@mips.com>
Signed-off-by: Steven J. Hill <sjhill@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3784/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
12 years agoMIPS: Fix decoding of c0_config1 for MIPSxx caches with 32 ways per set.
Douglas Leung [Thu, 19 Jul 2012 07:11:13 +0000 (09:11 +0200)]
MIPS: Fix decoding of c0_config1 for MIPSxx caches with 32 ways per set.

This affects certain 4Kc cores.

Signed-off-by: Douglas Leung <douglas@mips.com>
Signed-off-by: Steven J. Hill <sjhill@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/3855/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>