From: Tejun Heo <tj@kernel.org>
To: linux-kernel@vger.kernel.org
Subject: Re: SATA Cold Boot problems on >2.6.25 with NV
Date: Tue, 07 Oct 2008 10:02:45 +0900 [thread overview]
Message-ID: <48EAB535.8010203@kernel.org> (raw)
In-Reply-To: <20081006212307.GA881@anita.doom>
[-- Attachment #1: Type: text/plain, Size: 636 bytes --]
Konstantin Kletschke wrote:
> What I forgot is, that the
>
> ata2: EH pending after 5 tries, giving up
> ata2: EH complete
> ata2: EH pending after 5 tries, giving up
> ata2: EH complete
> ata2: EH complete
> ata2: EH complete
> ata2: EH complete
> ata2: EH complete
> ata2: EH complete
> ata2: EH complete
> ata2: EH complete
> ata2: EH complete
> ata2: EH complete
>
> is away now and tomorrow morning I will take care if it
> manages to do a cold boot after it was switched of this night.
>
Hmm... strange. Can you please try the attached patch? It's basically
the same with a bit more debug information.
Thanks.
--
tejun
[-- Attachment #2: sata_nv-nf2-hrst-debug.patch --]
[-- Type: text/x-patch, Size: 4071 bytes --]
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 79e3a8e..ba71469 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1099,6 +1099,7 @@ unsigned int ata_dev_classify(const struct ata_taskfile *tf)
* We follow the current spec and consider that 0x69/0x96
* identifies a port multiplier and 0x3c/0xc3 a SEMB device.
*/
+ printk("XXX CLASSIFY %02x:%02x:%02x\n", tf->lbal, tf->lbam, tf->lbah);
if ((tf->lbam == 0) && (tf->lbah == 0)) {
DPRINTK("found ATA device by sig\n");
return ATA_DEV_ATA;
@@ -5673,7 +5674,7 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
ehi->probe_mask |= ATA_ALL_DEVICES;
ehi->action |= ATA_EH_RESET | ATA_EH_LPM;
- ehi->flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET;
+ ehi->flags |= ATA_EHI_NO_AUTOPSY/* | ATA_EHI_QUIET*/;
ap->pflags &= ~ATA_PFLAG_INITIALIZING;
ap->pflags |= ATA_PFLAG_LOADING;
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 14601dc..ce77619 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);
@@ -405,17 +403,8 @@ static struct scsi_host_template nv_swncq_sht = {
.slave_configure = nv_swncq_slave_config,
};
-/* OSDL bz3352 reports that some nv controllers can't determine device
- * signature reliably and nv_hardreset is implemented to work around
- * the problem. This was reported on nf3 and it's unclear whether any
- * other controllers are affected. However, the workaround has been
- * applied to all variants and there isn't much to gain by trying to
- * find out exactly which ones are affected at this point especially
- * because NV has moved over to ahci for newer controllers.
- */
static struct ata_port_operations nv_common_ops = {
.inherits = &ata_bmdma_port_ops,
- .hardreset = nv_hardreset,
.scr_read = nv_scr_read,
.scr_write = nv_scr_write,
};
@@ -429,12 +418,17 @@ static struct ata_port_operations nv_generic_ops = {
.hardreset = ATA_OP_NULL,
};
+/* OSDL bz3352 reports that nf2/3 controllers can't determine device
+ * signature reliably. Use sata_std_hardreset().
+ */
static struct ata_port_operations nv_nf2_ops = {
.inherits = &nv_common_ops,
.freeze = nv_nf2_freeze,
.thaw = nv_nf2_thaw,
+ .hardreset = sata_std_hardreset,
};
+/* CK804 finally gets hardreset right */
static struct ata_port_operations nv_ck804_ops = {
.inherits = &nv_common_ops,
.freeze = nv_ck804_freeze,
@@ -443,7 +437,7 @@ static struct ata_port_operations nv_ck804_ops = {
};
static struct ata_port_operations nv_adma_ops = {
- .inherits = &nv_common_ops,
+ .inherits = &nv_ck804_ops,
.check_atapi_dma = nv_adma_check_atapi_dma,
.sff_tf_read = nv_adma_tf_read,
@@ -467,7 +461,7 @@ static struct ata_port_operations nv_adma_ops = {
};
static struct ata_port_operations nv_swncq_ops = {
- .inherits = &nv_common_ops,
+ .inherits = &nv_generic_ops,
.qc_defer = ata_std_qc_defer,
.qc_prep = nv_swncq_qc_prep,
@@ -1605,21 +1599,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;
next prev parent reply other threads:[~2008-10-07 1:08 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.CVrJhjm3R8sjl5Z+EEIzYm7QtW0@ifi.uio.no>
2008-08-29 14:44 ` SATA Cold Boot problems on >2.6.25 with NV Robert Hancock
2008-08-29 14:52 ` Tejun Heo
2008-08-29 21:21 ` Konstantin Kletschke
2008-08-30 9:14 ` Tejun Heo
2008-08-30 20:51 ` Konstantin Kletschke
2008-09-01 11:18 ` Tejun Heo
2008-09-01 17:46 ` Konstantin Kletschke
2008-09-02 4:35 ` Tejun Heo
2008-09-02 5:43 ` Konstantin Kletschke
2008-09-02 5:45 ` Tejun Heo
2008-09-02 6:36 ` Konstantin Kletschke
2008-09-23 7:36 ` Benny Halevy
2008-09-24 8:48 ` Konstantin Kletschke
2008-09-24 9:36 ` Tejun Heo
2008-09-24 10:59 ` Konstantin Kletschke
2008-09-25 8:18 ` Konstantin Kletschke
2008-09-27 21:22 ` Tejun Heo
2008-09-30 8:12 ` Konstantin Kletschke
2008-09-30 14:09 ` Tejun Heo
2008-09-30 15:16 ` Konstantin Kletschke
2008-09-30 16:47 ` Tejun Heo
2008-10-01 7:38 ` Konstantin Kletschke
2008-10-01 7:53 ` Tejun Heo
2008-10-01 19:30 ` Konstantin Kletschke
2008-10-05 10:02 ` Benny Halevy
2008-10-05 10:18 ` Tejun Heo
2008-10-05 10:34 ` Benny Halevy
2008-10-05 10:42 ` Tejun Heo
2008-10-05 11:18 ` Benny Halevy
2008-10-06 21:19 ` Konstantin Kletschke
2008-10-06 21:23 ` Konstantin Kletschke
2008-10-07 1:02 ` Tejun Heo [this message]
2008-10-07 6:04 ` Konstantin Kletschke
2008-10-07 8:10 ` Benny Halevy
2008-10-08 8:08 ` Konstantin Kletschke
2008-10-13 8:36 ` Tejun Heo
2008-10-13 8:38 ` Tejun Heo
2008-10-13 14:29 ` Konstantin Kletschke
2008-10-15 6:15 ` Tejun Heo
2008-10-17 8:08 ` Konstantin Kletschke
2008-10-21 6:08 ` Tejun Heo
2008-10-27 9:22 ` Konstantin Kletschke
2008-11-03 3:04 ` Tejun Heo
2008-11-03 8:32 ` Konstantin Kletschke
2008-12-14 0:49 ` Erich Mounce
2008-12-14 3:51 ` Tejun Heo
2008-10-13 14:25 ` Konstantin Kletschke
2008-09-25 8:15 ` Konstantin Kletschke
2008-08-29 7:47 Konstantin Kletschke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48EAB535.8010203@kernel.org \
--to=tj@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).