public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
@ 2004-08-27 16:12 Petter Sundlöf
  2004-08-27 16:32 ` Jeff Garzik
  2004-08-27 23:45 ` Petr Sebor
  0 siblings, 2 replies; 10+ messages in thread
From: Petter Sundlöf @ 2004-08-27 16:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: jgarzik

Using 2.6.8.1. DMA works fine on /dev/hda (PATA, CD burner).

When I try to enable it for my SATA drive (which is performing horribly 
bad -- 80-90% CPU load on an AMD64 3200+ during copy of large files) I 
get this error:

# hdparm -d 1 /dev/sda

/dev/sda:
  setting using_dma to 1 (on)
  HDIO_SET_DMA failed: Invalid argument

Tried different commands:

# hdparm -X66 -d1 /dev/sda

/dev/sda:
  setting using_dma to 1 (on)
  HDIO_SET_DMA failed: Invalid argument
  setting xfermode to 66 (UltraDMA mode2)
  HDIO_DRIVE_CMD(setxfermode) failed: Invalid argument

hdparm -d /dev/sda gives absolutely no information.

The chipset is VIA82Cxx (ASUS K8VSE Deluxe motherboard). Disk is Maxtor 
6Y200M0.

Seen in /proc/scsi/scsi like this:

Host: scsi0 Channel: 00 Id: 00 Lun: 00
   Vendor: ATA      Model: Maxtor 6Y200M0   Rev: YAR5
   Type:   Direct-Access                    ANSI SCSI revision: 05

I also have the Promise controller, which I can use use a regular SATA 
controller (not RAID as is default). Should I attach it to it instead 
(I'd rather not if it can be avoided).

dmesg info:

libata version 1.02 loaded.
sata_via version 0.20
ACPI: PCI interrupt 0000:00:0f.0[B] -> GSI 20 (level, low) -> IRQ 20
sata_via(0000:00:0f.0): routed to hard irq line 10
ata1: SATA max UDMA/133 cmd 0xE400 ctl 0xE002 bmdma 0xD000 irq 20
ata2: SATA max UDMA/133 cmd 0xD800 ctl 0xD402 bmdma 0xD008 irq 20
ata1: dev 0 cfg 49:2f00 82:7c6b 83:7f09 84:4003 85:7c69 86:3e01 87:4003 
88:407f
ata1: dev 0 ATA, max UDMA/133, 398297088 sectors: lba48
ata1: dev 0 configured for UDMA/133
scsi0 : sata_via
ata2: no device found (phy stat 00000000)
scsi1 : sata_via
   Vendor: ATA       Model: Maxtor 6Y200M0    Rev: YAR5
   Type:   Direct-Access                      ANSI SCSI revision: 05
SCSI device sda: 398297088 512-byte hdwr sectors (203928 MB)
SCSI device sda: drive cache: write back
  /dev/scsi/host0/bus0/target0/lun0: p1 p2 < p5 p6 p7 p8 p9 p10 p11 p12 
p13 >
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
  2004-08-27 16:12 Petter Sundlöf
@ 2004-08-27 16:32 ` Jeff Garzik
  2004-08-27 23:45 ` Petr Sebor
  1 sibling, 0 replies; 10+ messages in thread
From: Jeff Garzik @ 2004-08-27 16:32 UTC (permalink / raw)
  To: Petter Sundlöf; +Cc: linux-kernel

Petter Sundlöf wrote:
> Using 2.6.8.1. DMA works fine on /dev/hda (PATA, CD burner).
> 
> When I try to enable it for my SATA drive (which is performing horribly 
> bad -- 80-90% CPU load on an AMD64 3200+ during copy of large files) I 
> get this error:

> sata_via(0000:00:0f.0): routed to hard irq line 10
> ata1: SATA max UDMA/133 cmd 0xE400 ctl 0xE002 bmdma 0xD000 irq 20
> ata2: SATA max UDMA/133 cmd 0xD800 ctl 0xD402 bmdma 0xD008 irq 20
> ata1: dev 0 cfg 49:2f00 82:7c6b 83:7f09 84:4003 85:7c69 86:3e01 87:4003 
> 88:407f
> ata1: dev 0 ATA, max UDMA/133, 398297088 sectors: lba48
> ata1: dev 0 configured for UDMA/133


DMA is always enabled.

	Jeff



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
  2004-08-27 16:12 Petter Sundlöf
  2004-08-27 16:32 ` Jeff Garzik
@ 2004-08-27 23:45 ` Petr Sebor
  2004-08-29 13:05   ` Alan Cox
  1 sibling, 1 reply; 10+ messages in thread
From: Petr Sebor @ 2004-08-27 23:45 UTC (permalink / raw)
  To: Petter Sundlöf; +Cc: linux-kernel

Petter Sundlöf wrote:
> Using 2.6.8.1. DMA works fine on /dev/hda (PATA, CD burner).
> 
> When I try to enable it for my SATA drive (which is performing horribly 
> bad -- 80-90% CPU load on an AMD64 3200+ during copy of large files)

Hello,

just a 'me too' e-mail... I have Master2-FAR mobo, VIA/KT800 chipset.
IDE disk runs like a charm but SATA disks consume big amount of cpu
time (which is spent in iowait). The system behaves exactly as with
old IDE disk and DMA disabled... everything is slow when data is 
transferred to/from disk.

I have played with various settings, io schedulers, acpi... but haven't
found anything useful so far..

Regards,
Petr

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
  2004-08-27 23:45 ` Petr Sebor
@ 2004-08-29 13:05   ` Alan Cox
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Cox @ 2004-08-29 13:05 UTC (permalink / raw)
  To: Petr Sebor; +Cc: Petter Sundlöf, Linux Kernel Mailing List

On Sad, 2004-08-28 at 00:45, Petr Sebor wrote:
> just a 'me too' e-mail... I have Master2-FAR mobo, VIA/KT800 chipset.
> IDE disk runs like a charm but SATA disks consume big amount of cpu
> time (which is spent in iowait). The system behaves exactly as with
> old IDE disk and DMA disabled... everything is slow when data is 
> transferred to/from disk.

Make sure you enable the SCSI later, SATA drivers and VIA SATA driver
otherwise you may end up using PIO with the PCI generic IDE driver.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
       [not found] <7076215DFAA4574099E5CD59FE42226204F6C364@pcssrv42.pcs.pc.ome.toshiba.co.jp>
@ 2004-08-30  6:44 ` Petr Sebor
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Sebor @ 2004-08-30  6:44 UTC (permalink / raw)
  To: Tomita, Haruo; +Cc: Alan Cox, petter.sundlof, linux-kernel

Hello,

Alan wrote> Make sure you enable the SCSI later, SATA drivers and VIA SATA driver
Alan wrote> otherwise you may end up using PIO with the PCI generic IDE driver.

Yes, this is up and running, no problem here:

libata version 1.02 loaded.
sata_via version 0.20
ACPI: PCI interrupt 0000:00:0f.0[B] -> GSI 20 (level, low) -> IRQ 185
sata_via(0000:00:0f.0): routed to hard irq line 11
ata1: SATA max UDMA/133 cmd 0xC000 ctl 0xC402 bmdma 0xD000 irq 185
ata2: SATA max UDMA/133 cmd 0xC800 ctl 0xCC02 bmdma 0xD008 irq 185
ata1: dev 0 cfg 49:2f00 82:346b 83:7f21 84:4003 85:3469 86:3c01 87:4003 88:203f
ata1: dev 0 ATA, max UDMA/100, 488397168 sectors: lba48
ata1: dev 0 configured for UDMA/100
scsi0 : sata_via
ata2: dev 0 cfg 49:2f00 82:346b 83:7f21 84:4003 85:3469 86:3c01 87:4003 88:407f
ata2: dev 0 ATA, max UDMA/133, 72303840 sectors: lba48
ata2: dev 0 configured for UDMA/133
scsi1 : sata_via
  Vendor: ATA       Model: WDC WD2500JD-00F  Rev: 02.0
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: ATA       Model: WDC WD360GD-00FN  Rev: 35.0
  Type:   Direct-Access                      ANSI SCSI revision: 05
SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
SCSI device sda: drive cache: write back
 sda: sda1 sda2
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sdb: 72303840 512-byte hdwr sectors (37020 MB)
SCSI device sdb: drive cache: write back
 sdb: sdb1
Attached scsi disk sdb at scsi1, channel 0, id 0, lun 0


Tomita, Haruo wrote:

>Hi all,
>
>
>VIA/KT800 chipset is not checking.
>
>It seems that it cannot perform in combine mode 
>at the ata_piix driver of a version 1.02.
>In this case, although a piix driver should work, 
>ESB_3 is not recognized in a piix driver.
>Therefore, it can work only by PIO mode.
>
>Petr, I think that it is necessary to check a setup of BIOS parameters.
>Or how about making this patch reference?
>
>      http://marc.theaimsgroup.com/?l=linux-ide&m=109290653905964&w=2
>
>Best regards,
>Haruo
>  
>
Haruo,

I am not using the combine mode on the sata drives (or at least, I don't 
know about it). I was implying that
when I connect another pure IDE drive to the motherboard, then the 
situation gets better.

Whats wrong here (or ... what feels wrong) is that the system slows down 
noticeably when transferring data
to/from the sata drives. It 'feels' like using an old ide disk with pio 
mode only. I am not saying that the transfer rates
are low though... hdparm -t on the sata drives gives me following:

/dev/sda:
 Timing buffered disk reads:  140 MB in  3.01 seconds =  46.46 MB/sec

/dev/sdb:
 Timing buffered disk reads:  164 MB in  3.00 seconds =  54.60 MB/sec

this is not the best, but I think it is acceptable for SATA/PATA drives 
and onboard SATA controller.

It is quite hard to describe what is going wrong here... It might not be 
even related to the sata itself...

One example of the 'slow' system is that when I run 'top -d 1' (top with 
1 second updates), it sometimes
takes ~4 seconds for the screen to update when the disk io is on action.
(on dual processor opteron x86_64 machine :-) .Kernel vanilla 2.6.8.

Best Regards,
Petr


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
@ 2004-08-31  5:58 Tomita, Haruo
  2004-08-31  6:06 ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: Tomita, Haruo @ 2004-08-31  5:58 UTC (permalink / raw)
  To: Petr Sebor; +Cc: Alan Cox, petter.sundlof, linux-kernel

Hi Petr

Petr wrote> I am not using the combine mode on the sata drives 
Petr wrote> (or at least, I don't know about it). I was implying that
Petr wrote> when I connect another pure IDE drive to the motherboard, 
Petr wrote> then the situation gets better.

It seems that I have mistaken. 
The misunderstood problem is as follows. 

Combined mode can be set up by the SATA controller of ESB of Intel tip. 
This mode is the mode which can use SATA and PATA simultaneously. 
In ata_piix driver, when combined mode is specified, it does not work.
On the other hand, at the piix driver, in order not to recognize ESB tip, 
it worked only by PIO mode.

Petr wrote> Whats wrong here (or ... what feels wrong) is that the system 
Petr wrote> slows down noticeably when transferring data
Petr wrote> to/from the sata drives. It 'feels' like using an old ide 
Petr wrote> disk with pio mode only. I am not saying that the transfer rates
Petr wrote> are low though... hdparm -t on the sata drives gives me following:

It is the result of measuring in my environment:

  Linux-2.4.28-pre2 (RedHat Enterprise Linux 3 Update2 Base)
  HDD: HITACHI DeskStar 80G x 2
  SATA: Intel 82801ESB
  ata_piix driver version : 1.02.

The result is as follows. 
I think that there are not your result and great difference.

/dev/sda:
Timing buffered disk reads:  152 MB in  3.00 seconds =  50.67 MB/sec

/dev/sdb:
Timing buffered disk reads:  174 MB in  3.02 seconds =  57.62 MB/sec

Best Regards,
Haruo 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
  2004-08-31  5:58 Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA) Tomita, Haruo
@ 2004-08-31  6:06 ` Jeff Garzik
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Garzik @ 2004-08-31  6:06 UTC (permalink / raw)
  To: Tomita, Haruo; +Cc: Petr Sebor, Alan Cox, petter.sundlof, linux-kernel

Tomita, Haruo wrote:
> Combined mode can be set up by the SATA controller of ESB of Intel tip. 
> This mode is the mode which can use SATA and PATA simultaneously. 
> In ata_piix driver, when combined mode is specified, it does not work.


May I request, again, information on this.  In the current kernel you 
are the only one reporting this problem.

Does 2.6.9-rc1-bk work for you?

	Jeff



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
@ 2004-09-01  2:57 Tomita, Haruo
  0 siblings, 0 replies; 10+ messages in thread
From: Tomita, Haruo @ 2004-09-01  2:57 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Petr Sebor, Alan Cox, petter.sundlof, linux-kernel,
	'linux-ide@vger.kernel.org', Tomita, Haruo

Hi Jeff,

Sorry for not writing you soon.

Haruo> Combined mode can be set up by the SATA controller of ESB of Intel tip. 
Haruo> This mode is the mode which can use SATA and PATA simultaneously. 
Haruo> In ata_piix driver, when combined mode is specified, it does not work.
 
Jeff> May I request, again, information on this.  In the current kernel you 
Jeff> are the only one reporting this problem.
Jeff> Does 2.6.9-rc1-bk work for you?

2.6.9-rc1-bk7 has no problem. It is worked.
But, 2.4.28-pre2-bk1 is not work.
As 2.4.28-pre2-bk1, I created the patch for solving this problem. 
Is it right? The patch is as follows.

===== SATA combined mode patch for linux-2.4.28-pre2 =====

diff -urN linux-2.4.28-pre2-bk1orig/drivers/pci/quirks.c linux-2.4.28-pre2-bk1/drivers/pci/quirks.c
--- linux-2.4.28-pre2-bk1orig/drivers/pci/quirks.c	2004-08-31 15:11:08.000000000 +0900
+++ linux-2.4.28-pre2-bk1/drivers/pci/quirks.c	2004-09-01 09:33:11.000000000 +0900
@@ -719,6 +719,61 @@
 	}
 }
 
+#ifdef CONFIG_SCSI_SATA
+static void __init quirk_intel_ide_combined(struct pci_dev *pdev)
+{
+	u8 prog, comb, tmp;
+
+	/*
+	 * Narrow down to Intel SATA PCI devices.
+	 */
+	switch (pdev->device) {
+	/* PCI ids taken from drivers/scsi/ata_piix.c */
+	case 0x24d1:
+	case 0x24df:
+	case 0x25a3:
+	case 0x25b0:
+	case 0x2651:
+	case 0x2652:
+		break;
+	default:
+		/* we do not handle this PCI device */
+		return;
+	}
+
+	/*
+	 * Read combined mode register.
+	 */
+	pci_read_config_byte(pdev, 0x90, &tmp); /* combined mode reg */
+	tmp &= 0x6;     /* interesting bits 2:1, PATA primary/secondary */
+	if (tmp == 0x4)         /* bits 10x */
+		comb = (1 << 0);                /* SATA port 0, PATA port 1 */
+	else if (tmp == 0x6)    /* bits 11x */
+		comb = (1 << 2);                /* PATA port 0, SATA port 1 */
+	else
+		return;                         /* not in combined mode */
+
+	/*
+	 * Read programming interface register.
+	 * (Tells us if it's legacy or native mode)
+	 */
+	pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
+	/* if SATA port is in native mode, we're ok. */
+	if (prog & comb)
+		return;
+
+	/* SATA port is in legacy mode.  Reserve port so that
+	 * IDE driver does not attempt to use it.  If request_region
+	 * fails, it will be obvious at boot time, so we don't bother
+	 * checking return values.
+	 */
+	if (comb == (1 << 0))
+		request_region(0x1f0, 8, "libata");     /* port 0 */
+	else
+		request_region(0x170, 8, "libata");     /* port 1 */
+}
+#endif
+
 /*
  *  The main table of quirks.
  */
@@ -797,6 +852,10 @@
 	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_AMD,      PCI_DEVICE_ID_AMD_8131_APIC, 
 	  quirk_amd_8131_ioapic }, 
 #endif
+#ifdef CONFIG_SCSI_SATA
+	{ PCI_FIXUP_FINAL,	PCI_VENDOR_ID_INTEL,	PCI_ANY_ID,
+	  quirk_intel_ide_combined },
+#endif
 
 	/*
 	 * on Asus P4B boards, the i801SMBus device is disabled at startup.
diff -urN linux-2.4.28-pre2-bk1orig/drivers/scsi/ata_piix.c linux-2.4.28-pre2-bk1/drivers/scsi/ata_piix.c
--- linux-2.4.28-pre2-bk1orig/drivers/scsi/ata_piix.c	2004-08-31 15:11:08.000000000 +0900
+++ linux-2.4.28-pre2-bk1/drivers/scsi/ata_piix.c	2004-09-01 12:07:22.000000000 +0900
@@ -620,8 +620,7 @@
 		port_info[pata_chan] = &piix_port_info[ich5_pata];
 		n_ports++;
 
-		printk(KERN_ERR DRV_NAME ": combined mode not supported\n");
-		return -ENODEV;
+		printk(KERN_WARNING DRV_NAME ": combined mode detected\n");
 	}
 
 	return ata_pci_init_one(pdev, port_info, n_ports);
diff -urN linux-2.4.28-pre2-bk1orig/drivers/scsi/libata-core.c linux-2.4.28-pre2-bk1/drivers/scsi/libata-core.c
--- linux-2.4.28-pre2-bk1orig/drivers/scsi/libata-core.c	2004-08-31 15:11:08.000000000 +0900
+++ linux-2.4.28-pre2-bk1/drivers/scsi/libata-core.c	2004-09-01 10:20:06.000000000 +0900
@@ -3296,14 +3296,27 @@
 		goto err_out;
 
 	if (legacy_mode) {
-		if (!request_region(0x1f0, 8, "libata"))
-			printk(KERN_WARNING "ata: 0x1f0 IDE port busy\n");
-		else
+		if (!request_region(0x1f0, 8, "libata")) {
+			struct resource *conflict, res;
+			res.start = 0x1f0;
+			res.end = 0x1f0 + 8 - 1;
+			conflict = ____request_resource(&ioport_resource, &res);			if (!strcmp(conflict->name, "libata"))
+				legacy_mode |= (1 << 0);
+			else
+				printk(KERN_WARNING "ata: 0x1f0 IDE port busy\n");
+		} else
 			legacy_mode |= (1 << 0);
 
-		if (!request_region(0x170, 8, "libata"))
-			printk(KERN_WARNING "ata: 0x170 IDE port busy\n");
-		else
+		if (!request_region(0x170, 8, "libata")) {
+			struct resource *conflict, res;
+			res.start = 0x170;
+			res.end = 0x170 + 8 - 1;
+			conflict = ____request_resource(&ioport_resource, &res);
+			if (!strcmp(conflict->name, "libata"))
+				legacy_mode |= (1 << 1);
+			else
+				printk(KERN_WARNING "ata: 0x170 IDE port busy\n");
+		} else
 			legacy_mode |= (1 << 1);
 	}
 
diff -urN linux-2.4.28-pre2-bk1orig/include/linux/ioport.h linux-2.4.28-pre2-bk1/include/linux/ioport.h
--- linux-2.4.28-pre2-bk1orig/include/linux/ioport.h	2003-11-29 03:26:21.000000000 +0900
+++ linux-2.4.28-pre2-bk1/include/linux/ioport.h	2004-09-01 09:51:25.000000000 +0900
@@ -85,6 +85,7 @@
 
 extern int check_resource(struct resource *root, unsigned long, unsigned long);
 extern int request_resource(struct resource *root, struct resource *new);
+extern struct resource * ____request_resource(struct resource *root, struct resource *new);
 extern int release_resource(struct resource *new);
 extern int allocate_resource(struct resource *root, struct resource *new,
 			     unsigned long size,
diff -urN linux-2.4.28-pre2-bk1orig/kernel/ksyms.c linux-2.4.28-pre2-bk1/kernel/ksyms.c
--- linux-2.4.28-pre2-bk1orig/kernel/ksyms.c	2004-02-18 22:36:32.000000000 +0900
+++ linux-2.4.28-pre2-bk1/kernel/ksyms.c	2004-09-01 09:58:33.000000000 +0900
@@ -448,6 +448,7 @@
 #endif
 
 /* resource handling */
+EXPORT_SYMBOL(____request_resource);
 EXPORT_SYMBOL(request_resource);
 EXPORT_SYMBOL(release_resource);
 EXPORT_SYMBOL(allocate_resource);
diff -urN linux-2.4.28-pre2-bk1orig/kernel/resource.c linux-2.4.28-pre2-bk1/kernel/resource.c
--- linux-2.4.28-pre2-bk1orig/kernel/resource.c	2003-11-29 03:26:21.000000000 +0900
+++ linux-2.4.28-pre2-bk1/kernel/resource.c	2004-09-01 09:47:24.000000000 +0900
@@ -166,6 +166,16 @@
 	return conflict ? -EBUSY : 0;
 }
 
+struct resource *____request_resource(struct resource *root, struct resource *new)
+{
+struct resource *conflict;
+
+	write_lock(&resource_lock);
+	conflict = __request_resource(root, new);
+	write_unlock(&resource_lock);
+	return conflict;
+}
+
 int release_resource(struct resource *old)
 {
 	int retval;

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
       [not found] <4136E7EF00073144@mail-3.tiscali.it>
@ 2004-10-06  0:30 ` Gianluca Cecchi
  2004-10-06  0:54   ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: Gianluca Cecchi @ 2004-10-06  0:30 UTC (permalink / raw)
  To: linux-kernel



Hello,
please CC me to your replies as I'm not currently a subscriber; thanks in
advance.
Excuse me for the long text: it contains information about behaviour of
my system.
This thread had no news about 1) dma settings considerations and 2) heavy
cpu load during
heavy I/O operations 3) summary on performance/smartness of system.

My system is a Dual Athlon 1800MHz with 1Gb of ram.
There are 2xsata disks (Maxtor 6Y120M0 120Gb each) and I have a Magnex KW571S
PCI ATA RAID card, that is based on Sil Image 3112a chipset (two indipendent
sata
 channels).
I'm not planning to use the raid provided by the card.
My os is a Slackware 10.0 upgraded to -current (01/10/04) with kernel.org
2.6.8.1
 kernel.
Eventually I can provide config. Btw, I'm using udev and kernel preemption.
The os was transferred and LILO reinstalled from a previous 18Gb scsi disk.
At this moment I'm using only the first sata disk.
Output of my dmesg is:

libata version 1.02 loaded.
sata_sil version 0.54
ACPI: PCI interrupt 0000:00:08.0[A] -> GSI 16 (level, low) -> IRQ 177
ata1: SATA max UDMA/100 cmd 0xF8811080 ctl 0xF881108A bmdma 0xF8811000 irq
177
ata2: SATA max UDMA/100 cmd 0xF88110C0 ctl 0xF88110CA bmdma 0xF8811008 irq
177
ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01 87:4003
88:207f
ata1: dev 0 ATA, max UDMA/133, 240121728 sectors:
ata1: dev 0 configured for UDMA/100
scsi2 : sata_sil
ata2: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01 87:4003
88:207f
ata2: dev 0 ATA, max UDMA/133, 240121728 sectors:
ata2: dev 0 configured for UDMA/100
scsi3 : sata_sil
  Vendor: ATA       Model: Maxtor 6Y120M0    Rev: YAR5
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: ATA       Model: Maxtor 6Y120M0    Rev: YAR5
  Type:   Direct-Access                      ANSI SCSI revision: 05
SCSI device sda: 240121728 512-byte hdwr sectors (122942 MB)
SCSI device sda: drive cache: write back
 sda: sda1 sda2 sda3 sda4 < sda5 >
Attached scsi disk sda at scsi2, channel 0, id 0, lun 0
SCSI device sdb: 240121728 512-byte hdwr sectors (122942 MB)
SCSI device sdb: drive cache: write back
 sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 >
Attached scsi disk sdb at scsi3, channel 0, id 0, lun 0

Point 1)
Jeff Garzik confirmed that DMA is always enabled when sata drives are seen
as
scsi devices.
But do I have to worry or not about the lines
ata1: SATA max UDMA/100 cmd 0xF8811080 ctl 0xF881108A bmdma 0xF8811000 irq
177
...
ata1: dev 0 ATA, max UDMA/133, 240121728 sectors:
ata1: dev 0 configured for UDMA/100
and the same for ata2?

Shouldn't I see max UDMA/133 for the controller, instead of 100?
I have also an IDE disk in the system.
hdparm -i on it gives:
/dev/hdb:

 Model=SAMSUNG SP0411N, FwRev=TW100-07, SerialNo=0611J1AW931372
 Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
 RawCHS=16383/16/63, TrkSize=34902, SectSize=554, ECCbytes=4
 BuffType=DualPortCache, BuffSize=2048kB, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=66055248
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio1 pio2 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: (null):

Does this interfere in some way with sata disk udma settings?
I'm not able to detach it at the moment, but as soon as I can, I'll let
you know
eventually.

Point 2)
As Petr Sebor, I also have serious  problems when doing heavy I/O, especially
in read operations. Any hints?

My hdparm -tT values are good, I think:

hdparm -tT /dev/sda

/dev/sda:
 Timing cached reads:   960 MB in  2.00 seconds = 479.59 MB/sec
 Timing buffered disk reads:  170 MB in  3.00 seconds =  56.62 MB/sec

When doing:
time dd if=/dev/sda of=/dev/null bs=1024k count=4096
4096+0 records in
4096+0 records out

real    1m12.378s
user    0m0.029s
sys     0m21.280s
So confirmed the 56MB/s reading.

But taking in parallel top with refresh 1s in another window, during the
80
seconds elapsed above, I had two freezes in top session: one of 20sec and
another
of 15 sec: about the half of the time of the total I/O operation!
During this time there was one cpu used at about 30%, no other cpu constraints.
I repeated the operation with similar behaviour. Sometimes also 50 contiguos
secs
of freeze, until I/O operation finished.
The freeze is not about all system itself, but only certian things.
For example I tried also a vmstat session in another window with 3secs of
delay
and it had no problems while top was blocked:

gcecchi@tkamd:~$ vmstat 3
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy
id wa
0  2   4360  87100 737100  53728    0    0 58283     0 2223  2726  0 19
45 36
 1  1   4360  87036 737128  53768    0    0 58197     5 2227  2655  0 19
46 35
 0  2   4360  86128 738148  53700    0    0 58240     0 2232  2677  0 19
47 35
 0  2   4360  86048 738156  53760    0    0 58283     1 2228  2391  1 19
45 36
 1  2   4360  86332 737928  53716    0    0 58197     0 2233  2434  1 19
47 34
 0  2   4360  86524 737708  53800    0    0 58283     0 2343  2662  1 19
46 34
 0  3   4360  87036 737244  53788    0    0 57603     0 2243  2483  1 19
46 34
 0  1   4360  86252 738032  53748    0    0 57429     7 2232  2482  1 18
46 35
 0  1   4360  87220 737024  53804    0    0 58197     3 2159  2205  2 18
48 33
 0  2   4360  86012 738292  53692    0    0 58240    29 2212  2401  1 19
48 32
 1  1   4360  86256 738036  53744    0    0 58325     0 2249  2643  0 19
47 34
 0  2   4360  86956 737304  53796    0    0 58197     0 2226  2727  0 19
46 35
 0  2   4360  87148 737092  53736    0    0 58240     0 2255  2748  0 19
45 36
 0  2   4360  87284 736900  53724    0    0 58283     3 2299  2995  2 19
45 34
 2  1   4360  86772 737440  53796    0    0 57097     0 2506  3284  2 20
42 36
 0  2   4360  86700 737572  53732    0    0 57771     1 2324  3290  2 20
43 35
 0  2   4360  86428 737780  53796    0    0 57899     0 2271  3002  2 19
45 34
 2  3   4360  86748 737464  53772    0    0 58284     0 2237  2764  1 18
47 34
 0  2   4360  86356 737800  53776    0    0 57436     0 2291  3048  2 19
44 34
 0  0   4360  88104 737132  53832    0    0 44675    47 2005  2582  2 15
58 25

But if I try to open another knosole window it freezes...
time dd if=/dev/zero of=/data/testfile bs=1024k count=4096
4096+0 records in
4096+0 records out

real    1m31.687s
user    0m0.024s
sys     0m23.517s
About 44.6MB/s.

No problems with top during the write operation. At least it looses 1sec
every
30 secs.
Cpu used about 25-30% and kswapd about 2%.
If I do a dd on both sda and sdb at the same time:

root@tkamd:/data# time dd if=/dev/sda of=/dev/null bs=1024k count=4096
4096+0 records in
4096+0 records out

real    1m14.899s
user    0m0.033s
sys     0m23.820s

root@tkamd:~# time dd if=/dev/sdb of=/dev/null bs=1024k count=4096
4096+0 records in
4096+0 records out

real    1m15.849s
user    0m0.036s
sys     0m23.419s

So in absolute is good, but in the top session I had a freeze of about 8secs
every 10secs.
vmstat gives in this situation:

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy
id wa
0  3  12604 211124 629152  46744    0    0 111787     0 3050  4204  2 37
 1 61
 0  3  12972  96196 743340  46088    0  123 111104   123 3121  4658  3 41
 1 56
 2  2  12972  96524 743336  46120    0    0 111360     5 3046  4153  1 39
 0 60
 1  2  12972  96388 743468  46056    0    0 111659     1 3090  4260  3 40
 0 57
 1  2  12972  96532 743292  46124    0    0 111360     4 2973  3928  3 40
27 31
 2  1  12972  96180 743804  46088    0    0 109909     1 3092  4422  3 41
27 30
 0  3  12972  95836 744088  46008    0    0 111659     4 2979  3847  1 39
11 49
 0  3  12972  95896 744032  45996    0    0 109745    16 3047  4141  3 40
15 42
 2  3  12972  96540 743440  45976    0    0 111872    19 3072  4091  1 41
30 28
 2  2  12972  96892 743032  46044    0    0 112939     0 3066  4198  0 40
32 28
 0  3  12972  96796 743192  46020    0    0 110807     9 3046  3682  1 39
24 36
 1  2  12972  96220 743768  45988    0    0 111787     0 3046  3768  1 40
 1 58
 2  2  12972  96796 743196  46016    0    0 111019    16 3123  3987  2 40
 1 58

With parallel write on sda and sdb:
root@tkamd:/data# time dd if=/dev/zero of=/data/testfile bs=1024k count=4096
4096+0 records in
4096+0 records out

real    1m29.197s
user    0m0.034s
sys     0m26.680s

root@tkamd:~# time dd if=/dev/zero of=/mnt/testfile bs=1024k count=4096
4096+0 records in
4096+0 records out

real    1m38.726s
user    0m0.039s
sys     0m28.976s

No problems with top, vmstat or new konsole operations.
Each cpu about 30% loaded and vmstat gives:
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy
id wa
1  0  12972 491516 328980  61232    0    0     0    51 1173  1556  2  1
97  0
 0  0  12972 491384 328980  61232    0    0     0     0 1271  1955  4  2
95  0
 1  1  12972 316000 502300  61176    0    0 57797    17 2139  2800  4 20
57 19
 4  2  12972  74164 743904  61244    0    0 112696    24 2881  3439  1 38
34 27
 1  3  12972  74344 743980  61236    0    0 112256     0 3063  4126  1 41
31 28
 0  3  12972  75296 742956  61308    0    0 112597     0 3046  4415  0 41
15 44
 1  1  12972  75416 742976  61220    0    0 112469     7 3032  4246  0 40
 6 54
 1  1  12972  74052 744252  61236    0    0 111445    21 3041  3825  3 41
34 23
 1  3  12972  74544 743760  61184    0    0 111232     4 3241  4312  5 43
25 28
 1  2  12972  74184 744028  61256    0    0 112981    20 3186  4493  1 42
 0 56
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy
id wa
 2  3  12972  74724 743504  61168    0    0 110080     0 3138  4351  6 43
 1 51
 0  3  12972  74116 744160  61192    0    0 111829     0 3162  4517  1 42
 1 56
 1  3  12972  74420 743784  61228    0    0 110464     0 3161  4587  2 41
 1 56
 2  2  12972  75088 743136  61196    0    0 110848     0 3191  4704  3 43
 1 53
 0  0  12972 483420 336572  61324    0    0 69248     7 2341  3334  3 28
31 37
 0  0  12972 483252 336620  61344    0    0     9     0 1120  1373  2  1
96  1

Any hints or I/O operations to be done to give further info on behaviour
are
welcome.
Next days I'm able to do some tests if necessary.
Thanks in advance for your help.
Bye,
Gianluca

>-- Messaggio Originale --

>
>Hello,
>
>Alan wrote> Make sure you enable the SCSI later, SATA drivers and VIA SATA
>driver
>Alan wrote> otherwise you may end up using PIO with the PCI generic IDE
>driver.
>
>Yes, this is up and running, no problem here:
>
>libata version 1.02 loaded.
>sata_via version 0.20
>ACPI: PCI interrupt 0000:00:0f.0[B] -> GSI 20 (level, low) -> IRQ 185
>sata_via(0000:00:0f.0): routed to hard irq line 11
>ata1: SATA max UDMA/133 cmd 0xC000 ctl 0xC402 bmdma 0xD000 irq 185
>ata2: SATA max UDMA/133 cmd 0xC800 ctl 0xCC02 bmdma 0xD008 irq 185
>ata1: dev 0 cfg 49:2f00 82:346b 83:7f21 84:4003 85:3469 86:3c01 87:4003
>88:203f
>ata1: dev 0 ATA, max UDMA/100, 488397168 sectors: lba48
>ata1: dev 0 configured for UDMA/100
>scsi0 : sata_via
>ata2: dev 0 cfg 49:2f00 82:346b 83:7f21 84:4003 85:3469 86:3c01 87:4003
>88:407f
>ata2: dev 0 ATA, max UDMA/133, 72303840 sectors: lba48
>ata2: dev 0 configured for UDMA/133
>scsi1 : sata_via
>Vendor: ATA Model: WDC WD2500JD-00F Rev: 02.0
>Type: Direct-Access ANSI SCSI revision: 05
>Vendor: ATA Model: WDC WD360GD-00FN Rev: 35.0
>Type: Direct-Access ANSI SCSI revision: 05
>SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
>SCSI device sda: drive cache: write back
>sda: sda1 sda2
>Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
>SCSI device sdb: 72303840 512-byte hdwr sectors (37020 MB)
>SCSI device sdb: drive cache: write back
>sdb: sdb1
>Attached scsi disk sdb at scsi1, channel 0, id 0, lun 0
>
>
>Tomita, Haruo wrote:
>
>    Hi all,
>
>
>    VIA/KT800 chipset is not checking.
>
>    It seems that it cannot perform in combine mode at the ata_piix driver
>of a version 1.02.
>    In this case, although a piix driver should work, ESB_3 is not recognized
>in a piix driver.
>    Therefore, it can work only by PIO mode.
>
>    Petr, I think that it is necessary to check a setup of BIOS parameters.
>    Or how about making this patch reference?
>
>    http://marc.theaimsgroup.com/?l=linux-ide&m=109290653905964&w=2
>
>    Best regards,
>    Haruo
>
>
>Haruo,
>
>I am not using the combine mode on the sata drives (or at least, I don't
>know about it). I was implying that
>when I connect another pure IDE drive to the motherboard, then the situation
>gets better.
>
>Whats wrong here (or ... what feels wrong) is that the system slows down
>noticeably when transferring data
>to/from the sata drives. It 'feels' like using an old ide disk with pio
>mode only. I am not saying that the transfer rates
>are low though... hdparm -t on the sata drives gives me following:
>
>/dev/sda:
>Timing buffered disk reads: 140 MB in 3.01 seconds = 46.46 MB/sec
>
>/dev/sdb:
>Timing buffered disk reads: 164 MB in 3.00 seconds = 54.60 MB/sec
>
>this is not the best, but I think it is acceptable for SATA/PATA drives
>and onboard SATA controller.
>
>It is quite hard to describe what is going wrong here... It might not be
>even related to the sata itself...
>
>One example of the 'slow' system is that when I run 'top -d 1' (top with
>1 second updates), it sometimes
>takes ~4 seconds for the screen to update when the disk io is on action.
>(on dual processor opteron x86_64 machine :-) .Kernel vanilla 2.6.8.
>
>Best Regards,
>Petr
>
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel"
>in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/
>



__________________________________________________________________
Tiscali Adsl 640 Free: fino al 15 novembre i consumi sono GRATIS!
Se sottoscrivi un'Adsl Free 640 entro il 14 ottobre avrai gratis tutti
i consumi fino al 15/11/04 compreso! In piu' sono gratis il modem
in comodato e l'attivazione. Cosa aspetti? Prima attivi, piu' risparmi!
http://abbonati.tiscali.it/adsl/




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA)
  2004-10-06  0:30 ` Gianluca Cecchi
@ 2004-10-06  0:54   ` Jeff Garzik
  0 siblings, 0 replies; 10+ messages in thread
From: Jeff Garzik @ 2004-10-06  0:54 UTC (permalink / raw)
  To: Gianluca Cecchi; +Cc: linux-kernel

Gianluca Cecchi wrote:
> Eventually I can provide config. Btw, I'm using udev and kernel preemption.

I strongly recommend disabling kernel preemption.  It is a hack that 
hides bugs.



> ata1: dev 0 ATA, max UDMA/133, 240121728 sectors:
> ata1: dev 0 configured for UDMA/100
> and the same for ata2?

The controller maximum is set to UDMA/100.



> But taking in parallel top with refresh 1s in another window, during the
> 80
> seconds elapsed above, I had two freezes in top session: one of 20sec and
> another
> of 15 sec: about the half of the time of the total I/O operation!
> During this time there was one cpu used at about 30%, no other cpu constraints.
> I repeated the operation with similar behaviour. Sometimes also 50 contiguos
> secs
> of freeze, until I/O operation finished.
> The freeze is not about all system itself, but only certian things.
> For example I tried also a vmstat session in another window with 3secs of
> delay
> and it had no problems while top was blocked:

Make sure you have the latest BIOS update for your system, and latest 
BIOS update for your card.

	Jeff



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-10-06  0:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-31  5:58 Cannot enable DMA on SATA drive (SCSI-libsata, VIA SATA) Tomita, Haruo
2004-08-31  6:06 ` Jeff Garzik
     [not found] <4136E7EF00073144@mail-3.tiscali.it>
2004-10-06  0:30 ` Gianluca Cecchi
2004-10-06  0:54   ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2004-09-01  2:57 Tomita, Haruo
     [not found] <7076215DFAA4574099E5CD59FE42226204F6C364@pcssrv42.pcs.pc.ome.toshiba.co.jp>
2004-08-30  6:44 ` Petr Sebor
2004-08-27 16:12 Petter Sundlöf
2004-08-27 16:32 ` Jeff Garzik
2004-08-27 23:45 ` Petr Sebor
2004-08-29 13:05   ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox