<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/leds/trigger, branch v5.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.1</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-03-30T18:09:32Z</updated>
<entry>
<title>leds: trigger: netdev: use memcpy in device_name_store</title>
<updated>2019-03-30T18:09:32Z</updated>
<author>
<name>Rasmus Villemoes</name>
<email>linux@rasmusvillemoes.dk</email>
</author>
<published>2019-03-14T14:06:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=909346433064b8d840dc82af26161926b8d37558'/>
<id>urn:sha1:909346433064b8d840dc82af26161926b8d37558</id>
<content type='text'>
If userspace doesn't end the input with a newline (which can easily
happen if the write happens from a C program that does write(fd,
iface, strlen(iface))), we may end up including garbage from a
previous, longer value in the device_name. For example

# cat device_name

# printf 'eth12' &gt; device_name
# cat device_name
eth12
# printf 'eth3' &gt; device_name
# cat device_name
eth32

I highly doubt anybody is relying on this behaviour, so switch to
simply copying the bytes (we've already checked that size is &lt;
IFNAMSIZ) and unconditionally zero-terminate it; of course, we also
still have to strip a trailing newline.

This is also preparation for future patches.

Fixes: 06f502f57d0d ("leds: trigger: Introduce a NETDEV trigger")
Signed-off-by: Rasmus Villemoes &lt;linux@rasmusvillemoes.dk&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>leds: trigger: netdev: fix refcnt leak on interface rename</title>
<updated>2019-03-26T19:25:37Z</updated>
<author>
<name>Rafał Miłecki</name>
<email>rafal@milecki.pl</email>
</author>
<published>2019-02-28T21:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4cb6560514fa19d556954b88128f3846fee66a03'/>
<id>urn:sha1:4cb6560514fa19d556954b88128f3846fee66a03</id>
<content type='text'>
Renaming a netdev-trigger-tracked interface was resulting in an
unbalanced dev_hold().

Example:
&gt; iw phy phy0 interface add foo type __ap
&gt; echo netdev &gt; trigger
&gt; echo foo &gt; device_name
&gt; ip link set foo name bar
&gt; iw dev bar del
[  237.355366] unregister_netdevice: waiting for bar to become free. Usage count = 1
[  247.435362] unregister_netdevice: waiting for bar to become free. Usage count = 1
[  257.545366] unregister_netdevice: waiting for bar to become free. Usage count = 1

Above problem was caused by trigger checking a dev-&gt;name which obviously
changes after renaming an interface. It meant missing all further events
including the NETDEV_UNREGISTER which is required for calling dev_put().

This change fixes that by:
1) Comparing device struct *address* for notification-filtering purposes
2) Dropping unneeded NETDEV_CHANGENAME code (no behavior change)

Fixes: 06f502f57d0d ("leds: trigger: Introduce a NETDEV trigger")
Signed-off-by: Rafał Miłecki &lt;rafal@milecki.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>leds: trigger: timer: Add initialization from Device Tree</title>
<updated>2019-01-16T21:09:25Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2019-01-09T14:44:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f85e8498a482cbfdab91fb2d1b81c6c8c1cfd15'/>
<id>urn:sha1:0f85e8498a482cbfdab91fb2d1b81c6c8c1cfd15</id>
<content type='text'>
Allow initialization of delays used in timer trigger from Device
Tree property.

This is especially useful for embedded systems where the trigger might
be used early, before bringing up user-space.

Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>leds: trigger: oneshot: Add initialization from Device Tree</title>
<updated>2019-01-16T21:09:18Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2019-01-09T14:44:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c9ab51e86bf1f3a24eb3477cbe5d4fb09d386a5'/>
<id>urn:sha1:9c9ab51e86bf1f3a24eb3477cbe5d4fb09d386a5</id>
<content type='text'>
Allow initialization of delays used in oneshot trigger from Device
Tree property.

This is especially useful for embedded systems where the trigger might
be used early, before bringing up user-space.

Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>leds: trigger: pattern: Add pattern initialization from Device Tree</title>
<updated>2019-01-16T21:08:47Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2019-01-09T14:44:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=aa6fd10481bdb1af2d4a4b5975e23674e989cd81'/>
<id>urn:sha1:aa6fd10481bdb1af2d4a4b5975e23674e989cd81</id>
<content type='text'>
Allow initialization of pattern used in pattern trigger from Device Tree
property.

This is especially useful for embedded systems where the pattern trigger
would be used to indicate the process of boot status in a nice,
user-friendly blinking way.  This initialization pattern will be used
till user-space is brought up and sets its own pattern, indicating the
boot status is for example finished.

Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>leds: trigger: Introduce audio mute LED trigger</title>
<updated>2018-11-28T11:28:30Z</updated>
<author>
<name>Takashi Iwai</name>
<email>tiwai@suse.de</email>
</author>
<published>2018-11-26T16:47:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=faa2541f5b1afa8b6d777a73bc2f27d5c8c98695'/>
<id>urn:sha1:faa2541f5b1afa8b6d777a73bc2f27d5c8c98695</id>
<content type='text'>
This patch adds a new LED trigger for coupling the audio mixer change
with the LED on laptops or other devices.  Currently there are two
trigger types, "audio-mute" and "audio-micmute".

The audio driver triggers the LED brightness change via
ledtrig_audio_set() call with the proper type (either mute or
mic-mute).  OTOH, the consumers may call ledtrig_audio_get() for the
initial brightness value that may have been set by the audio driver
beforehand.

This new stuff will be used by HD-audio codec driver and some platform
drivers (thinkpad_acpi and dell-laptop, also upcoming huawei-wmi).

Acked-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Pali Rohár &lt;pali.rohar@gmail.com&gt;
Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
</content>
</entry>
<entry>
<title>leds: trigger: Fix sleeping function called from invalid context</title>
<updated>2018-11-07T20:43:25Z</updated>
<author>
<name>Baolin Wang</name>
<email>baolin.wang@linaro.org</email>
</author>
<published>2018-11-07T05:42:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3a40cfe8ba3abba57af2c7e26aad2c6dd1681864'/>
<id>urn:sha1:3a40cfe8ba3abba57af2c7e26aad2c6dd1681864</id>
<content type='text'>
We will meet below issue due to mutex_lock() is called in interrupt context.
The mutex lock is used to protect the pattern trigger data, but before changing
new pattern trigger data (pattern values or repeat value) by users, we always
cancel the timer firstly to clear previous patterns' performance. That means
there is no race in pattern_trig_timer_function(), so we can drop the mutex
lock in pattern_trig_timer_function() to avoid this issue.

Moreover we can move the timer cancelling into mutex protection, since there
is no deadlock risk if we remove the mutex lock in pattern_trig_timer_function().

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:254
in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper/1
CPU: 1 PID: 0 Comm: swapper/1 Not tainted
4.20.0-rc1-koelsch-00841-ga338c8181013c1a9 #171
Hardware name: Generic R-Car Gen2 (Flattened Device Tree)
[&lt;c020f19c&gt;] (unwind_backtrace) from [&lt;c020aecc&gt;] (show_stack+0x10/0x14)
[&lt;c020aecc&gt;] (show_stack) from [&lt;c07affb8&gt;] (dump_stack+0x7c/0x9c)
[&lt;c07affb8&gt;] (dump_stack) from [&lt;c02417d4&gt;] (___might_sleep+0xf4/0x158)
[&lt;c02417d4&gt;] (___might_sleep) from [&lt;c07c92c4&gt;] (mutex_lock+0x18/0x60)
[&lt;c07c92c4&gt;] (mutex_lock) from [&lt;c067b28c&gt;] (pattern_trig_timer_function+0x1c/0x11c)
[&lt;c067b28c&gt;] (pattern_trig_timer_function) from [&lt;c027f6fc&gt;] (call_timer_fn+0x1c/0x90)
[&lt;c027f6fc&gt;] (call_timer_fn) from [&lt;c027f944&gt;] (expire_timers+0x94/0xa4)
[&lt;c027f944&gt;] (expire_timers) from [&lt;c027fc98&gt;] (run_timer_softirq+0x108/0x15c)
[&lt;c027fc98&gt;] (run_timer_softirq) from [&lt;c02021cc&gt;] (__do_softirq+0x1d4/0x258)
[&lt;c02021cc&gt;] (__do_softirq) from [&lt;c0224d24&gt;] (irq_exit+0x64/0xc4)
[&lt;c0224d24&gt;] (irq_exit) from [&lt;c0268dd0&gt;] (__handle_domain_irq+0x80/0xb4)
[&lt;c0268dd0&gt;] (__handle_domain_irq) from [&lt;c045e1b0&gt;] (gic_handle_irq+0x58/0x90)
[&lt;c045e1b0&gt;] (gic_handle_irq) from [&lt;c02019f8&gt;] (__irq_svc+0x58/0x74)
Exception stack(0xeb483f60 to 0xeb483fa8)
3f60: 00000000 00000000 eb9afaa0 c0217e80 00000000 ffffe000 00000000 c0e06408
3f80: 00000002 c0e0647c c0c6a5f0 00000000 c0e04900 eb483fb0 c0207ea8 c0207e98
3fa0: 60020013 ffffffff
[&lt;c02019f8&gt;] (__irq_svc) from [&lt;c0207e98&gt;] (arch_cpu_idle+0x1c/0x38)
[&lt;c0207e98&gt;] (arch_cpu_idle) from [&lt;c0247ca8&gt;] (do_idle+0x138/0x268)
[&lt;c0247ca8&gt;] (do_idle) from [&lt;c0248050&gt;] (cpu_startup_entry+0x18/0x1c)
[&lt;c0248050&gt;] (cpu_startup_entry) from [&lt;402022ec&gt;] (0x402022ec)

Fixes: 5fd752b6b3a2 ("leds: core: Introduce LED pattern trigger")
Signed-off-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Reported-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Tested-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>Fix pattern handling optimalization</title>
<updated>2018-10-25T18:47:46Z</updated>
<author>
<name>Pavel Machek</name>
<email>pavel@ucw.cz</email>
</author>
<published>2018-10-24T20:44:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1b50bb4d36e89fd54c14722c4ab5266ef17767ff'/>
<id>urn:sha1:1b50bb4d36e89fd54c14722c4ab5266ef17767ff</id>
<content type='text'>
Check for zero duration before skipping step. This fixes pattern

    echo "0 1000 10 2550 0 1000" &gt; pattern

which should do [  .-xXx-.] but does [   Xx-.]

Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Suggested-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>leds: core: Introduce LED pattern trigger</title>
<updated>2018-10-11T19:55:58Z</updated>
<author>
<name>Baolin Wang</name>
<email>baolin.wang@linaro.org</email>
</author>
<published>2018-10-11T04:07:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5fd752b6b3a2233972ce1726df8bdb40886113a9'/>
<id>urn:sha1:5fd752b6b3a2233972ce1726df8bdb40886113a9</id>
<content type='text'>
This patch adds a new LED trigger that LED device can configure
to employ software or hardware pattern engine.

Consumers can write 'pattern' file to enable the software pattern
which alters the brightness for the specified duration with one
software timer.

Moreover consumers can write 'hw_pattern' file to enable the hardware
pattern for some LED controllers which can autonomously control
brightness over time, according to some preprogrammed hardware
patterns.

Signed-off-by: Raphael Teysseyre &lt;rteysseyre@gmail.com&gt;
Signed-off-by: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
<entry>
<title>leds: gpio trigger: simplifications from core changes</title>
<updated>2018-07-05T21:21:15Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2018-07-02T20:05:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9bfd7d9e5d63532da2d2d55a6bec5bb377761d37'/>
<id>urn:sha1:9bfd7d9e5d63532da2d2d55a6bec5bb377761d37</id>
<content type='text'>
The trigger core learned error handling for the activate callback and
to handle device attributes. Also make use of the module_led_trigger()
helper to simplify trigger registration.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Signed-off-by: Jacek Anaszewski &lt;jacek.anaszewski@gmail.com&gt;
</content>
</entry>
</feed>
