[PATCH] Don't fail ata device revalidation for bad _GTF methods

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Matthew Garrett
Date: Thursday, November 8, 2007 - 11:37 am

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>

---

diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 08a52dd..545ea86 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -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)
@@ -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;
 	}
@@ -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,
 			       "_GTF unexpected object type 0x%x\n",
 			       out_obj->type);
-		rc = -EINVAL;
 		goto out_free;
 	}
 
@@ -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,
 			       "unexpected _GTF length (%d)\n",
 			       out_obj->buffer.length);
-		rc = -EINVAL;
 		goto out_free;
 	}
 
@@ -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++) {

-- 
Matthew Garrett | mjg59@srcf.ucam.org
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
libata: cdrw/dvdrom disabed after s2ram (2.6.24-rc2), Roberto Oppedisano, (Wed Nov 7, 7:15 am)
Re: libata: cdrw/dvdrom disabed after s2ram (2.6.24-rc2), Roberto Oppedisano, (Thu Nov 8, 9:43 am)
Re: libata: cdrw/dvdrom disabed after s2ram (2.6.24-rc2), Andrew Morton, (Thu Nov 8, 10:49 am)
Re: libata: cdrw/dvdrom disabed after s2ram (2.6.24-rc2), Andrew Morton, (Thu Nov 8, 11:13 am)
Re: libata: cdrw/dvdrom disabed after s2ram (2.6.24-rc2), Matthew Garrett, (Thu Nov 8, 11:22 am)
[PATCH] Don't fail ata device revalidation for bad _GTF me ..., Matthew Garrett, (Thu Nov 8, 11:37 am)
Re: libata: cdrw/dvdrom disabed after s2ram (2.6.24-rc2), Andrew Morton, (Thu Nov 8, 12:02 pm)
Re: libata: cdrw/dvdrom disabed after s2ram (2.6.24-rc2), Andrew Morton, (Thu Nov 8, 12:58 pm)
Re: [PATCH] Don't fail ata device revalidation for bad _GT ..., Roberto Oppedisano, (Fri Nov 9, 5:29 am)
Re: libata: cdrw/dvdrom disabed after s2ram (2.6.24-rc2), Roberto Oppedisano, (Fri Nov 9, 8:48 am)