lkml.org 
[lkml]   [2023]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 5/5] leds: trigger: netdev: use mutex instead of spinlocks
On Wed, 19 Apr 2023, Christian Marangi wrote:

> Some LEDs may require to sleep while doing some operation like setting
> brightness and other cleanup.
>
> For this reason, using a spinlock will cause a sleep under spinlock
> warning.
>
> It should be safe to convert this to a sleepable lock since:
> - sysfs read/write can sleep
> - netdev_trig_work is a work queue and can sleep
> - netdev _trig_notify can sleep
>
> The spinlock was used when brightness didn't support sleeping, but this
> changed and now it supported with brightness_set_blocking().
>
> Convert to mutex lock to permit sleeping using brightness_set_blocking().
>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
> drivers/leds/trigger/ledtrig-netdev.c | 18 +++++++++---------
> 1 file changed, 9 insertions(+), 9 deletions(-)

Applied, thanks

--
Lee Jones [李琼斯]

\
 
 \ /
  Last update: 2023-04-24 15:45    [W:0.206 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site