__device_li...e_sync_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __device_li...e_sync_state(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual πŸŽ€ β€” yes the title is lowkey truncated with dots and yes that's just how it is, we don't ask questions, we just vibe. This one's about __device_links_queue_sync_state, which honestly is giving "long name, big job" energy. Let's get into it πŸ’–


✨ NAME ✨

__device_links_queue_sync_state β€” Queue a device for sync_state() callback πŸ¦‹


🌸 SYNOPSIS 🌸

void __device_links_queue_sync_state (struct device *dev , struct list_head *list );

πŸ’œ ARGUMENTS πŸ’œ

  • dev β€” the Device you want to call sync_state on 🫢
  • list β€” the List head you're queueing the dev on ⭐

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea β˜•: this function queues a device up for a sync_state callback, but specifically when the device links write lock isn't held. That's the whole point, iykyk β€” it lets the sync_state execution flow use device links APIs without things getting messy πŸ’…

girl, listen πŸ™ˆ β€” the caller must ensure this function is called with device_links_write_lock held. That's not a suggestion, that's the rule, periodt.

This function does a get_device to make sure the device is not freed while it's sitting on this list. Very protective, very main character energy πŸ‘‘

So the caller must also ensure that device_links_flush_sync_list is called as soon as the caller releases device_links_write_lock. Why? Because that's necessary to make sure the sync_state is called in a timely fashion ⏰ and the put_device is called on this device. Both of those things need to happen, no cap πŸ’―


🌈 SEE ALSO 🌈

Kernel file ./drivers/base/core.c β€” and now the friend group, because there's a lot of them 🧚✨


and that's the whole page, bestie, you ate that πŸ“βœ¨

tiny sign-off moment πŸŽ€ β€” this one lives in ./drivers/base, stamped October 2026, and it's still __device_li...e_sync_state(9) because the title said so πŸ’€πŸ’–

πŸ“¦ where this page comes from