Skip to contentSkip to conversation

sata_nv: make hardreset return -EAGAIN on success

PATCH Applied Tejun Heo 4 participants 4 messages Apr 23, 2008 – Apr 25, 2008 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 sata_nv: make hardreset return -EAGAIN on success

sata_nv hardreset can't classify but was left out while unifying follow-up SRST request mechanism[1]. This caused detection failures on those controllers. Fix it.

Reported and bisected by Roland Dreier, Petr Vandrovec and Marc Dionne. Thanks guys.

[1] 305d2a1ab137d11d573319c315748a87060fe82d

Cc Roland Dreier <[email protected]>
Cc Petr Vandrovec <[email protected]>
Cc Marc Dionne <[email protected]>

---
It actually was a single fall out I missed. This is the proper fix and verfied on ck804.

drivers/ata/sata_nv.c +0 -0
index 109b074..858f706 100644
@@ -1591,13 +1591,16 @@ static void nv_mcp55_thaw(struct ata_port *ap)

static int nv_hardreset(struct ata_link *link, unsigned int *class,
unsigned long deadline)
{
- unsigned int dummy;
+ int rc;

	/* SATA hardreset fails to retrieve proper device signature on

- * some controllers. Don't classify on hardreset. For more
- * info, see http://bugzilla.kernel.org/show_bug.cgi?id=3352
+ * some controllers. Request follow up SRST. For more info,
+ * see http://bugzilla.kernel.org/show_bug.cgi?id=3352

	 */

- return sata_sff_hardreset(link, &dummy, deadline);
+ rc = sata_sff_hardreset(link, class, deadline);
+ if (rc)
+ return rc;
+ return -EAGAIN;
}

static void nv_adma_error_handler(struct ata_port *ap)

Tested-by on v1 1/1
#1 lore raw
Quoted 3 lines

sata_nv hardreset can't classify but was left out while unifying follow-up SRST request mechanism[1]. This caused detection failures on those controllers. Fix it.

Yep, fixes my system too.

Applied
#3 lore raw
In reply to Tejun Heo
Quoted 30 lines · Tejun Heo

sata_nv hardreset can't classify but was left out while unifying follow-up SRST request mechanism[1]. This caused detection failures on those controllers. Fix it.

Reported and bisected by Roland Dreier, Petr Vandrovec and Marc Dionne. Thanks guys.

[1] 305d2a1ab137d11d573319c315748a87060fe82d

Cc Roland Dreier <[email protected]>
Cc Petr Vandrovec <[email protected]>
Cc Marc Dionne <[email protected]>

---
It actually was a single fall out I missed. This is the proper fix and verfied on ck804.

drivers/ata/sata_nv.c +1 -2
index 109b074..858f706 100644
@@ -1591,13 +1591,16 @@ static void nv_mcp55_thaw(struct ata_port *ap)
 static int nv_hardreset(struct ata_link *link, unsigned int *class,
            unsigned long deadline)
 {
-    unsigned int dummy;
+    int rc;
 
    /* SATA hardreset fails to retrieve proper device signature on
-     * some controllers.  Don't classify on hardreset.  For more

drivers/ata/sata_nv.c static void nv_mcp55_thaw(struct ata_port *ap) · line 1604

Quoted 10 lines
drivers/ata/sata_nv.c +6 -2
-     * info, see http://bugzilla.kernel.org/show_bug.cgi?id=3352
+     * some controllers.  Request follow up SRST.  For more info,
+     * see http://bugzilla.kernel.org/show_bug.cgi?id=3352
     */
-    return sata_sff_hardreset(link, &dummy, deadline);
+    rc = sata_sff_hardreset(link, class, deadline);
+    if (rc)
+        return rc;
+    return -EAGAIN;
 }

applied