^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) What: /sys/devices/.../state_synced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) Date: May 2020
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) Contact: Saravana Kannan <saravanak@google.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) Description:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) The /sys/devices/.../state_synced attribute is only present for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) devices whose bus types or driver provides the .sync_state()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) callback. The number read from it (0 or 1) reflects the value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) of the device's 'state_synced' field. A value of 0 means the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) .sync_state() callback hasn't been called yet. A value of 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) means the .sync_state() callback has been called.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Generally, if a device has sync_state() support and has some of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) the resources it provides enabled at the time the kernel starts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) (Eg: enabled by hardware reset or bootloader or anything that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) run before the kernel starts), then it'll keep those resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) enabled and in a state that's compatible with the state they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) were in at the start of the kernel. The device will stop doing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) this only when the sync_state() callback has been called --
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) which happens only when all its consumer devices are registered
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) and have probed successfully. Resources that were left disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) at the time the kernel starts are not affected or limited in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) any way by sync_state() callbacks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)