sata_scr_write(9)
π sata_scr_write β like, the Kernel API Manual (section 9) page for it, bestie
Okay so picture this: you're down in the drivers/ata trenches, you've got a port, you've got an SCR register, and you need to write to it. That's the whole gig. This page is sata_scr_write(9) and she's here to help π«Ά
β¨ SYNOPSIS β¨
int sata_scr_write (struct ata_link *link , int reg , u32 val );
Three args, one int back. Clean. Iconic. No notes π
π ARGUMENTS π
linkβ the ATA link you're writing the SCR for. Your main character, basically.regβ which SCR you wanna write. Pick one, bestie.valβ the value going in. This is the actual payload, the moment, the reason we're all here.
πΈ DESCRIPTION πΈ
So what she does is: writes val into the SCR register reg of link. That's it. That's the function π
And here's the part that's genuinely giving security-blanket energy β this function is guaranteed to succeed if all three of these are true:
linkisap->link- the cable type of the port is SATA
- the port implements
->scr_read
Three for three and she's not missing. Slay β
π LOCKING π
Locking vibes depend on who you are:
- If
linkisap->linkβ None. No locking. Free. Unbothered. β¨ - Otherwise β Kernel thread context required. Different energy entirely, so know which one you're in, iykyk.
π₯ RETURN π₯
0on success π- negative errno on failure π
π¦ SEE ALSO π¦
The whole friend group, plus the kernel file she lives in: ./drivers/ata/libata-sata.c
sata_scr_valid(9)sata_scr_read(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_link_hardreset(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)
ngl bestie, that's a lot of cross-references, but every single one of them is a real one so go read 'em if you're curious π
Okay that's the whole page, mwah π β she ships out of ./drivers/ata, dated October 2026, and honestly? She ate. πππ
π¦ 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