]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ata: libata: Add an argument to ata_eh_reset()
authorBart Van Assche <bvanassche@acm.org>
Fri, 29 May 2026 18:03:09 +0000 (11:03 -0700)
committerNiklas Cassel <cassel@kernel.org>
Mon, 1 Jun 2026 17:09:07 +0000 (19:09 +0200)
Pass the ATA port pointer as first argument to ata_eh_reset(). No
functionality has been changed. This patch prepares for enabling lock
context analysis. Without this patch, lockdep_assert_held() statements
would have to be added before each ata_eh_reset() call because the
compiler doesn't know that ap->link.p == ap. See also ata_link_init().

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
drivers/ata/libata-eh.c
drivers/ata/libata-pmp.c
drivers/ata/libata.h

index 715bc525b38ff71e601440a417faa50db93bea19..ecfb9d96249f65894ba20005b1a37f79d4a19724 100644 (file)
@@ -2831,10 +2831,9 @@ static bool ata_eh_followup_srst_needed(struct ata_link *link, int rc)
        return false;
 }
 
-int ata_eh_reset(struct ata_link *link, int classify,
+int ata_eh_reset(struct ata_port *ap, struct ata_link *link, int classify,
                 struct ata_reset_operations *reset_ops)
 {
-       struct ata_port *ap = link->ap;
        struct ata_link *slave = ap->slave_link;
        struct ata_eh_context *ehc = &link->eh_context;
        struct ata_eh_context *sehc = slave ? &slave->eh_context : NULL;
@@ -3882,7 +3881,8 @@ int ata_eh_recover(struct ata_port *ap, struct ata_reset_operations *reset_ops,
                if (!(ehc->i.action & ATA_EH_RESET))
                        continue;
 
-               rc = ata_eh_reset(link, ata_link_nr_vacant(link), reset_ops);
+               rc = ata_eh_reset(ap, link, ata_link_nr_vacant(link),
+                                 reset_ops);
                if (rc) {
                        ata_link_err(link, "reset failed, giving up\n");
                        goto out;
index e8540931b4a117f8b97d88738d98b0dd6d0ae7f2..ffd6549960674d28d08a1d8fa1fe69b8e114fef3 100644 (file)
@@ -777,7 +777,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
                struct ata_link *tlink;
 
                /* reset */
-               rc = ata_eh_reset(link, 0, reset_ops);
+               rc = ata_eh_reset(ap, link, 0, reset_ops);
                if (rc) {
                        ata_link_err(link, "failed to reset PMP, giving up\n");
                        goto fail;
index b5423b6e97de1ac50340899ad360f2e520df2c3f..a5920c10aacaf6d240421476a1ce54f87e37ad8c 100644 (file)
@@ -187,8 +187,8 @@ extern void ata_eh_done(struct ata_link *link, struct ata_device *dev,
 extern void ata_eh_autopsy(struct ata_port *ap);
 const char *ata_get_cmd_name(u8 command);
 extern void ata_eh_report(struct ata_port *ap);
-extern int ata_eh_reset(struct ata_link *link, int classify,
-                       struct ata_reset_operations *reset_ops);
+extern int ata_eh_reset(struct ata_port *ap, struct ata_link *link,
+                       int classify, struct ata_reset_operations *reset_ops);
 extern int ata_eh_recover(struct ata_port *ap,
                          struct ata_reset_operations *reset_ops,
                          struct ata_link **r_failed_disk);