asd_abort_task(9)
π asd_abort_task(9) β a Kernel API Manual moment
okay bestie, welcome to the Kernel API Manual, because today we're learning about asd_abort_task. yes it's giving kernel-dev realness. stay with me π«Ά
β¨ NAME β¨
asd_abort_task β ABORT TASK TMF. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
int asd_abort_task (struct sas_task *task );
π ARGUMENTS π
taskβ the task to be aborted. the one we're cancelling, the main character we're sending home early π
πΈ DESCRIPTION πΈ
okay so before you call ABORT TASK, you gotta do the setup first, and this part is NOT optional, no cap. you OR the task state flags with SAS_TASK_STATE_ABORTED β unless SAS_TASK_STATE_DONE is already set, okay? β and you do that under the task_state_lock IRQ spinlock. then, and only then, ABORT TASK must be called. like, must must. π₯
this whole thing implements the ABORT TASK TMF, I_T_L_Q nexus. iconic. periodt.
so when ABORT TASK comes back, the caller of ABORT TASK checks, in this order: first task->task_state_flags, and then the return value of ABORT TASK. order matters, bestie, don't flip it π
case one: the done bit is set. if the task has task state bit SAS_TASK_STATE_DONE set, then the task was completed successfully prior to it being aborted. plot twist. π in this case the caller of ABORT TASK has the responsibility to call task->task_done xor free the task, depending on their framework. and the return code is TMF_RESP_FUNC_FAILED in this case. yes, even though it completed. that's just how it is. π
case two: the done bit is not set. else, SAS_TASK_STATE_DONE bit is not set, and:
- if the return code is
TMF_RESP_FUNC_COMPLETE, then the task was aborted successfully π the caller of ABORT TASK has responsibility to calltask->task_doneto finish the task, xor free the task depending on their framework. - else the ABORT TASK returned some kind of error. and this is the important part: the task was _not_ cancelled. β οΈ nothing can be assumed. like literally nothing. the caller of ABORT TASK may wish to retry. your call, king. π
real talk: "nothing can be assumed" is doing SO much heavy lifting in that sentence. respect it. π«‘
β RETURN β
SAS TMF responses (see sas_task.h), plus -ENOMEM and -SAS_QUEUE_FULL. those are the possible moods this function can come back in. π
π SEE ALSO π
- Kernel file
./drivers/scsi/aic94xx/aic94xx_tmf.cβ the source, go read it, iykyk π asd_initiate_ssp_tmf(9)asd_query_task(9)
and that's the page, bestie!! π§ go forth and abort your tasks responsibly π
signed off with love from ./drivers/scsi/aic94xx, dated October 2026, page asd_abort_task(9) β mwah πβ¨
π¦ 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