sata_link_hardreset(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so welcome to the Kernel API Manual entry for sata_link_hardreset(9), bestie β€” it’s giving β€œreset link via SATA phy reset” main character energy, and we’re gonna get into it πŸ’…

πŸ’– NAME πŸ’–

sata_link_hardreset β€” reset link via SATA phy reset. that’s the name, and yes it ate.

🌸 SYNOPSIS 🌸

int sata_link_hardreset (struct ata_link *link , const unsigned int *timing , unsigned long deadline , bool *online , int (*check_ready)(struct ata_link *) );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • link β€” the link to reset, periodt.
  • timing β€” timing parameters { interval, duration, timeout } in msec. yes bestie, those three values, in milliseconds.
  • deadline β€” deadline jiffies for the operation. jiffies, not vibes 🫢
  • online β€” optional out parameter indicating link onlineness. it’s optional, and it’s an out parameter.
  • check_ready β€” optional callback to check link readiness. also optional, and it’s a callback.

✨ DESCRIPTION ✨

okay so the actual tea: this does a SATA phy-reset link using the DET bits of the SControl register. iconic. After hardreset, link readiness is waited upon using ata_wait_ready if check_ready is specified. so if you pass check_ready, the function waits for readiness with ata_wait_ready β€” no cap.

LLDs are allowed to not specify check_ready and wait itself after this function returns. and device classification is LLD’s responsibility, not this function’s. so don’t come for it if your device class isn’t sorted πŸ’€

*online is set to one iff reset succeeded and link is online after reset. that β€œiff” is doing a lot of work, bestie β€” one only when both of those things are true.

LOCKING: Kernel thread context (may sleep) β€” fr fr, it may sleep 😭

πŸŽ€ RETURN πŸŽ€

0 on success, -errno otherwise. that’s it: success is 0, everything else is -errno vibes.

🌈 SEE ALSO 🌈

Kernel file ./drivers/ata/libata-sata.c is the source of truth, and the whole squad is: sata_scr_valid(9), sata_scr_read(9), sata_scr_write(9), sata_scr_write_flush(9), ata_tf_to_fis(9), ata_tf_from_fis(9), sata_link_debounce(9), sata_link_resume(9), sata_link_scr_lpm(9), sata_set_spd_needed(9), sata_set_spd(9), sata_down_spd_limit(9), sata_std_hardreset(9), ata_qc_complete_multiple(9), ata_slave_link_init(9), sata_lpm_ignore_phy_events(9), ata_ncq_prio_supported(9), ata_ncq_prio_enabled(9), ata_ncq_prio_enable(9), ata_change_queue_depth(9), ata_scsi_change_queue_depth(9), ata_sas_sdev_configure(9), ata_sas_queuecmd(9), sata_async_notification(9), ata_eh_read_log_10h(9), ata_eh_get_ncq_success_sense(9), ata_eh_analyze_ncq_error(9). go read those if you want the full lore, iykyk πŸ’œ


mwah πŸ’‹ this lil page is filed under ./drivers/ata and dated October 2026 β€” that’s the source/version and date, folded into a cute sign-off, bestie 🫢✨

πŸ“¦ where this page comes from