xgene_ahci_do_hardreset(9)
π xgene_ahci_do_hardreset β from the Kernel API Manual, bestie π
okay so picture this: it's a Kernel API Manual page, the star is xgene_ahci_do_hardreset(9), and she is literally the one who issues the actual COMRESET. no middleman. no vibe-based guessing. just PHY drama. let's get into it β¨
πΈ NAME πΈ
xgene_ahci_do_hardreset β issue the actual COMRESET π«Ά
β¨ SYNOPSIS β¨
int xgene_ahci_do_hardreset (struct ata_link *link , unsigned long
deadline , bool *online );
π¦ ARGUMENTS π¦
linkβ the link you're resetting, bestie. that's the whole assignment.deadlineβ the deadline in jiffies for the operation. she has a clock and she's watching it β°onlineβ a return value that tells you whether the device is online. yes, it's a return value that comes back through a pointer. iconic behavior, we respect it π
π DESCRIPTION π
so here's the tea β β the hardware PHY has limitations, and because of that, each supported disk speed needs a different set of settings:
- Gen3 (
6.0Gbps) - Gen2 (
3.0Gbps) - Gen1 (
1.5Gbps)
if you don't do that? during a long IO stress test the PHY will report disparity error and etc. and etc. is doing a LOT of heavy lifting in that sentence π
also, during COMRESET there can be errors reported in the register PORT_SCR_ERR. for SERR_DISPARITY and SERR_10B_8B_ERR, the PHY receiver line must be reseted. (that's the manpage's spelling and I'm keeping it, no cap π«Ά)
and here's the other thing β during long reboot cycle regression, sometimes the PHY reports link down even if the device is present, because of speed negotiation failure. so you gotta retry the COMRESET to get the link up. lowkey rude of the PHY but okay.
the following algorithm is followed to proper configure the hardware PHY during COMRESET:
β Alg Part 1 β
- Start the PHY at Gen3 speed (default setting)
- Issue the COMRESET
- If no link, go to Alg Part 3
- If link up, determine if the negotiated speed matches the PHY configured speed
- If they matched, go to Alg Part 2
- If they do not matched and first time, configure the PHY for the linked up disk speed and repeat step 2
- Go to Alg Part 2
π Alg Part 2 π
- On link up, if there are any
SERR_DISPARITYandSERR_10B_8B_ERRerror reported in the registerPORT_SCR_ERR, then reset the PHY receiver line - Go to Alg Part 4
π Alg Part 3 π
- Check the
PORT_SCR_STATto see whether device presence detected but PHY communication establishment failed and maximum link down attempts are less than Max attempts 3 then goto Alg Part 1. - Go to Alg Part 4.
π Alg Part 4 π
- Clear any pending from register
PORT_SCR_ERR.
π NOTE π
for the initial version, we will NOT support Gen1/Gen2. periodt. π
in addition β and until the underlying PHY supports an method to reset the receiver line β on detection of SERR_DISPARITY or SERR_10B_8B_ERR errors, an warning message will be printed. she's not fixing it, she's announcing it. main character energy honestly π
π₯ SEE ALSO π₯
kernel file ./drivers/ata/ahci_xgene.c plus the whole friend group:
xgene_ahci_poll_reg_val(9)xgene_ahci_restart_engine(9)xgene_ahci_qc_issue(9)xgene_ahci_read_id(9)xgene_ahci_pmp_softreset(9)xgene_ahci_softreset(9)xgene_ahci_handle_broken_edge_irq(9)
and that's the page!! brought to you by the source at ./drivers/ata, dated October 2026, filed under the Kernel API Manual β go read the whole crew, they all 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