summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2026-05-28 19:28:59 +0200
committerNiklas Cassel <cassel@kernel.org>2026-06-01 19:14:41 +0200
commit042f5526cf2c44eac17ed2fa57a9a6e8d30d6279 (patch)
tree825297d995b57732af8a7fd83b840217960d6dd9 /include/linux
parentb2412353ad10c480531055dac1f3c5f60c189331 (diff)
ata: Annotate functions in the issuing path with __must_hold()
Annotate the following functions used in the issuing path: ata_qc_issue(), ata_sas_queuecmd(), ata_scsi_qc_issue(), ata_scsi_translate(), __ata_scsi_queuecmd() These functions are all used in the issuing path, so context analysis will be able to verify that the ap lock is held, from it is taken in sas_queuecommand() or ata_scsi_queuecmd() all the way down to ata_qc_issue(). Commenting out the spin_lock_irqsave() successfully results in a compiler error on Clang 23. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Co-developed-by: Niklas Cassel <cassel@kernel.org> Reviewed-by: Hannes Reinecke <hare@kernel.org> Signed-off-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/libata.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 7091bc903c05..96e626d6a7ca 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1315,7 +1315,8 @@ extern int ata_tport_add(struct device *parent, struct ata_port *ap);
extern void ata_tport_delete(struct ata_port *ap);
int ata_sas_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim,
struct ata_port *ap);
-extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap);
+extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap)
+ __must_hold(ap->lock);
extern void ata_tf_to_fis(const struct ata_taskfile *tf,
u8 pmp, int is_cmd, u8 *fis);
extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);