Skip to content

Commit 4b3c2ca

Browse files
bvanasschefloatious
authored andcommitted
ata: libata: Add an argument to ata_eh_reset()
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>
1 parent ad66912 commit 4b3c2ca

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/ata/libata-eh.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2831,10 +2831,9 @@ static bool ata_eh_followup_srst_needed(struct ata_link *link, int rc)
28312831
return false;
28322832
}
28332833

2834-
int ata_eh_reset(struct ata_link *link, int classify,
2834+
int ata_eh_reset(struct ata_port *ap, struct ata_link *link, int classify,
28352835
struct ata_reset_operations *reset_ops)
28362836
{
2837-
struct ata_port *ap = link->ap;
28382837
struct ata_link *slave = ap->slave_link;
28392838
struct ata_eh_context *ehc = &link->eh_context;
28402839
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,
38823881
if (!(ehc->i.action & ATA_EH_RESET))
38833882
continue;
38843883

3885-
rc = ata_eh_reset(link, ata_link_nr_vacant(link), reset_ops);
3884+
rc = ata_eh_reset(ap, link, ata_link_nr_vacant(link),
3885+
reset_ops);
38863886
if (rc) {
38873887
ata_link_err(link, "reset failed, giving up\n");
38883888
goto out;

drivers/ata/libata-pmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
777777
struct ata_link *tlink;
778778

779779
/* reset */
780-
rc = ata_eh_reset(link, 0, reset_ops);
780+
rc = ata_eh_reset(ap, link, 0, reset_ops);
781781
if (rc) {
782782
ata_link_err(link, "failed to reset PMP, giving up\n");
783783
goto fail;

drivers/ata/libata.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ extern void ata_eh_done(struct ata_link *link, struct ata_device *dev,
187187
extern void ata_eh_autopsy(struct ata_port *ap);
188188
const char *ata_get_cmd_name(u8 command);
189189
extern void ata_eh_report(struct ata_port *ap);
190-
extern int ata_eh_reset(struct ata_link *link, int classify,
191-
struct ata_reset_operations *reset_ops);
190+
extern int ata_eh_reset(struct ata_port *ap, struct ata_link *link,
191+
int classify, struct ata_reset_operations *reset_ops);
192192
extern int ata_eh_recover(struct ata_port *ap,
193193
struct ata_reset_operations *reset_ops,
194194
struct ata_link **r_failed_disk);

0 commit comments

Comments
 (0)