Bug 12176 (MuSh)

Summary: sata_nv - SATA link down
Product: IO/Storage Reporter: Saro (saro_v)
Component: Serial ATAAssignee: Tejun Heo (tj)
Status: CLOSED PATCH_ALREADY_AVAILABLE    
Severity: high CC: hancockrwd
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.27 Subsystem:
Regression: --- Bisected commit-id:
Attachments: kernel.log
This is the result of lspci -nn with the kernel 2.6.28.4
the kernel.log of kernel 2.6.28.4
nf2-nohrst.patch

Description Saro 2008-12-07 09:00:18 UTC
Latest working kernel version: i don't remember
Earliest failing kernel version:2.6.26
Distribution: Archlinux
Problem Description: When using kernel 2.6.27, the hdd sata doesn't work and is not possible to use the sata_nv.patch because it's in conflict with the -arch patch.

I have create a bug report here http://bugs.archlinux.org/task/12361

this is the kernel.log ---> http://bugs.archlinux.org/task/12361?getfile=2781
Comment 1 Andrew Morton 2008-12-07 21:18:12 UTC
Switched to IO/storage, ata.
Comment 2 Tejun Heo 2008-12-07 21:28:39 UTC
Can't follow the patch link, it's broken.  Is upstream 2.6.27.8 still broken?
Comment 3 Saro 2008-12-08 04:28:14 UTC
this is the patch.

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 858f706..1e1f3f3 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -309,8 +309,6 @@ static void nv_nf2_freeze(struct ata_port *ap);
 static void nv_nf2_thaw(struct ata_port *ap);
 static void nv_ck804_freeze(struct ata_port *ap);
 static void nv_ck804_thaw(struct ata_port *ap);
-static int nv_hardreset(struct ata_link *link, unsigned int *class,
-			unsigned long deadline);
 static int nv_adma_slave_config(struct scsi_device *sdev);
 static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc);
 static void nv_adma_qc_prep(struct ata_queued_cmd *qc);
@@ -407,7 +405,7 @@ static struct scsi_host_template nv_swncq_sht = {

 static struct ata_port_operations nv_generic_ops = {
 	.inherits		= &ata_bmdma_port_ops,
-	.hardreset		= nv_hardreset,
+	.hardreset		= ATA_OP_NULL,
 	.scr_read		= nv_scr_read,
 	.scr_write		= nv_scr_write,
 };
@@ -1588,21 +1586,6 @@ static void nv_mcp55_thaw(struct ata_port *ap)
 	ata_sff_thaw(ap);
 }

-static int nv_hardreset(struct ata_link *link, unsigned int *class,
-			unsigned long deadline)
-{
-	int rc;
-
-	/* SATA hardreset fails to retrieve proper device signature on
-	 * some controllers.  Request follow up SRST.  For more info,
-	 * see http://bugzilla.kernel.org/show_bug.cgi?id=3352
-	 */
-	rc = sata_sff_hardreset(link, class, deadline);
-	if (rc)
-		return rc;
-	return -EAGAIN;
-}
-
 static void nv_adma_error_handler(struct ata_port *ap)
 {
 	struct nv_adma_port_priv *pp = ap->private_data;

-Is upstream 2.6.27.8 still broken?

i don't know
Comment 4 Tejun Heo 2008-12-08 18:17:08 UTC
It's already fixed in upstream.  You'll have to ask arch linux to incorporate the fix into their kernel.  Rejecting as INVALID.  Thanks.
Comment 5 Saro 2009-02-05 10:47:34 UTC
Created attachment 20125 [details]
kernel.log
Comment 6 Saro 2009-02-05 10:47:58 UTC
I have tested the 2.6.28.2 and the new 2.6.29-rc3.
But is not fixed.
This is the log of kernel.log with 2.6.29-rc3:
Comment 7 Tejun Heo 2009-02-11 01:00:22 UTC
Can you please test 2.6.28.4?  Also, please post the output of "lspci -nn".  Thanks.
Comment 8 Saro 2009-02-11 02:46:59 UTC
Created attachment 20188 [details]
This is the result of lspci -nn with the kernel 2.6.28.4

This is the result of lspci -nn with the kernel 2.6.28.4
Comment 9 Tejun Heo 2009-02-11 06:32:18 UTC
2.6.28.4 is still broken?  Can you please capture the failing kernel boot log and post it?  You'll need one of root on working device, serial console or netconsole.
Comment 10 Saro 2009-02-11 06:46:17 UTC
Created attachment 20192 [details]
the kernel.log of kernel 2.6.28.4

Yes, it is broken.
Comment 11 Tejun Heo 2009-02-11 07:19:31 UTC
Created attachment 20193 [details]
nf2-nohrst.patch

Does this patch fix the problem?
Comment 12 Tejun Heo 2009-02-11 07:20:26 UTC
cc'ing Robert.  Robert, hardreset on nf2 seems completely broken.  Ah... I'm really hating these nv controllers.
Comment 13 Saro 2009-02-11 10:40:26 UTC
Thank you for the patch.
The problem is fixed with your patch.
Comment 14 Tejun Heo 2009-02-11 17:34:34 UTC
Patch posted upstream.  Thanks.