- 04 1月, 2016 40 次提交
-
-
由 Milo Kim 提交于
Workqueue, 'set_brightness_work' is used for scheduling brightness control. This workqueue is canceled when the LED class device is unregistered. Currently, LED subsystem handles like below. cancel_work_sync(&led_cdev->set_brightness_work) led_set_brightness(led_cdev, LED_OFF) However, this could be a problem. Workqueue is going to be canceled but LED device needs to be off. The worst case is null pointer access due to scheduling a workqueue. LED module is loaded. LED driver private data is allocated by using devm_zalloc(). LED module is unloaded. led_classdev_unregister() is called. cancel_work_sync() led_set_brightness(led_cdev, LED_OFF) schedule_work() if LED driver uses brightness_set_blocking() In the meantime, driver private data will be freed. ..scheduling.. brightness_set_blocking() callback is invoked. For the brightness control, LED driver tries to access private data but resource is removed! To avoid this problem, LED subsystem should turn off the brightness first and wait for completion. led_set_brightness(led_cdev, LED_OFF) flush_work(&led_cdev->set_brightness_work) It guarantees that LED driver turns off the brightness prior to resource management. Cc: linux-leds@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: NMilo Kim <milo.kim@ti.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Jacek Anaszewski 提交于
Strobe state variable is declared as unsigned long, remove the check for values less than zero then. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Reported-by: NDavid Binderman <dcb314@hotmail.com>
-
由 Ingi Kim 提交于
The refcount of device_node increases after of_node_get() is called. So, a break out of the loop requires of_node_put(). This patch adds missing of_node_put() when loop breaks. Signed-off-by: NIngi Kim <ingi2.kim@samsung.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Markus Hofstaetter 提交于
Some PWMs are disabled by default or the default pin setting does not match the LED_OFF state (e.g., active-low leds). Hence, the driver may end up reporting 0 brightness, but the leds are actually on using full brightness, because it never enforces its default configuration. So enforce it by calling led_pwm_set() after successfully registering the device. Tested on a Phytec phyFLEX i.MX6Q board based on kernel v3.19.5. Signed-off-by: NMarkus Hofstaetter <markus.hofstaetter@ait.ac.at> Tested-by: NMarkus Hofstaetter <markus.hofstaetter@ait.ac.at> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Uwe Kleine-König 提交于
The header of this file fixes the license to GPL 2 only without the option to use later version. So use the string "GPL v2" that is to be used in this case. Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: NFabio Baltieri <fabio.baltieri@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Rob Herring 提交于
The transient trigger duration is documented to be in msec units, but is actually in jiffies units. Other time based triggers are in msec units as well. Fix the timer setup to convert from msec. This could break an existing userspace that worked around this problem, but exposing jiffies to userspace is just wrong and would break anyway if HZ is changed. Signed-off-by: NRob Herring <robh@kernel.org> Cc: Shuah Khan <shuahkhan@gmail.com> Cc: Richard Purdie <rpurdie@rpsys.net> Cc: linux-leds@vger.kernel.org Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Jacek Anaszewski 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Daniel Jeong <daniel.jeong@ti.com> Cc: G.Shark Jeong <gshark.jeong@gmail.com>
-
由 Jacek Anaszewski 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Raphael Assenat <raph@8d.com>
-
由 Jacek Anaszewski 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Raphael Assenat <raph@8d.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Acked-by: NAntonio Ospite <ao2@ao2.it> Reviewed-by: NMark Brown <broonie@kernel.org>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Acked-by: NAntonio Ospite <ao2@ao2.it> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Work queues are not used in this driver, so remove the include. Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Cc: Daniel Mack <daniel@caiaq.de> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Reviewed-by: NMark Brown <broonie@kernel.org> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Acked-by: NDan Murphy <dmurphy@ti.com> Cc: Ricardo Ribalda <ricardo.ribalda@gmail.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Cc: Nate Case <ncase@xes-inc.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Acked-by: NDan Murphy <dmurphy@ti.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Cc: Milo Kim <milo.kim@ti.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Milo Kim <milo.kim@ti.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Acked-by: NAntonio Ospite <ao2@ao2.it> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Cc: Daniel Jeong <daniel.jeong@ti.com> Cc: G.Shark Jeong <gshark.jeong@gmail.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Johan Hovold <johan@kernel.org>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Cc: Jan-Simon Moeller <dl9pf@gmx.de> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Cc: Kim Kyuwon <q1.kim@samsung.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Cc: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Andrew Lunn 提交于
Now the core implements the work queue, remove it from the driver, and switch to using brightness_set_blocking op. Signed-off-by: NAndrew Lunn <andrew@lunn.ch> Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com>
-
由 Jacek Anaszewski 提交于
LED subsystem shifted responsibility for choosing between SYNC or ASYNC way of setting brightness from drivers to the caller. Adapt the wrapper to those changes. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: linux-media@vger.kernel.org Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Acked-by: NPavel Machek <pavel@ucw.cz> Acked-by: NMauro Carvalho Chehab <mchehab@osg.samsung.com>
-
由 Jacek Anaszewski 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Cc: Ingi Kim <ingi2.kim@samsung.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Acked-by: NPavel Machek <pavel@ucw.cz>
-
由 Jacek Anaszewski 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Acked-by: NPavel Machek <pavel@ucw.cz>
-
由 Jacek Anaszewski 提交于
Now the core implements the work queue, remove it from the drivers, and switch to using brightness_set_blocking op. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com> Acked-by: NPavel Machek <pavel@ucw.cz>
-
由 Jacek Anaszewski 提交于
This patch adds description of the LED subsystem API for setting an LED brightness. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
-
由 Jacek Anaszewski 提交于
This patch removes SET_BRIGHTNESS_ASYNC and SET_BRIGHTNESS_SYNC flags. led_set_brightness() now calls led_set_brightness_nosleep() instead of choosing between sync and async op basing on the flags defined by the driver. From now on, if a user wants to make sure that brightness will be set synchronously, they have to use led_set_brightness_sync() API. It is now being made publicly available since it has become apparent that it is a caller who should decide whether brightness is to be set in a synchronous or an asynchronous way. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
-
由 Jacek Anaszewski 提交于
This patch makes LED core capable of setting brightness for drivers that implement brightness_set_blocking op. It removes from LED class drivers responsibility for using work queues on their own. In order to achieve this set_brightness_delayed callback is being modified to directly call one of available ops for brightness setting. led_set_brightness_async() function didn't set brightness in an asynchronous way in all cases. It was mistakenly assuming that all LED subsystem drivers used work queue in their brightness_set op, whereas only half of them did that. Since it has no users now, it is being removed. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
-
由 Jacek Anaszewski 提交于
This patch adds led_set_brightness_nosleep() and led_set_brightness_nopm() functions, that guarantee setting LED brightness in a non-blocking way. The latter is used from pm_ops context and doesn't modify the brightness cached in the struct led_classdev. Its execution always ends up with a call to brightness setting op - either directly or through a set_brightness_work, regardless of LED_SUSPENDED flag state. The patch also replaces led_set_brightness_async() with led_set_brightness_nosleep() in all places where the most vital was setting brightness in a non sleeping way but not necessarily asynchronously, which is not needed for non-blocking drivers. Signed-off-by: NJacek Anaszewski <j.anaszewski@samsung.com> Acked-by: NSakari Ailus <sakari.ailus@linux.intel.com>
-