ata_eh_speed_down_verdict(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ata_eh_speed_down_verdict β€” okay so this is THE function

Bestie, welcome to the ata_eh_speed_down_verdict page from the Kernel API Manual. Yes, the whole name is a mouthful, no cap. It's a libata kernel function, it lives in the kernel API docs, and it is literally about to tell you how badly your disk is doing and what to do about it. 🩺✨


✨ SYNOPSIS ✨

unsigned int ata_eh_speed_down_verdict (struct ata_device *dev );

Like, that's the whole vibe. One function, one argument, one unsigned int coming back. Clean. Iconic. πŸŽ€


🌸 ARGUMENTS 🌸

  • dev β€” the device of interest 🫢 β€” the ATA device you're side-eyeing and want the verdict on.

πŸ’– DESCRIPTION πŸ’–

Okay so here's the tea. This function examines the error ring of dev and figures out whether:

  • NCQ needs to be turned off,
  • the transfer speed should be stepped down, or
  • falling back to PIO is necessary.

Then it hands you back a verdict. Very main character energy. πŸ‘‘

πŸ¦‹ The error categories (iykyk)

  • ECAT_ATA_BUS β€” ATA_BUS error for any command
  • ECAT_TOUT_HSM β€” TIMEOUT for any command, or HSM violation for IO commands
  • ECAT_UNK_DEV β€” Unknown DEV error for IO commands
  • ECAT_DUBIOUS_* β€” identical to the above three, except these occurred while data transfer hasn't been verified πŸ™ˆ

⭐ The verdicts

  • NCQ_OFF β€” turn off NCQ.
  • SPEED_DOWN β€” speed down the transfer speed, but don't fall back to PIO.
  • FALLBACK_TO_PIO β€” fall back to PIO.
Heads up bestie: even if multiple verdicts are returned, only one action is taken per error. 🫠 An action triggered by non-DUBIOUS errors clears ering, while one triggered by DUBIOUS_* errors doesn't. Why? To expedite speed down decisions right after the device is initially configured. Slay, efficiency. ⚑

🧚 The speed down rules (the actual receipts)

The following are speed down rules. #1 and #2 deal with DUBIOUS errors.

  1. If more than one DUBIOUS_ATA_BUS or DUBIOUS_TOUT_HSM errors occurred during last 5 mins, SPEED_DOWN and FALLBACK_TO_PIO.
  2. If more than one DUBIOUS_TOUT_HSM or DUBIOUS_UNK_DEV errors occurred during last 5 mins, NCQ_OFF.
  3. If more than 8 ATA_BUS, TOUT_HSM or UNK_DEV errors occurred during last 5 mins, FALLBACK_TO_PIO
  4. If more than 3 TOUT_HSM or UNK_DEV errors occurred during last 10 mins, NCQ_OFF.
  5. If more than 3 ATA_BUS or TOUT_HSM errors, or more than 6 UNK_DEV errors occurred during last 10 mins, SPEED_DOWN.
LOCKING: Inherited from caller. πŸ”’ (not me, not you β€” whoever called this owns the lock, periodt.)

πŸ”₯ RETURN πŸ”₯

OR of ATA_EH_SPDN_* flags. That's it, that's the return. Bitwise-OR'd goodness. πŸ’œ


🌈 SEE ALSO 🌈

Kernel file ./drivers/ata/libata-eh.c πŸ“ β€” and bestie, here comes the whole friend group:


πŸŽ€ Okay that's the page!! This one's straight out of ./drivers/ata, dated October 2026, and it's giving "kernel API manual, but make it cute." Go forth and check those error rings, bestie. πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from