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