* [RFC PATCH 0/5] Introduce and use device_create_groups
@ 2013-07-06 17:22 Guenter Roeck
0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2013-07-06 17:22 UTC (permalink / raw)
To: Jean Delvare, Greg Kroah-Hartman; +Cc: lm-sensors, linux-kernel
This patch series introduces the new driver core API function
device_create_groups().
device_create_groups() lets callers create devices as well as associated
sysfs attributes with a single call. This avoids potential race conditions
seen if sysfs attributes on new devices are created later.
The rationale for the new API is that sysfs attributes should be created
synchronously with device creation to avoid race conditions, as outlined in
http://www.linuxfoundation.org/news-media/blogs/browse/2013/06/how-create-sysfs-file-correctly.
Unfortunately, the only API function to create a device dynamically is
device_create, which does not support the notion of adding sysfs attributes
when creating a device. The new API call is similar but lets the caller provide
a list of sysfs attribute groups.
The first patch in the series introduces the new driver core API function.
The second patch introduces hwmon_device_register_groups(), which uses the new
API call.
The remaining patches convert some hwmon drivers to use the new API to show and
test its use.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [RFC PATCH 0/5] Introduce and use device_create_groups
2013-07-06 17:24 Guenter Roeck
@ 2013-07-06 17:33 ` Greg Kroah-Hartman
0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2013-07-06 17:33 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Jean Delvare, lm-sensors, linux-kernel
On Sat, Jul 06, 2013 at 10:24:50AM -0700, Guenter Roeck wrote:
> This patch series introduces the new driver core API function
> device_create_groups().
>
> device_create_groups() lets callers create devices as well as associated
> sysfs attributes with a single call. This avoids potential race conditions
> seen if sysfs attributes on new devices are created later.
>
> The rationale for the new API is that sysfs attributes should be created
> synchronously with device creation to avoid race conditions, as outlined in
> http://www.linuxfoundation.org/news-media/blogs/browse/2013/06/how-create-sysfs-file-correctly.
>
> Unfortunately, the only API function to create a device dynamically is
> device_create, which does not support the notion of adding sysfs attributes
> when creating a device. The new API call is similar but lets the caller provide
> a list of sysfs attribute groups.
What's wrong with the default attribute groups that all devices, busses,
and classes can define to be properly created when the device is added
to the driver core? How does that not already provide this
functionality?
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH 0/5] Introduce and use device_create_groups
@ 2013-07-06 17:24 Guenter Roeck
2013-07-06 17:33 ` Greg Kroah-Hartman
0 siblings, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2013-07-06 17:24 UTC (permalink / raw)
To: Jean Delvare, Greg Kroah-Hartman; +Cc: lm-sensors, linux-kernel, Guenter Roeck
This patch series introduces the new driver core API function
device_create_groups().
device_create_groups() lets callers create devices as well as associated
sysfs attributes with a single call. This avoids potential race conditions
seen if sysfs attributes on new devices are created later.
The rationale for the new API is that sysfs attributes should be created
synchronously with device creation to avoid race conditions, as outlined in
http://www.linuxfoundation.org/news-media/blogs/browse/2013/06/how-create-sysfs-file-correctly.
Unfortunately, the only API function to create a device dynamically is
device_create, which does not support the notion of adding sysfs attributes
when creating a device. The new API call is similar but lets the caller provide
a list of sysfs attribute groups.
The first patch in the series introduces the new driver core API function.
The second patch introduces hwmon_device_register_groups(), which uses the new
API call.
The remaining patches convert some hwmon drivers to use the new API to show and
test its use.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH 0/5] Introduce and use device_create_groups
@ 2013-07-06 17:23 Guenter Roeck
0 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2013-07-06 17:23 UTC (permalink / raw)
To: Jean Delvare, Greg Kroah-Hartman; +Cc: lm-sensors, linux-kernel
This patch series introduces the new driver core API function
device_create_groups().
device_create_groups() lets callers create devices as well as associated
sysfs attributes with a single call. This avoids potential race conditions
seen if sysfs attributes on new devices are created later.
The rationale for the new API is that sysfs attributes should be created
synchronously with device creation to avoid race conditions, as outlined in
http://www.linuxfoundation.org/news-media/blogs/browse/2013/06/how-create-sysfs-file-correctly.
Unfortunately, the only API function to create a device dynamically is
device_create, which does not support the notion of adding sysfs attributes
when creating a device. The new API call is similar but lets the caller provide
a list of sysfs attribute groups.
The first patch in the series introduces the new driver core API function.
The second patch introduces hwmon_device_register_groups(), which uses the new
API call.
The remaining patches convert some hwmon drivers to use the new API to show and
test its use.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-07-06 17:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-06 17:22 [RFC PATCH 0/5] Introduce and use device_create_groups Guenter Roeck
2013-07-06 17:23 Guenter Roeck
2013-07-06 17:24 Guenter Roeck
2013-07-06 17:33 ` Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®