<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/leds, branch linux-5.11.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-5.11.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-5.11.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-02-14T17:01:41+00:00</updated>
<entry>
<title>leds: rt8515: add V4L2_FLASH_LED_CLASS dependency</title>
<updated>2021-02-14T17:01:41+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2021-02-04T15:39:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dbeb02a0bc41b9e9b9c05e460890351efecf1352'/>
<id>urn:sha1:dbeb02a0bc41b9e9b9c05e460890351efecf1352</id>
<content type='text'>
The leds-rt8515 driver can optionall use the v4l2 flash led class,
but it causes a link error when that class is in a loadable module
and the rt8515 driver itself is built-in:

ld.lld: error: undefined symbol: v4l2_flash_init
&gt;&gt;&gt; referenced by leds-rt8515.c
&gt;&gt;&gt;               leds/flash/leds-rt8515.o:(rt8515_probe) in archive
drivers/built-in.a

Adding 'depends on V4L2_FLASH_LED_CLASS' in Kconfig would avoid that,
but it would make it impossible to use the driver without the
v4l2 support.

Add the same dependency that the other users of this class have
instead, which just prevents the broken configuration.

Fixes: e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: rt8515: Add Richtek RT8515 LED driver</title>
<updated>2021-01-31T09:38:03+00:00</updated>
<author>
<name>Linus Walleij</name>
<email>linus.walleij@linaro.org</email>
</author>
<published>2021-01-02T23:15:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1c6edcbea13de025c3406645b4cce4ac3baf973'/>
<id>urn:sha1:e1c6edcbea13de025c3406645b4cce4ac3baf973</id>
<content type='text'>
This adds a driver for the Richtek RT8515 dual channel
torch/flash white LED driver.

This LED driver is found in some mobile phones from
Samsung such as the GT-S7710 and GT-I8190.

A V4L interface is added.

We do not have a proper datasheet for the RT8515 but
it turns out that RT9387A has a public datasheet and
is essentially the same chip. We designed the driver
in accordance with this datasheet. The day someone
needs to drive a RT9387A this driver can probably
easily be augmented to handle that chip too.

Sakari Ailus, Pavel Machek and Andy Shevchenko helped
significantly in getting this driver right.

Cc: Sakari Ailus &lt;sakari.ailus@iki.fi&gt;
Cc: newbytee@protonmail.com
Cc: Stephan Gerhold &lt;stephan@gerhold.net&gt;
Cc: linux-media@vger.kernel.org
Cc: phone-devel@vger.kernel.org
Reviewed-by: Sakari Ailus &lt;sakari.ailus@linux.intel.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: trigger: fix potential deadlock with libata</title>
<updated>2021-01-31T09:38:03+00:00</updated>
<author>
<name>Andrea Righi</name>
<email>andrea.righi@canonical.com</email>
</author>
<published>2020-11-25T15:18:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=27af8e2c90fba242460b01fa020e6e19ed68c495'/>
<id>urn:sha1:27af8e2c90fba242460b01fa020e6e19ed68c495</id>
<content type='text'>
We have the following potential deadlock condition:

 ========================================================
 WARNING: possible irq lock inversion dependency detected
 5.10.0-rc2+ #25 Not tainted
 --------------------------------------------------------
 swapper/3/0 just changed the state of lock:
 ffff8880063bd618 (&amp;host-&gt;lock){-...}-{2:2}, at: ata_bmdma_interrupt+0x27/0x200
 but this lock took another, HARDIRQ-READ-unsafe lock in the past:
  (&amp;trig-&gt;leddev_list_lock){.+.?}-{2:2}

 and interrupts could create inverse lock ordering between them.

 other info that might help us debug this:
  Possible interrupt unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(&amp;trig-&gt;leddev_list_lock);
                                local_irq_disable();
                                lock(&amp;host-&gt;lock);
                                lock(&amp;trig-&gt;leddev_list_lock);
   &lt;Interrupt&gt;
     lock(&amp;host-&gt;lock);

  *** DEADLOCK ***

 no locks held by swapper/3/0.

 the shortest dependencies between 2nd lock and 1st lock:
  -&gt; (&amp;trig-&gt;leddev_list_lock){.+.?}-{2:2} ops: 46 {
     HARDIRQ-ON-R at:
                       lock_acquire+0x15f/0x420
                       _raw_read_lock+0x42/0x90
                       led_trigger_event+0x2b/0x70
                       rfkill_global_led_trigger_worker+0x94/0xb0
                       process_one_work+0x240/0x560
                       worker_thread+0x58/0x3d0
                       kthread+0x151/0x170
                       ret_from_fork+0x1f/0x30
     IN-SOFTIRQ-R at:
                       lock_acquire+0x15f/0x420
                       _raw_read_lock+0x42/0x90
                       led_trigger_event+0x2b/0x70
                       kbd_bh+0x9e/0xc0
                       tasklet_action_common.constprop.0+0xe9/0x100
                       tasklet_action+0x22/0x30
                       __do_softirq+0xcc/0x46d
                       run_ksoftirqd+0x3f/0x70
                       smpboot_thread_fn+0x116/0x1f0
                       kthread+0x151/0x170
                       ret_from_fork+0x1f/0x30
     SOFTIRQ-ON-R at:
                       lock_acquire+0x15f/0x420
                       _raw_read_lock+0x42/0x90
                       led_trigger_event+0x2b/0x70
                       rfkill_global_led_trigger_worker+0x94/0xb0
                       process_one_work+0x240/0x560
                       worker_thread+0x58/0x3d0
                       kthread+0x151/0x170
                       ret_from_fork+0x1f/0x30
     INITIAL READ USE at:
                           lock_acquire+0x15f/0x420
                           _raw_read_lock+0x42/0x90
                           led_trigger_event+0x2b/0x70
                           rfkill_global_led_trigger_worker+0x94/0xb0
                           process_one_work+0x240/0x560
                           worker_thread+0x58/0x3d0
                           kthread+0x151/0x170
                           ret_from_fork+0x1f/0x30
   }
   ... key      at: [&lt;ffffffff83da4c00&gt;] __key.0+0x0/0x10
   ... acquired at:
    _raw_read_lock+0x42/0x90
    led_trigger_blink_oneshot+0x3b/0x90
    ledtrig_disk_activity+0x3c/0xa0
    ata_qc_complete+0x26/0x450
    ata_do_link_abort+0xa3/0xe0
    ata_port_freeze+0x2e/0x40
    ata_hsm_qc_complete+0x94/0xa0
    ata_sff_hsm_move+0x177/0x7a0
    ata_sff_pio_task+0xc7/0x1b0
    process_one_work+0x240/0x560
    worker_thread+0x58/0x3d0
    kthread+0x151/0x170
    ret_from_fork+0x1f/0x30

 -&gt; (&amp;host-&gt;lock){-...}-{2:2} ops: 69 {
    IN-HARDIRQ-W at:
                     lock_acquire+0x15f/0x420
                     _raw_spin_lock_irqsave+0x52/0xa0
                     ata_bmdma_interrupt+0x27/0x200
                     __handle_irq_event_percpu+0xd5/0x2b0
                     handle_irq_event+0x57/0xb0
                     handle_edge_irq+0x8c/0x230
                     asm_call_irq_on_stack+0xf/0x20
                     common_interrupt+0x100/0x1c0
                     asm_common_interrupt+0x1e/0x40
                     native_safe_halt+0xe/0x10
                     arch_cpu_idle+0x15/0x20
                     default_idle_call+0x59/0x1c0
                     do_idle+0x22c/0x2c0
                     cpu_startup_entry+0x20/0x30
                     start_secondary+0x11d/0x150
                     secondary_startup_64_no_verify+0xa6/0xab
    INITIAL USE at:
                    lock_acquire+0x15f/0x420
                    _raw_spin_lock_irqsave+0x52/0xa0
                    ata_dev_init+0x54/0xe0
                    ata_link_init+0x8b/0xd0
                    ata_port_alloc+0x1f1/0x210
                    ata_host_alloc+0xf1/0x130
                    ata_host_alloc_pinfo+0x14/0xb0
                    ata_pci_sff_prepare_host+0x41/0xa0
                    ata_pci_bmdma_prepare_host+0x14/0x30
                    piix_init_one+0x21f/0x600
                    local_pci_probe+0x48/0x80
                    pci_device_probe+0x105/0x1c0
                    really_probe+0x221/0x490
                    driver_probe_device+0xe9/0x160
                    device_driver_attach+0xb2/0xc0
                    __driver_attach+0x91/0x150
                    bus_for_each_dev+0x81/0xc0
                    driver_attach+0x1e/0x20
                    bus_add_driver+0x138/0x1f0
                    driver_register+0x91/0xf0
                    __pci_register_driver+0x73/0x80
                    piix_init+0x1e/0x2e
                    do_one_initcall+0x5f/0x2d0
                    kernel_init_freeable+0x26f/0x2cf
                    kernel_init+0xe/0x113
                    ret_from_fork+0x1f/0x30
  }
  ... key      at: [&lt;ffffffff83d9fdc0&gt;] __key.6+0x0/0x10
  ... acquired at:
    __lock_acquire+0x9da/0x2370
    lock_acquire+0x15f/0x420
    _raw_spin_lock_irqsave+0x52/0xa0
    ata_bmdma_interrupt+0x27/0x200
    __handle_irq_event_percpu+0xd5/0x2b0
    handle_irq_event+0x57/0xb0
    handle_edge_irq+0x8c/0x230
    asm_call_irq_on_stack+0xf/0x20
    common_interrupt+0x100/0x1c0
    asm_common_interrupt+0x1e/0x40
    native_safe_halt+0xe/0x10
    arch_cpu_idle+0x15/0x20
    default_idle_call+0x59/0x1c0
    do_idle+0x22c/0x2c0
    cpu_startup_entry+0x20/0x30
    start_secondary+0x11d/0x150
    secondary_startup_64_no_verify+0xa6/0xab

This lockdep splat is reported after:
commit e918188611f0 ("locking: More accurate annotations for read_lock()")

To clarify:
 - read-locks are recursive only in interrupt context (when
   in_interrupt() returns true)
 - after acquiring host-&gt;lock in CPU1, another cpu (i.e. CPU2) may call
   write_lock(&amp;trig-&gt;leddev_list_lock) that would be blocked by CPU0
   that holds trig-&gt;leddev_list_lock in read-mode
 - when CPU1 (ata_ac_complete()) tries to read-lock
   trig-&gt;leddev_list_lock, it would be blocked by the write-lock waiter
   on CPU2 (because we are not in interrupt context, so the read-lock is
   not recursive)
 - at this point if an interrupt happens on CPU0 and
   ata_bmdma_interrupt() is executed it will try to acquire host-&gt;lock,
   that is held by CPU1, that is currently blocked by CPU2, so:

   * CPU0 blocked by CPU1
   * CPU1 blocked by CPU2
   * CPU2 blocked by CPU0

     *** DEADLOCK ***

The deadlock scenario is better represented by the following schema
(thanks to Boqun Feng &lt;boqun.feng@gmail.com&gt; for the schema and the
detailed explanation of the deadlock condition):

 CPU 0:                          CPU 1:                        CPU 2:
 -----                           -----                         -----
 led_trigger_event():
   read_lock(&amp;trig-&gt;leddev_list_lock);
 				&lt;workqueue&gt;
 				ata_hsm_qc_complete():
 				  spin_lock_irqsave(&amp;host-&gt;lock);
 								write_lock(&amp;trig-&gt;leddev_list_lock);
 				  ata_port_freeze():
 				    ata_do_link_abort():
 				      ata_qc_complete():
 					ledtrig_disk_activity():
 					  led_trigger_blink_oneshot():
 					    read_lock(&amp;trig-&gt;leddev_list_lock);
 					    // ^ not in in_interrupt() context, so could get blocked by CPU 2
 &lt;interrupt&gt;
   ata_bmdma_interrupt():
     spin_lock_irqsave(&amp;host-&gt;lock);

Fix by using read_lock_irqsave/irqrestore() in led_trigger_event(), so
that no interrupt can happen in between, preventing the deadlock
condition.

Apply the same change to led_trigger_blink_setup() as well, since the
same deadlock scenario can also happen in power_supply_update_bat_leds()
-&gt; led_trigger_blink() -&gt; led_trigger_blink_setup() (workqueue context),
and potentially prevent other similar usages.

Link: https://lore.kernel.org/lkml/20201101092614.GB3989@xps-13-7390/
Fixes: eb25cb9956cc ("leds: convert IDE trigger to common disk trigger")
Signed-off-by: Andrea Righi &lt;andrea.righi@canonical.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: leds-ariel: convert comma to semicolon</title>
<updated>2021-01-31T09:38:02+00:00</updated>
<author>
<name>Zheng Yongjun</name>
<email>zhengyongjun3@huawei.com</email>
</author>
<published>2020-12-14T13:45:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=47854d2d2ba8f100c419557a7d9d8f155c0a1064'/>
<id>urn:sha1:47854d2d2ba8f100c419557a7d9d8f155c0a1064</id>
<content type='text'>
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun &lt;zhengyongjun3@huawei.com&gt;
Reviewed-by: Alexander Dahl &lt;ada@thorsis.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: leds-lm3533: convert comma to semicolon</title>
<updated>2021-01-31T09:38:02+00:00</updated>
<author>
<name>Zheng Yongjun</name>
<email>zhengyongjun3@huawei.com</email>
</author>
<published>2020-12-16T13:16:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4e04b11800194f2ec756b5f3e9f2e559df5a0b1e'/>
<id>urn:sha1:4e04b11800194f2ec756b5f3e9f2e559df5a0b1e</id>
<content type='text'>
Replace a comma between expression statements by a semicolon.

Signed-off-by: Zheng Yongjun &lt;zhengyongjun3@huawei.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: turris-omnia: check for LED_COLOR_ID_RGB instead LED_COLOR_ID_MULTI</title>
<updated>2020-11-25T12:25:28+00:00</updated>
<author>
<name>Marek Behún</name>
<email>kabel@kernel.org</email>
</author>
<published>2020-10-30T02:39:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=98650b0874171cc443251f7b369d3b1544db9d4e'/>
<id>urn:sha1:98650b0874171cc443251f7b369d3b1544db9d4e</id>
<content type='text'>
LED core does not allow LED_COLOR_ID_MULTI for now and instead for RGB
LEDs prefers LED_COLOR_ID_RGB.

Signed-off-by: Marek Behún &lt;kabel@kernel.org&gt;
Fixes: 77dce3a22e89 ("leds: disallow /sys/class/leds/*:multi:* for now")
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: turris-omnia: fix checkpatch warning</title>
<updated>2020-11-25T12:25:27+00:00</updated>
<author>
<name>Marek Behún</name>
<email>kabel@kernel.org</email>
</author>
<published>2020-10-30T02:39:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fca050bb3c81dc7e6df9b1d02f3007cbec0dd898'/>
<id>urn:sha1:fca050bb3c81dc7e6df9b1d02f3007cbec0dd898</id>
<content type='text'>
Use kstrtoul instead of sscanf to satisfy checkpatch.

Signed-off-by: Marek Behún &lt;kabel@kernel.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: turris-omnia: wrap to 80 columns</title>
<updated>2020-11-25T12:25:27+00:00</updated>
<author>
<name>Marek Behún</name>
<email>kabel@kernel.org</email>
</author>
<published>2020-10-30T02:39:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5d47ce1d814e9136b24341fc5dedcd058caef312'/>
<id>urn:sha1:5d47ce1d814e9136b24341fc5dedcd058caef312</id>
<content type='text'>
Although checkpatch changed the max-line-length default to 100 columns,
we still prefer 80 columns somewhere.

Signed-off-by: Marek Behún &lt;kabel@kernel.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: turris-omnia: use constants instead of macros for color command</title>
<updated>2020-11-25T12:25:27+00:00</updated>
<author>
<name>Marek Behún</name>
<email>kabel@kernel.org</email>
</author>
<published>2020-10-30T02:39:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=493d2e432f38cd366ab78dcec53781a0fddc2822'/>
<id>urn:sha1:493d2e432f38cd366ab78dcec53781a0fddc2822</id>
<content type='text'>
Use integer constants directly when building I2C messages for LED color
change command, instead of macros. The command is simple enough to
understand what is going on even without these names.

Signed-off-by: Marek Behún &lt;kabel@kernel.org&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
<entry>
<title>leds: lp50xx: Fix an error handling path in 'lp50xx_probe_dt()'</title>
<updated>2020-11-25T12:18:20+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2020-09-22T21:05:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6d8d014c7dcf85a79da71ef586d06d03d2cae558'/>
<id>urn:sha1:6d8d014c7dcf85a79da71ef586d06d03d2cae558</id>
<content type='text'>
In case of memory allocation failure, we must release some resources as
done in all other error handling paths of the function.

'goto child_out' instead of a direct return so that 'fwnode_handle_put()'
is called when we break out of a 'device_for_each_child_node' loop.

Fixes: 242b81170fb8 ("leds: lp50xx: Add the LP50XX family of the RGB LED driver")
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Acked-by: Dan Murphy &lt;dmurphy@ti.com&gt;
Signed-off-by: Pavel Machek &lt;pavel@ucw.cz&gt;
</content>
</entry>
</feed>
