LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Kuan Luo" <kluo@nvidia.com>
To: "Robert Hancock" <hancockr@shaw.ca>
Cc: "linux-kernel" <linux-kernel@vger.kernel.org>,
	"Tejun Heo" <htejun@gmail.com>, "Jeff Garzik" <jeff@garzik.org>,
	"Peer Chen" <pchen@nvidia.com>
Subject: [PATCH] sata_nv: fix nmi intr or system hanging in rhel4u6 adma.
Date: Tue, 26 Feb 2008 17:24:41 +0800	[thread overview]
Message-ID: <15F501D1A78BD343BE8F4D8DB854566B1BFE2AE5@hkemmail01.nvidia.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2349 bytes --]

Hi, robert 

One customer reported that their system received a nmi interrupt after
issuing "dd if=/dev/sdb of=/dev/null" on a defective disk in rhel4u6.
I tested it and found  that my system hung both in rhel4u6(2.6.9-67) and
2.6.24-rc7.
The patch can work well,  but I am not sure if the patch has other
potential effect on adma.
I attached a  file in case of lines breaked.

The below info comes from Gunther Mayer to reproduce the issue.
"
used a Seagate ST3500841NS 3.AE for my test; probably other 
seagate drives are also capable of creating media errors with 
the new hdparm-8.1: 

- compile hdparm-8.1 
- hdparm -- yes-i-know-what-i-am-doing --make-bad-sector 60000 /dev/sdb 

Unfortunately this does not succeed for nvidia sata controller (timeouts
et al.), but it worked fine on AHCI machine (e.g. FSC R640). 

When I insert this newly created defective disk in Ultra 20, 
it reboots within seconds after issueing "dd if=/dev/sdb of=/dev/null". 
"

Signed-off-by: kluo@nvidia.com

---
 
drivers/ata/sata_nv.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index ed5473b..e824260 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -837,9 +837,10 @@ static void nv_adma_tf_read(struct ata_port *ap,
struct ata_taskfile *tf)
 	   all shortly be aborted anyway. We assume that NCQ commands
are not
 	   issued via passthrough, which is the only way that switching
into
 	   ADMA mode could abort outstanding commands. */
-	nv_adma_register_mode(ap);
+	struct nv_adma_port_priv *pp = ap->private_data;
 
-	ata_tf_read(ap, tf);
+	if (pp->flags & NV_ADMA_PORT_REGISTER_MODE)
+		ata_tf_read(ap, tf);
 }
 
 static unsigned int nv_adma_tf_to_cpb(struct ata_taskfile *tf, __le16
*cpb)

-

Best regards,
Kuan Luo

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

[-- Attachment #2: nmi-patch2 --]
[-- Type: application/octet-stream, Size: 811 bytes --]


Signed-off-by: kluo@nvidia.com

 drivers/ata/sata_nv.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index ed5473b..e824260 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -837,9 +837,10 @@ static void nv_adma_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
 	   all shortly be aborted anyway. We assume that NCQ commands are not
 	   issued via passthrough, which is the only way that switching into
 	   ADMA mode could abort outstanding commands. */
-	nv_adma_register_mode(ap);
+	struct nv_adma_port_priv *pp = ap->private_data;
 
-	ata_tf_read(ap, tf);
+	if (pp->flags & NV_ADMA_PORT_REGISTER_MODE)
+		ata_tf_read(ap, tf);
 }
 
 static unsigned int nv_adma_tf_to_cpb(struct ata_taskfile *tf, __le16 *cpb)

             reply	other threads:[~2008-02-26  9:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26  9:24 Kuan Luo [this message]
2008-02-26 14:41 ` Robert Hancock
2008-02-26 16:28   ` Jeff Garzik
2008-02-27  4:55     ` Kuan Luo
2008-02-27  5:24       ` Robert Hancock
2008-02-28  0:24       ` Robert Hancock
2008-02-28  3:57         ` Kuan Luo

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=15F501D1A78BD343BE8F4D8DB854566B1BFE2AE5@hkemmail01.nvidia.com \
    --to=kluo@nvidia.com \
    --cc=hancockr@shaw.ca \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pchen@nvidia.com \
    --subject='Re: [PATCH] sata_nv: fix nmi intr or system hanging in rhel4u6 adma.' \
    /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

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).