linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: Kuan Luo <kluo@nvidia.com>
Cc: Tejun Heo <htejun@gmail.com>, Mark Lord <liml@rtr.ca>,
	Jeff Garzik <jeff@garzik.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	Allen Martin <AMartin@nvidia.com>, Peer Chen <pchen@nvidia.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: fixed a bug of adma in rhel4u5 with HDS7250SASUN500G.
Date: Fri, 11 Jan 2008 19:07:21 -0600	[thread overview]
Message-ID: <478812C9.1000901@shaw.ca> (raw)
In-Reply-To: <15F501D1A78BD343BE8F4D8DB854566B1BFE2ABF@hkemmail01.nvidia.com>

Kuan Luo wrote:
> hi robert,
> 	I have fixed a bug in rhel4u5 2.6.9-55 when running adma mode
> with HDS7250SASUN500G.
> 	Could you check this code and if no problem,  then help me to
> submit to the newest kernel.
> 

What problem does this resolve? I tested it against the cache flush/NCQ 
write switching problem we've been trying to solve, and it doesn't look 
like it fixes that one - if I apply this patch and then remove the 
udelay(20) in sata_nv.c that I added which prevented me from seeing this 
problem before, it shows up.

If you want to try and reproduce that problem, you can take out this 
udelay(20) from the current version:

if (curr_ncq != pp->last_issue_ncq) {
	/* Seems to need some delay before switching between NCQ and
	   non-NCQ commands, else we get command timeouts and such. */
	udelay(20);
	pp->last_issue_ncq = curr_ncq;
}

then run 2 instances of this C program, with different output files as 
the argument:

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

int main(int argc, char* argv[])
{
	int i;
	int fd = open( argv[1], O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
	if(fd == -1)
	{
		perror("open");
		return 1;
	}
	for(i=0;i<1000000;i++)
	{
		int rc = write(fd, "0", 1);
		if( rc != 1 )
		{
			perror("write");
			return 2;
		}
		rc = fsync(fd);
		if(rc)
		{
			perror("fsync");
			return 2;
		}
	}
	return 0;
}
	
and one instance of this:

dd if=/dev/zero of=blankfile bs=512 count=100000 oflag=direct

and one of this:

while /bin/true; do sdparm --command=sync /dev/sdb; done

all at the same time. In my experience, it helps to disable cpufreq (on 
Red Hat/Fedora, /sbin/service cpuspeed stop) to force the CPU to run at 
max frequency all the time. After a few minutes I got this:

ata4: EH in ADMA mode, notifier 0x0 notifier_error 0x0 gen_ctl 0x1501000 
status 0x400 next cpb count 0x2 next cpb idx 0x0
ata4: CPB 0: ctl_flags 0x1f, resp_flags 0x0
ata4: CPB 1: ctl_flags 0x1f, resp_flags 0x0
ata4: CPB 2: ctl_flags 0x1f, resp_flags 0x0
ata4: timeout waiting for ADMA IDLE, stat=0x400
ata4: timeout waiting for ADMA LEGACY, stat=0x400
ata4.00: exception Emask 0x0 SAct 0x7 SErr 0x0 action 0x2 frozen
ata4.00: cmd 61/08:00:e0:74:64/00:00:0a:00:00/40 tag 0 ncq 4096 out
          res 40/00:01:00:4f:c2/00:00:00:00:00/00 Emask 0x4 (timeout)
ata4.00: status: { DRDY }
ata4.00: cmd 61/08:08:30:5b:76/00:00:0c:00:00/40 tag 1 ncq 4096 out
          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata4.00: status: { DRDY }
ata4.00: cmd 61/01:10:ba:51:77/00:00:0c:00:00/40 tag 2 ncq 512 out
          res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout)
ata4.00: status: { DRDY }
ata4: soft resetting link
ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata4.00: configured for UDMA/133
ata4: EH complete

  parent reply	other threads:[~2008-01-12  1:07 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07  9:25 disabling sata_nv ADMA for 2.6.24 Tejun Heo
2008-01-07 15:15 ` Mark Lord
2008-01-07 15:35   ` [PATCH #upstream-fixes] sata_nv: disable ADMA mode by default Tejun Heo
2008-01-10  5:58     ` Jeff Garzik
2008-01-10  6:29       ` Tejun Heo
2008-01-07 23:35   ` disabling sata_nv ADMA for 2.6.24 Robert Hancock
2008-01-07 23:56     ` Tejun Heo
2008-01-08  0:12       ` Robert Hancock
2008-01-08  1:01         ` Tejun Heo
2008-01-08  1:16           ` Tejun Heo
2008-01-08  2:29             ` Robert Hancock
2008-01-08  2:53               ` Tejun Heo
2008-01-08  2:55                 ` Tejun Heo
2008-01-08  3:01                   ` Robert Hancock
2008-01-08  3:08                     ` Tejun Heo
2008-01-08  9:58                       ` Tejun Heo
2008-01-08 14:40                         ` Robert Hancock
2008-01-09  1:58                           ` Tejun Heo
2008-01-09  2:00                             ` Tejun Heo
2008-01-09  3:50                               ` Robert Hancock
2008-01-09  5:09                                 ` Tejun Heo
2008-01-10  0:33                                   ` Robert Hancock
2008-01-10  6:59                                     ` Tejun Heo
2008-01-11  7:54                                     ` fixed a bug of adma in rhel4u5 with HDS7250SASUN500G Kuan Luo
2008-01-11 14:29                                       ` Robert Hancock
2008-01-11 21:57                                         ` David Milburn
2008-01-12  1:07                                       ` Robert Hancock [this message]
2008-01-14  3:08                                         ` Kuan Luo
2008-01-14  5:20                                           ` Robert Hancock
2008-01-14  6:23                                             ` Kuan Luo
2008-01-23  9:32                                             ` sata_nv and 2.6.24 (was Re: fixed a bug of adma in rhel4u5 with HDS7250SASUN500G.) Jeff Garzik
2008-01-23 14:44                                               ` Robert Hancock
2008-01-24  1:42                                                 ` Jeff Garzik
2008-01-24  1:53                                                   ` Robert Hancock
2008-01-24  0:43                                           ` fixed a bug of adma in rhel4u5 with HDS7250SASUN500G Robert Hancock
2008-01-24  3:20                                             ` Kuan Luo
2008-01-28 23:50                                               ` Robert Hancock
2008-01-29  2:48                                                 ` Kuan Luo
2008-01-29  4:59                                                 ` 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=478812C9.1000901@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=AMartin@nvidia.com \
    --cc=htejun@gmail.com \
    --cc=jeff@garzik.org \
    --cc=kluo@nvidia.com \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pchen@nvidia.com \
    /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).