From: Lee Jones <lee@kernel.org>
To: Christian Marangi <ansuelsmth@gmail.com>
Cc: Pavel Machek <pavel@ucw.cz>, Martin Schiller <ms@dev.tdt.de>,
linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH 5/5] leds: trigger: netdev: use mutex instead of spinlocks
Date: Mon, 24 Apr 2023 14:45:02 +0100 [thread overview]
Message-ID: <20230424134502.GK50521@google.com> (raw)
In-Reply-To: <20230419210743.3594-6-ansuelsmth@gmail.com>
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 [李琼斯]
prev parent reply other threads:[~2023-04-24 13:45 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 21:07 [PATCH 0/5] leds: trigger: netdev: fixup preparation for LEDs hw control Christian Marangi
2023-04-19 21:07 ` [PATCH 1/5] leds: trigger: netdev: recheck NETDEV_LED_MODE_LINKUP on dev rename Christian Marangi
2023-04-20 0:21 ` Andrew Lunn
2023-04-24 13:42 ` Lee Jones
2023-04-19 21:07 ` [PATCH 2/5] leds: trigger: netdev: drop NETDEV_LED_MODE_LINKUP from mode Christian Marangi
2023-04-20 0:24 ` Andrew Lunn
2023-04-24 13:42 ` Lee Jones
2023-04-19 21:07 ` [PATCH 3/5] leds: trigger: netdev: rename add namespace to netdev trigger enum modes Christian Marangi
2023-04-20 0:29 ` Andrew Lunn
2023-04-24 13:44 ` Lee Jones
2023-04-19 21:07 ` [PATCH 4/5] leds: trigger: netdev: convert device attr to macro Christian Marangi
2023-04-20 0:26 ` Andrew Lunn
2023-04-24 13:44 ` Lee Jones
2023-04-19 21:07 ` [PATCH 5/5] leds: trigger: netdev: use mutex instead of spinlocks Christian Marangi
2023-04-20 0:27 ` Andrew Lunn
2023-04-24 13:45 ` Lee Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230424134502.GK50521@google.com \
--to=lee@kernel.org \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=ms@dev.tdt.de \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).