Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
libata on ia64 ICH4
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures
View previous topic :: View next topic  
Author Message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9849
Location: almost Mile High in the USA

PostPosted: Tue Jul 19, 2011 11:32 pm    Post subject: libata on ia64 ICH4 Reply with quote

I recall from a year or so ago that the libata driver does NOT work on the ICH4 on ia64 machines. The SR870BH2 and SR870BN4 (and their whitebox equivalents) use the ICH4 for their CDROM drives instead of using SCSI. Anyone ever got the libata driver working on the ICH4?

(Saw someone on irc have this issue on a SR870BN4, and I recall running into this issue a while ago trying libata. Workaround was to use the legacy driver.)

EDIT: ICH4 is the IDE bridge!
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?


Last edited by eccerr0r on Thu Jul 21, 2011 8:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
RussianE39
n00b
n00b


Joined: 20 Jul 2011
Posts: 2
Location: Russia

PostPosted: Wed Jul 20, 2011 10:04 am    Post subject: Reply with quote

I think this is somehow related:
http://www.spinics.net/lists/linux-ia64/msg07855.html
Also, eccerror, can you tell magic cmdline for kernel to use legacy piix4 driver ?
I've got same problem on SR870BN4 (aka Dell PowerEdge 7250 aka many other servers from different retailers):
ata_piix 0000:00:1f.1: version 2.13
ata_piix 0000:00:1f.1: device not available (can't reserve [mem 0x00000000-0x000003ff])
ata_piix: probe of 0000:00:1f.1 failed with error -22
The current workaround is to use external SCSI cdrom to boot livecd.
_________________
With best regards from Russia, Mike
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9849
Location: almost Mile High in the USA

PostPosted: Thu Jul 21, 2011 7:09 am    Post subject: Reply with quote

It autodetected fine on my SR870BH2/Dell PowerEdge 3250. I'm using 2.6.31-gentoo-r7 with legacy ATA built-in.

Is there regression for the legacy ICH4 driver too, not only libata not working? I guess I'll have to compile and see...

The legacy ICH4 driver displays this information:
Code:
Uniform Multi-Platform E-IDE driver
piix 0000:00:1f.1: IDE controller (0x8086:0x24cb rev 0x02)
pci 0000:00:1f.1: device not available because of BAR 5 [0x000000-0x0003ff] collisions
pci 0000:00:1f.1: can't derive routing for PCI INT A
piix 0000:00:1f.1: BIOS configuration fixed
piix 0000:00:1f.1: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0x1000-0x1007
    ide1: BM-DMA at 0x1008-0x100f
Probing IDE interface ide0...
hda: TEAC CD-ROM CD-224E, ATAPI CD/DVD-ROM drive
hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hda: UDMA/33 mode selected
Probing IDE interface ide1...
ide0 at 0x1f0-0x1f7,0x3f6 on irq 34
ide1 at 0x170-0x177,0x376 on irq 33
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9849
Location: almost Mile High in the USA

PostPosted: Tue Aug 07, 2012 6:40 am    Post subject: Reply with quote

OK, The root of the problem is that apparently the ICH4 PCI resource database has a bogus entry which requires a MMIO location at 0x0-0x3ff, at least on my machine. I don't know about all of these machines but for now I came up with a workaround patch:

Code:
--- linux-3.3.8-gentoo-orig/drivers/pci/setup-res.c    2012-03-18 17:15:34.000000000 -0600
+++ linux-3.3.8-gentoo/drivers/pci/setup-res.c  2012-08-07 00:34:58.000000000 -0600
@@ -350,6 +350,10 @@
     if (!r->parent) {
        dev_err(&dev->dev, "device not available "
          "(can't reserve %pR)\n", r);
+if (dev->vendor == PCI_VENDOR_ID_INTEL && ((dev->device & 0xfff0)==PCI_DEVICE_ID_INTEL_82801DB_0 ) && r->start == 0 && (r->flags & IORESOURCE_MEM) ) {
+
+dev_info(&dev->dev, "ia64 ICH4 workaround enabled");
+} else
        return -EINVAL;
     }


WARNING: This is NOT kosher code. This does NOT meet the requirements for clean code. This is purely a HACK. DO NOT APPLY THIS TO NON-IA64 kernels, this likely will cause issues.

With this patch I was able to see my built-in CDROM drive on my Dell Poweredge 3250 (SR870BH2).

Code:
ata_piix 0000:00:1f.1: version 2.13
ata_piix 0000:00:1f.1: device not available (can't reserve [mem 0x00000000-0x000003ff])
ata_piix 0000:00:1f.1: ia64 ICH4 workaround enabled
ata_piix 0000:00:1f.1: enabling device (0005 -> 0007)
ata_piix 0000:00:1f.1: can't derive routing for PCI INT A
scsi2 : ata_piix
scsi3 : ata_piix
ata1: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0x1000 irq 34
ata2: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0x1008 irq 33
ata1.00: ATAPI: TEAC CD-ROM CD-224E, K.9A, max UDMA/33
ata1.00: configured for UDMA/33
scsi 2:0:0:0: CD-ROM            TEAC     CD-224E          K.9A PQ: 0 ANSI: 5
sr0: scsi3-mmc drive: 24x/24x cd/rw xa/form2 cdda tray
cdrom: Uniform CD-ROM driver Revision: 3.20
sr 2:0:0:0: Attached scsi CD-ROM sr0
sr 2:0:0:0: Attached scsi generic sg3 type 5


Again this is NOT clean code, NOT fully tested but it seems to work on my box. Hacking this into setup-res.c is POOR STYLE but it was the easiest way for me to add the workaround. Since this is a hack, if it breaks something, you get to keep all the pieces. No warranty expressed or implied.

Note that the legacy IDE driver does indeed work on 3.3.8, and the cdrom shows up as /dev/hda. A "legacy free"kernel will not allow these machines to boot off their internal cdrom as the old driver was meant to be removed with the advent of the more thorough libata stack.

Even if this doesn't get accepted anywhere, I like my patch to use libata, udev figures it out and my cdrom is /dev/sr0.

Note that udev-171 does not run with 2.6.31 hence the need for me to hack up this patch...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9849
Location: almost Mile High in the USA

PostPosted: Thu Aug 08, 2013 2:28 pm    Post subject: Reply with quote

Okay, tested with Linux 3.10.5, this patch still works and I can use my built-in cdrom drive with the libata driver. Seems to work fine with udev-200+ with devtmpfs enabled.

Apparently the legacy IDE controller still works in 3.10.5, so that is still an option.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on Alternative Architectures All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum