Commit 037f6bb7 authored by Matthew Garrett's avatar Matthew Garrett Committed by Jeff Garzik

libata: Don't fail device revalidation for bad _GTF methods

Experience suggests that the _GTF method may be bad. We currently fail
device revalidation in that case, which seems excessive.
Signed-off-by: default avatarMatthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 32ebbc0c
...@@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm); ...@@ -312,7 +312,7 @@ EXPORT_SYMBOL_GPL(ata_acpi_stm);
* *
* RETURNS: * RETURNS:
* Number of taskfiles on success, 0 if _GTF doesn't exist or doesn't * 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, static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
void **ptr_to_free) void **ptr_to_free)
...@@ -339,7 +339,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, ...@@ -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, ata_dev_printk(dev, KERN_WARNING,
"_GTF evaluation failed (AE 0x%x)\n", "_GTF evaluation failed (AE 0x%x)\n",
status); status);
rc = -EIO;
} }
goto out_free; goto out_free;
} }
...@@ -359,7 +358,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, ...@@ -359,7 +358,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING, ata_dev_printk(dev, KERN_WARNING,
"_GTF unexpected object type 0x%x\n", "_GTF unexpected object type 0x%x\n",
out_obj->type); out_obj->type);
rc = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -367,7 +365,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf, ...@@ -367,7 +365,6 @@ static int ata_dev_get_GTF(struct ata_device *dev, struct ata_acpi_gtf **gtf,
ata_dev_printk(dev, KERN_WARNING, ata_dev_printk(dev, KERN_WARNING,
"unexpected _GTF length (%d)\n", "unexpected _GTF length (%d)\n",
out_obj->buffer.length); out_obj->buffer.length);
rc = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev) ...@@ -511,10 +508,7 @@ static int ata_acpi_exec_tfs(struct ata_device *dev)
int gtf_count, i, rc; int gtf_count, i, rc;
/* get taskfiles */ /* get taskfiles */
rc = ata_dev_get_GTF(dev, &gtf, &ptr_to_free); gtf_count = ata_dev_get_GTF(dev, &gtf, &ptr_to_free);
if (rc < 0)
return rc;
gtf_count = rc;
/* execute them */ /* execute them */
for (i = 0, rc = 0; i < gtf_count; i++) { for (i = 0, rc = 0; i < gtf_count; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment