-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
driver core: Add state_synced sysfs file for devices that support it
This can be used to check if a device supports sync_state() callbacks and therefore keeps resources left on by the bootloader enabled till all its consumers have probed. This can also be used to check if sync_state() has been called for a device or whether it is still trying to keep resources enabled because they were left enabled by the bootloader and all its consumers haven't probed yet. Signed-off-by: Saravana Kannan <saravanak@google.com> Link: https://lore.kernel.org/r/20200521191800.136035-3-saravanak@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
- Loading branch information
Saravana Kannan
authored and
Greg Kroah-Hartman
committed
Jul 10, 2020
1 parent
287905e
commit 8fd456e
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
What: /sys/devices/.../state_synced | ||
Date: May 2020 | ||
Contact: Saravana Kannan <saravanak@google.com> | ||
Description: | ||
The /sys/devices/.../state_synced attribute is only present for | ||
devices whose bus types or driver provides the .sync_state() | ||
callback. The number read from it (0 or 1) reflects the value | ||
of the device's 'state_synced' field. A value of 0 means the | ||
.sync_state() callback hasn't been called yet. A value of 1 | ||
means the .sync_state() callback has been called. | ||
|
||
Generally, if a device has sync_state() support and has some of | ||
the resources it provides enabled at the time the kernel starts | ||
(Eg: enabled by hardware reset or bootloader or anything that | ||
run before the kernel starts), then it'll keep those resources | ||
enabled and in a state that's compatible with the state they | ||
were in at the start of the kernel. The device will stop doing | ||
this only when the sync_state() callback has been called -- | ||
which happens only when all its consumer devices are registered | ||
and have probed successfully. Resources that were left disabled | ||
at the time the kernel starts are not affected or limited in | ||
any way by sync_state() callbacks. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters