Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29288
b: refs/heads/master
c: 96bd39e
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo committed May 15, 2006
1 parent 939d093 commit 1ac6c81
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3adcebb2b59d590d572844815c906ca30477b14a
refs/heads/master: 96bd39ec295e49443c8b0c25a6b69fdace18780f
19 changes: 10 additions & 9 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2585,7 +2585,7 @@ int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes)
}

int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
ata_postreset_fn_t postreset, unsigned int *classes)
unsigned int *classes)
{
int i, rc;

Expand All @@ -2609,9 +2609,6 @@ int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
if (classes[i] == ATA_DEV_UNKNOWN)
classes[i] = ATA_DEV_NONE;

if (postreset)
postreset(ap, classes);

return 0;
}

Expand Down Expand Up @@ -2655,7 +2652,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
probeinit(ap);

if (softreset && !sata_set_spd_needed(ap)) {
rc = ata_do_reset(ap, softreset, postreset, classes);
rc = ata_do_reset(ap, softreset, classes);
if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN)
goto done;
printk(KERN_INFO "ata%u: softreset failed, will try "
Expand All @@ -2667,7 +2664,7 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
goto done;

while (1) {
rc = ata_do_reset(ap, hardreset, postreset, classes);
rc = ata_do_reset(ap, hardreset, classes);
if (rc == 0) {
if (classes[0] != ATA_DEV_UNKNOWN)
goto done;
Expand All @@ -2688,12 +2685,16 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
ap->id);
ssleep(5);

rc = ata_do_reset(ap, softreset, postreset, classes);
rc = ata_do_reset(ap, softreset, classes);
}

done:
if (rc == 0 && classes[0] == ATA_DEV_UNKNOWN)
rc = -ENODEV;
if (rc == 0) {
if (postreset)
postreset(ap, classes);
if (classes[0] == ATA_DEV_UNKNOWN)
rc = -ENODEV;
}
return rc;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ extern int ata_down_xfermask_limit(struct ata_port *ap, struct ata_device *dev,
int force_pio0);
extern int ata_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev);
extern int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
ata_postreset_fn_t postreset, unsigned int *classes);
unsigned int *classes);
extern void ata_qc_free(struct ata_queued_cmd *qc);
extern void ata_qc_issue(struct ata_queued_cmd *qc);
extern int ata_check_atapi_dma(struct ata_queued_cmd *qc);
Expand Down

0 comments on commit 1ac6c81

Please sign in to comment.