sata_link_hardreset(9)
sata_link_hardreset(9) πβ¨
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms