From: Heiner Kallweit <hkallweit1@gmail.com>
To: linux-leds@vger.kernel.org
Cc: Jacek Anaszewski <j.anaszewski@samsung.com>
Subject: Locking in LED core really not needed or missing?
Date: Fri, 8 Jan 2016 21:31:12 +0100 [thread overview]
Message-ID: <56901C90.2050801@gmail.com> (raw)
I'm a little puzzled about the more or less completely missing locking in the LED core.
Let's just take led_timer_function as example.
It modifies led_cdev->flags and led_cdev->brightness from soft irq context
(soft blink timer) w/o locking. Accessing these fields is not guaranteed to be atomic
and the function doesn't even use set_bit etc. for modifying the bitmap.
And brightness_set and other exported functions can even be called from
hard irq context (e.g. by triggers).
This seems to be quite unsafe to me. Just think of a soft or hard irq colliding
with a sysfs access. IMHO it's just due to the fact that these collision scenarios
are relatively unlikely that we don't have problems.
Am I missing something or is this actually an open issue?
next reply other threads:[~2016-01-08 20:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-08 20:31 Heiner Kallweit [this message]
2016-01-10 8:17 ` Locking in LED core really not needed or missing? Jacek Anaszewski
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=56901C90.2050801@gmail.com \
--to=hkallweit1@gmail.com \
--cc=j.anaszewski@samsung.com \
--cc=linux-leds@vger.kernel.org \
/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).