# [SOLVEDISH] VIA VT6421 PATA issues

## aitch

--edit--

issues were fixed by patching the kernel with the link in my last post, although I'm not sure whether or not I need to repatch any kernel updates that happen. maybe? not sure, fixed for now at least.

I'm trying to get my little brother's computer set up with Gentoo, but I'm running into some issues I don't quite know how to deal with. 

the one that's giving me the most grief is his VIA VT6421 SATA/PATA PCI card. it has two SATA ports and one PATA port and I can't for the life of me get the PATA going.

I have VIA_SATA and VIA_PATA enabled in kernel, along with everything else I could think of pertaining to the hardware, but it just wont recognise the two PATA drives plugged into it .

dmesg | grep via shows this on startup:

```
Millenia linux # dmesg | grep via

sata_via 0000:01:02.0: version 2.0

sata_via 0000:01:02.0: routed to hard irq line 5

scsi0 : sata_via

scsi1 : sata_via

```

so the  SATA ports are being recognised, but not the PATA. testing an Ubuntu LiveCD they detected fine, but I couldn't see any difference in modules loaded, in fact they weren't even using the VIA_PATA driver and it was still working fine.

I can post anything needed, kernel configurations or whatever, I'm just running out of ideas on how to get it going.

any ideas would be appreciated, running kernel 2.6.19-r5.Last edited by aitch on Tue Feb 20, 2007 12:37 am; edited 1 time in total

----------

## wynn

The best thing to do is to disable pata_via (< >   VIA PATA support) and enable the old PATA (< >         VIA82CXXX chipset support). Remember to enable the high level "ATA/ATAPI/MFM/RLL support"

```
<*> ATA/ATAPI/MFM/RLL support

<*>   Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support

<*>     Include IDE/ATA-2 DISK support

[*]     Use multi-mode by default

<*>     Include IDE/ATAPI CDROM support

<*>     generic/default IDE chipset support

[*]     PCI IDE chipset support

[*]       Generic PCI bus-master DMA support

[*]         Use PCI DMA by default when available
```

pata_via works on one machine here (AMD64) but not on another (AMD64).

----------

## aitch

I disabled VIA_PATA and enabled that older VIA driver, along with the other ATA/ATAPI... stuff, but on boot it gives me the same dmesg output, without recognising the hard drives still.

any other suggestions?

----------

## wynn

I've just had a more careful look at your original post and saw VT6421 while I was talking about VT8237 here.

I've checked 2.6.19-gentoo-r5, 2.6.20 and 2.6.20-git14 and in none of them do the VIA PATA drivers (drivers/ide/pci/via82cxxx.c and drivers/ata/pata_via.c) support the VT6421, it's only supported in sata_via.c.

Sorry I didn't check more carefully before posting   :Sad:   â is there a IDE chipset on the motherboard you can use?

----------

## aitch

no, the stupid thing is that he's got a shiny new AM2 motherboard, and they only see fit to include one IDE channel. 

there are four SATA ports, which would be great, I'm sure, if he had any drives that were SATA.

the weird thing with this is that is works under Ubuntu. I can't see how it could be any different, since the only modules they seem to be using are libata and via_sata.

I also found a patch for PATA with that via_sata module, but I have no idea how to apply it.. http://lkml.org/lkml/2006/12/4/126

any ideas would be greatly appreciated.

----------

## wynn

I thought later on of googling for a patch but too late   :Smile: 

Copy the email: you can include the email text if you like, patch has been trained to skip it â at any rate copy from

```
diff -uprN a/drivers/ata/Kconfig b/drivers/ata/Kconfig
```

to the end, make sure the last line

```
   u8 tmp8;
```

has a newline at the end of it otherwise patch will complain that "patch unexpectedly ends in middle of line".

To apply the patch, assuming it is in /tmp/vt6421.patch

```
cd /usr/src/linux-2.6.19-gentoo-r5

patch -p1 < /tmp/vt6421.patch
```

and you should see

```
patching file drivers/ata/Kconfig

patching file drivers/ata/sata_via.c
```

This patch adds a new option to "Serial ATA (prod) ..."

```
   <*>   VIA SATA support

    [ ]     VIA VT6421 PATA support (HIGHLY EXPERIMENTAL) (NEW)
```

select it with "y".

The patch adds the VT6421 PATA support to sata_via.c, so your existing .config should not need changing. You can remove the old PATA (< > VIA82CXXX chipset support) and pata_via (< > VIA PATA support) if you like.

I hope it works for you.

----------

## mfyahya

aitch,

I have the same problem so I upgraded my kernel to 2.6.19-gentoo-r5 and applied that patch, but I still can't access my drive. 

I have my NEC CD drive attached to the pata port on the card, and it shows up in dmesg along with some abnormal status messages:

```

...

ACPI: PCI Interrupt 0000:01:09.0[A] -> Link [LNK2] -> GSI 11 (level, low) -> IRQ 11

sata_via 0000:01:09.0: routed to hard irq line 11

ata1: PATA max UDMA/133 cmd 0xA400 ctl 0xA40A bmdma 0xB400 irq 11

ata2: PATA max UDMA/133 cmd 0xA800 ctl 0xA80A bmdma 0xB408 irq 11

ata3: PATA max UDMA/133 cmd 0xAC00 ctl 0xAC0A bmdma 0xB410 irq 11

scsi0 : sata_via

ATA: abnormal status 0x7F on port 0xA407

scsi1 : sata_via

ATA: abnormal status 0x7F on port 0xA807

scsi2 : sata_via

ata3.00: ATAPI, max UDMA/33

ata3.00: configured for UDMA/33

scsi 2:0:0:0: CD-ROM            _NEC     DVD_RW ND-3500AG 2.16 PQ: 0 ANSI: 5

scsi 2:0:0:0: Attached scsi generic sg0 type 5

usbmon: debugfs is not available

...

```

I can't/don't know how to access the CD drive. Any idea what could be wrong?

----------

