ata_eh_decide_disposition(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ata_eh_decide_disposition ✨

okay so bestie, we're deep in the Kernel API Manual, section 9, and this one lives in ./drivers/ata because of course it does 🫢


🌸 NAME 🌸

ata_eh_decide_disposition β€” literally decides the disposition of a qc based on sense data πŸ’…


✨ SYNOPSIS ✨

enum scsi_disposition ata_eh_decide_disposition (struct ata_queued_cmd
*qc );

πŸŽ€ ARGUMENTS πŸŽ€

  • qc β€” the qc we're examining πŸ‘€ that's it, that's the whole argument list

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so picture this, bestie 🧚 for a regular SCSI command, the SCSI completion callback (scsi_done) calls scsi_complete, which calls scsi_decide_disposition, which calls scsi_check_sense. and then scsi_complete finally calls scsi_finish_command. it's giving a whole relay race πŸƒβ€β™€οΈπŸ’¨

and that's totally fine for SCSI, because any eventual sense data is usually returned in the completion itself β€” without ever invoking SCSI EH. no cap βœ‹

BUT πŸ’€ for a QC, we always need to fetch the sense data explicitly using SCSI EH. always always. no shortcuts.

meanwhile, a command that's completed via SCSI EH gets completed a different way β€” using scsi_eh_flush_done_q, which calls scsi_finish_command directly, without ever calling scsi_check_sense. so that check literally never happens on that path 😭

so for a command that went through SCSI EH, it is the responsibility of the SCSI EH strategy handler to call scsi_decide_disposition β€” see e.g. how scsi_eh_get_sense calls scsi_decide_disposition for SCSI LLDDs that do not get the sense data as part of the completion. main character energy, honestly πŸ‘‘

so yeah β€” for QC commands that went via SCSI EH, we need to call scsi_check_sense ourselves, similar to how scsi_eh_get_sense calls scsi_decide_disposition, which calls scsi_check_sense, in order to set the correct SCSI ML byte (if any). that's the whole vibe check right there βœ…

LOCKING: EH context. periodt πŸ”’


🌈 RETURN 🌈

one of these four, bestie:

  • SUCCESS
  • FAILED
  • NEEDS_RETRY
  • ADD_TO_MLQUEUE

πŸ“ SEE ALSO πŸ“

Kernel file ./drivers/ata/libata-eh.c, plus the whole squad πŸ”₯:

__ata_ehi_push_desc(9), ata_ehi_push_desc(9), ata_ehi_clear_desc(9), ata_port_desc(9), ata_port_pbar_desc(9), ata_internal_cmd_timeout(9), ata_internal_cmd_timed_out(9), ata_eh_acquire(9), ata_eh_release(9), ata_scsi_error(9), ata_scsi_cmd_error_handler(9), ata_scsi_port_error_handler(9), ata_port_wait_eh(9), ata_eh_set_pending(9), ata_qc_schedule_eh(9), ata_std_sched_eh(9), ata_std_end_eh(9), ata_port_schedule_eh(9), ata_link_abort(9), ata_port_abort(9), __ata_port_freeze(9), ata_port_freeze(9), ata_eh_freeze_port(9), ata_eh_thaw_port(9), ata_eh_qc_complete(9), ata_eh_qc_retry(9), ata_dev_disable(9), ata_eh_detach_dev(9), ata_eh_about_to_do(9), ata_eh_done(9), ata_err_string(9), atapi_eh_tur(9), ata_eh_request_sense(9), atapi_eh_request_sense(9), ata_eh_analyze_serror(9), ata_eh_analyze_tf(9), ata_eh_speed_down_verdict(9), ata_eh_speed_down(9), ata_eh_worth_retry(9), ata_eh_quiet(9), ata_eh_link_set_lpm(9), ata_eh_link_autopsy(9), ata_eh_autopsy(9), ata_get_cmd_name(9), ata_eh_link_report(9), ata_eh_report(9), ata_eh_set_mode(9), atapi_eh_clear_ua(9), ata_eh_maybe_retry_flush(9), ata_eh_recover(9), ata_eh_finish(9), ata_std_error_handler(9), ata_eh_handle_port_suspend(9), ata_eh_handle_port_resume(9)


and that's the whole page, bestie πŸŽ€ tysm for reading, this came from ./drivers/ata and is dated October 2026 β€” catch you in the next manpage, mwah πŸ’–πŸ’…βœ¨

πŸ“¦ where this page comes from