Skip to content

Commit

Permalink
libata: Don't fail device revalidation for bad _GTF methods
Browse files Browse the repository at this point in the history
Experience suggests that the _GTF method may be bad. We currently fail
device revalidation in that case, which seems excessive.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Matthew Garrett authored and Jeff Garzik committed Nov 10, 2007
1 parent 32ebbc0 commit 037f6bb
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/ata/libata-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm);
*
* RETURNS:
* Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't
* contain valid data. -errno on other errors.
* contain valid data.
*/
static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
void **ptr_to_free)
Expand All @@ -339,7 +339,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING,
"_GTF evaluation failed (AE 0x%x)\n",
status);
rc = -EIO;
}
goto out_free;
}
Expand All @@ -359,15 +358,13 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING,
"_GTF unexpected object type 0x%x\n",
out_obj->type);
rc = -EINVAL;
goto out_free;
}

if (out_obj->buffer.length % REGS_PER_GTF) {
ata_dev_printk(dev, KERN_WARNING,
"unexpected _GTF length (%d)\n",
out_obj->buffer.length);
rc = -EINVAL;
goto out_free;
}

Expand Down Expand Up @@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev)
int gtf_count, i, rc;

/* get taskfiles */
rc = ata_dev_get_GTF(dev, &gtf, &ptr_to_free);
if (rc < 0)
return rc;
gtf_count = rc;
gtf_count = ata_dev_get_GTF(dev, &gtf, &ptr_to_free);

/* execute them */
for (i = 0, rc = 0; i < gtf_count; i++) {
Expand Down

0 comments on commit 037f6bb

Please sign in to comment.