2006-12-12 16:27:45

by John Richard Moser

[permalink] [raw]
Subject: libata and sata?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

A while back my distro moved to libata for sata_via. I was since
confused; my disk seemed a lot slower, and it looked like DMA was off.
I'm not sure how SATA works; is it even possible to enable/disable
32-bit IO and DMA? Or are those just on?

sata_via 11524 4
libata 112660 3 ata_generic,pata_via,sata_via

~$ sudo hdparm -d1 -c1 -u1 /dev/sda

/dev/sda:
setting 32-bit IO_support flag to 1
HDIO_SET_32BIT failed: Invalid argument
setting unmaskirq to 1 (on)
HDIO_SET_UNMASKINTR failed: Inappropriate ioctl for device
setting using_dma to 1 (on)
HDIO_SET_DMA failed: Inappropriate ioctl for device
IO_support = 0 (default 16-bit)

I no longer have two kernels to test through; I can't tell if the speed
is back or not. Nothing in dmesg tells me if SATA is using DMA or
32-bit IO support though, so I don't know... lack of knowledge over here
is killing me for troubleshooting this on my own.

- --
We will enslave their women, eat their children and rape their
cattle!
-- Bosc, Evil alien overlord from the fifth dimension
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIVAwUBRX7YeAs1xW0HCTEFAQIZ5w/9GCEP1LMCqTAa366wSg6WcwomBL1fsSik
xrZJ2ZGAzKyAkKA6DLDKjJ12fG1Pueri5qj7Cx8iRgPOFTnXg3+zNdC26uWJ2cSR
hlXI/GkjMAaB2yXidPHkfpsh1fROQoiWPy+wQ8ppXVfW/xwgFUPFst5OWoU/HSbn
8Y72tUDgsj5QjWtn6XendpND8kq59Aqw4A+WG8ThW5FyRNXa5zyd8IW6bSmLGKAa
+/PCp937aK6us8LAqlkjqHaqN+JavS+lTxFXb0ZhStKteoGo0z79IvuwnRbNtJR5
XwDBzWhic1IDTV5NOyxDQ0fBoVTllIKeY55v84lzbRrYJOIiKaze1dyDPPT/nAlo
2nS1rXP+X+3RxqUrD5kXorGSHdTqVQoBINfnntrKTkNqAKUNQ4YxlBmwzsoYsIHO
/h0hCEFoIp1wFokKEP6/Dz6TM63G3m+tadPLpSbQ2u4yEg8N8vSZeix61EieNoAU
nR8YZW52BK6rGc0/IrJRE2fVd90gxSjvN2T3o3Du+cjPHdYQhlvV3GFcIsFVIp3Y
GkXO9T29HwgZO/KuA02vhjqgP2WvC5qeV4ansbukGBBi8jaanm6qf7PcsN0/1bNr
bWqYCfzvIuIg/FPiK7XzkmVJ6cipBbCHEGqBQiQn6D0lpA715Me+T8uTH3HPUX4l
oclOnqemO+w=
=TU0m
-----END PGP SIGNATURE-----


2006-12-12 17:29:31

by Alan

[permalink] [raw]
Subject: Re: libata and sata?

> I no longer have two kernels to test through; I can't tell if the speed
> is back or not. Nothing in dmesg tells me if SATA is using DMA or
> 32-bit IO support though, so I don't know... lack of knowledge over here
> is killing me for troubleshooting this on my own.

The dmesg message shows the mode selected. It should be the highest speed
but in one or two cases it selects UDMA33 only. I've fixed one of those
caused by us relying on a bit not defined in older controllers. We've
still got a case in the newer chips where BIOS setup doesn't set the
flags properly. Old IDE has a hackish workaround for that and I'll
probably end up porting it over.

2006-12-12 17:30:13

by Stephen Clark

[permalink] [raw]
Subject: Re: libata and sata?

John Richard Moser wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>A while back my distro moved to libata for sata_via. I was since
>confused; my disk seemed a lot slower, and it looked like DMA was off.
>I'm not sure how SATA works; is it even possible to enable/disable
>32-bit IO and DMA? Or are those just on?
>
>sata_via 11524 4
>libata 112660 3 ata_generic,pata_via,sata_via
>
>~$ sudo hdparm -d1 -c1 -u1 /dev/sda
>
>/dev/sda:
> setting 32-bit IO_support flag to 1
> HDIO_SET_32BIT failed: Invalid argument
> setting unmaskirq to 1 (on)
> HDIO_SET_UNMASKINTR failed: Inappropriate ioctl for device
> setting using_dma to 1 (on)
> HDIO_SET_DMA failed: Inappropriate ioctl for device
> IO_support = 0 (default 16-bit)
>
>I no longer have two kernels to test through; I can't tell if the speed
>is back or not. Nothing in dmesg tells me if SATA is using DMA or
>32-bit IO support though, so I don't know... lack of knowledge over here
>is killing me for troubleshooting this on my own.
>
>
>
<snip>

Hi John,

This happened to me with my ICH7 intel chipset which supports sata and ata - my drive was an ide and the performance was like 1.2mb/sec. Someone said boot with combined_mode=libata and it fixed the problem.
Now I get 44mb/sec.

HTH,
Steve
--

"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety." (Ben Franklin)

"The course of history shows that as a government grows, liberty
decreases." (Thomas Jefferson)



2006-12-19 00:47:08

by John Richard Moser

[permalink] [raw]
Subject: Re: libata and sata?



Alan wrote:
>> I no longer have two kernels to test through; I can't tell if the speed
>> is back or not. Nothing in dmesg tells me if SATA is using DMA or
>> 32-bit IO support though, so I don't know... lack of knowledge over here
>> is killing me for troubleshooting this on my own.
>
> The dmesg message shows the mode selected. It should be the highest speed
> but in one or two cases it selects UDMA33 only. I've fixed one of those
> caused by us relying on a bit not defined in older controllers. We've
> still got a case in the newer chips where BIOS setup doesn't set the
> flags properly. Old IDE has a hackish workaround for that and I'll
> probably end up porting it over.
>
>

It seems the highest speed here is UDMA/133. That should be right...

I've let this go for now; except someone just brought up that copying
from one SATA drive to another slows Ubuntu to a crawl (which is what
I'm using, hence my dmesg should be relevant). On my end I'm not
noticing; VLC used to hang the system horribly while trying to read like
20M videos (hard disk light on the whole time), now it behaves.


[ 25.411977] sata_via 0000:00:0f.0: version 2.0
[ 25.411992] ACPI: PCI Interrupt 0000:00:0f.0[B] -> Link [ALKA] -> GSI
20 (level, low) -> IRQ 18
[ 25.412004] sata_via 0000:00:0f.0: routed to hard irq line 11
[ 25.412057] ata3: SATA max UDMA/133 cmd 0x9400 ctl 0x9802 bmdma
0xA400 irq 18
[ 25.412363] ata4: SATA max UDMA/133 cmd 0x9C00 ctl 0xA002 bmdma
0xA408 irq 18
[ 25.412380] scsi2 : sata_via
[ 25.415286] 8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004)
[ 25.598514] ieee1394: Host added: ID:BUS[0-00:1023]
GUID[0000000000000000]
[ 25.613389] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ 25.738290] usb 2-1: device not accepting address 2, error -71
[ 25.764951] ata3.00: ATA-7, max UDMA/133, 240121728 sectors: LBA
[ 25.764954] ata3.00: ata3: dev 0 multi count 16
[ 25.765730] ata3.00: configured for UDMA/133
[ 25.765741] scsi3 : sata_via
[ 25.967113] ata4: SATA link down 1.5 Gbps (SStatus 0 SControl 300)
[ 25.977712] ATA: abnormal status 0x7F on port 0x9C07
[ 25.977852] scsi 2:0:0:0: Direct-Access ATA Maxtor 6Y120M0
YAR5 PQ: 0 ANSI: 5

--
We will enslave their women, eat their children and rape their
cattle!
-- Bosc, Evil alien overlord from the fifth dimension