2007-10-11 07:14:53

by Philipp Wollermann

[permalink] [raw]
Subject: IDE DMA doesn't work with pata_via and compact flash card

Hello,

I've got a problem with the linux kernel, which doesn't boot from a
compact flash card (SanDisk Ultra 2 2048 MB) when trying to use DMA. I
want to boot my PC from the CF card using a CF-to-IDE adapter. It works
perfectly when using a card-reader instead of the adapter and booting
from USB. I'm using kernel 2.6.23 and the new Parallel ATA drivers
(pata_via). The board is a Tyan Tomcat K7M with the VIA KN400A chipset
and VT8237 Southbridge. I also tried using the old IDE drivers, which
give me the same error messages and also hang in a loop like the new
ones, when using DMA. Turning off DMA for the old IDE drivers or
patching ata_generic to handle my IDE controller and then deactivating
DMA in the BIOS works, but then disk I/O is unbelievable slow.. do you
have any idea how to fix it, so that DMA works?

Best regards,
Philipp

Boot messages:

scsi0: pata_via
scsi1: pata_via
ata1: PATA max UDMA/133 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x0001e500
irq 14
ata2: PATA max UDMA/133 cmd 0x000101f0 ctl 0x000103f6 bmdma 0x0001e500
irq 15
ata1.00: CFA: SanDisk SDCFH-2048, HDX 4.04, max MWDMA2
ata1.00: 4001760 sectors, multi 0: LBA
ata1.00: configured for MWDMA2
scsi 0:0:0:0: Direct-Access ATA SanDisk SDCFH-20 HDX PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 4001760 512-byte hardware sectors (2049 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't
support DPO or FUA
sd 0:0:0:0: [sda] 4001760 512-byte hardware sectors (2049 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't
support DPO or FUA
sda:[here it hangs for some time ...]<3>ata1.00: exception Emask 0x0
SAct 0x0 SErr 0x0 action 0x2 frozen
ata1.00: cmd c8/00:08:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in
res 40/00:00:00:00:00/00:00:00:00/00 Emask 0x4 (timeout)
ata1: soft resetting port
ata1.00: configured for MWDMA
ata1: EH complete
ata1.00: cmd c8/00:08:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in
res 40/00:00:00:00:00/00:00:00:00/00 Emask 0x4 (timeout)
ata1: soft resetting port
ata1.00: configured for MWDMA
ata1: EH complete
ata1.00: cmd c8/00:08:00:00/00:00:00:00:00/e0 tag 0 cdb 0x0 data 4096 in
res 40/00:00:00:00:00/00:00:00:00/00 Emask 0x4 (timeout)
ata1: soft resetting port
ata1.00: configured for MWDMA
ata1: EH complete
[...]




lspci -vv:
[...]
00:00.0 Host bridge: VIA Technologies, Inc. VT8378 [KM400/A] Chipset
Host Bridge
Subsystem: VIA Technologies, Inc. VT8378 [KM400/A] Chipset Host
Bridge
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort+ >SERR- <PERR-
Latency: 8
Region 0: Memory at e0000000 (32-bit, prefetchable) [size=128M]
Capabilities: [80] AGP version 3.5
Status: RQ=32 Iso- ArqSz=0 Cal=2 SBA+ ITACoh- GART64-
HTrans- 64bit- FW- AGP3- Rate=x1,x2,x4
Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit-
FW- Rate=<none>
Capabilities: [c0] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
[...]
00:0f.0 IDE interface: VIA Technologies, Inc.
VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
(prog-if 8a [Master SecP PriP])
Subsystem: VIA Technologies, Inc.
VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop-
ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium
>TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 32
Interrupt: pin A routed to IRQ 18
Region 0: [virtual] Memory at 000001f0 (32-bit,
non-prefetchable) [size=8]
Region 1: [virtual] Memory at 000003f0 (type 3,
non-prefetchable) [size=1]
Region 2: [virtual] Memory at 00000170 (32-bit,
non-prefetchable) [size=8]
Region 3: [virtual] Memory at 00000370 (type 3,
non-prefetchable) [size=1]
Region 4: I/O ports at e500 [size=16]
Capabilities: [c0] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-
[...]


2007-10-11 10:14:38

by Alan

[permalink] [raw]
Subject: Re: IDE DMA doesn't work with pata_via and compact flash card

> ones, when using DMA. Turning off DMA for the old IDE drivers or
> patching ata_generic to handle my IDE controller and then deactivating
> DMA in the BIOS works, but then disk I/O is unbelievable slow.. do you
> have any idea how to fix it, so that DMA works?

Does your CF/IDE adapter support DMA ?

2007-10-11 11:03:17

by Philipp Wollermann

[permalink] [raw]
Subject: Re: IDE DMA doesn't work with pata_via and compact flash card


On Thu, 11 Oct 2007 11:19:11 +0100, Alan Cox <[email protected]>
wrote:
>> ones, when using DMA. Turning off DMA for the old IDE drivers or
>> patching ata_generic to handle my IDE controller and then deactivating
>> DMA in the BIOS works, but then disk I/O is unbelievable slow.. do you
>> have any idea how to fix it, so that DMA works?
>
> Does your CF/IDE adapter support DMA ?

Thank you for your answer :)

I thought CF/IDE adapters are mainly electrical adapters.. I've never seen
one which explicitly states the modes it supports. On the other hand it
says on the package: "Vista compatible" (whatever that means)

Is there some way I can figure it out? I'll have a deeper look on the
datasheet when I'm home again later, but I'm rather sure there wasn't
anything mentioning supporting data transfer modes..

Best regards,
Philipp

2007-10-11 11:40:18

by Philipp Wollermann

[permalink] [raw]
Subject: Re: IDE DMA doesn't work with pata_via and compact flash card


On Thu, 11 Oct 2007 11:19:11 +0100, Alan Cox <[email protected]>
wrote:
>> ones, when using DMA. Turning off DMA for the old IDE drivers or
>> patching ata_generic to handle my IDE controller and then deactivating
>> DMA in the BIOS works, but then disk I/O is unbelievable slow.. do you
>> have any idea how to fix it, so that DMA works?
>
> Does your CF/IDE adapter support DMA ?

Oh well, you're right.. there are still some CF/IDE adapters which do not
support DMA. I'll guess this is the problem then, so I'll return it to the
shop.

Best regards,
Philipp

2007-10-11 13:18:02

by Helge Hafting

[permalink] [raw]
Subject: Re: IDE DMA doesn't work with pata_via and compact flash card

[email protected] wrote:
>> Does your CF/IDE adapter support DMA ?
>>
>
> Thank you for your answer :)
>
> I thought CF/IDE adapters are mainly electrical adapters.. I've never seen
> one which explicitly states the modes it supports. On the other hand it
> says on the package: "Vista compatible" (whatever that means)
>
> Is there some way I can figure it out? I'll have a deeper look on the
> datasheet when I'm home again later, but I'm rather sure there wasn't
> anything mentioning supporting data transfer modes..
>
Some take care to document this. I checked dma capability
before bying mine. mini-itx.com seems to get this right.

Helge Hafting

2007-10-11 22:22:16

by Philipp Wollermann

[permalink] [raw]
Subject: Re: IDE DMA doesn't work with pata_via and compact flash card

Helge Hafting wrote:
> [email protected] wrote:
>>> Does your CF/IDE adapter support DMA ?
>>
>> Is there some way I can figure it out? I'll have a deeper look on the
>> datasheet when I'm home again later, but I'm rather sure there wasn't
>> anything mentioning supporting data transfer modes..
>>
> Some take care to document this. I checked dma capability
> before bying mine. mini-itx.com seems to get this right.

I have returned the adapter card, it indeed didn't support DMA (I
checked the pins on the board, pin 21 and 29 are necessary for DMA
support and they weren't wired). I bought a new one which explicitly
supports DMA and will report when it ships. :)

Best regards,
Philipp