linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sysfs permissions on dynamic attributes (led delay_on and delay_off)
@ 2012-07-21  0:46 Colin Cross
  2012-07-21  4:08 ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Colin Cross @ 2012-07-21  0:46 UTC (permalink / raw)
  To: lkml, Greg KH, Bryan Wu, Richard Purdie

I'm trying to use the standard ledtrig-timer.c code to handle led
blinking for notifications on an Android device, and I'm hitting some
issues with setting permissions on the dynamically created delay_on
and delay_off attributes.  For most sysfs files, we have userspace
uevent parser that watches for device add notifications and
chowns/chmods attributes.  This doesn't work for delay_on and
delay_off, because they are created later, when "timer" is written to
the trigger attribute.  There is no uevent when the new files are
created, and sysfs doesn't support inotify, so I don't see any way to
receive an event to set the permissions.  This issue exists any time
that device_create_file is called after device_add.

What is the appropriate way to get an event to set the permissions?
Add inotify support for sysfs file creation?  Send a KOBJ_CHANGE
uevent in device_create_file? Send a KOBJ_CHANGE uevent from the
driver after calling device_create_file?  Dynamically create a timer
device under /sys/class/leds/<led> so a new add uevent gets sent?
Promote blinking to be a core led feature instead of a trigger, so the
files are always present?

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-07-21 16:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21  0:46 sysfs permissions on dynamic attributes (led delay_on and delay_off) Colin Cross
2012-07-21  4:08 ` Greg KH
2012-07-21  5:14   ` Colin Cross
2012-07-21 15:07     ` Greg KH
2012-07-21  7:33   ` Richard Purdie
2012-07-21  8:26     ` Colin Cross
2012-07-21 11:21       ` Richard Purdie
2012-07-21 14:31         ` Henrique de Moraes Holschuh
2012-07-21 15:42         ` Colin Cross
2012-07-21 16:08           ` Henrique de Moraes Holschuh
2012-07-21 16:15             ` Greg KH
2012-07-21 16:23               ` Colin Cross
2012-07-21 16:13           ` Greg KH
2012-07-21 16:22             ` Colin Cross

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).