Skip to contentSkip to conversation

ata_piix on ich6r in RAID mode

RFC PATCH In review Martins Krikis 2 participants 3 messages Jan 28, 2005 – Jan 29, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 ata_piix on ich6r in RAID mode

Jeff,

You might have come across this hack before, but I figured I should remind you that it is still very useful for ata_piix...

Without this patch, if the BIOS of an ICH6R box has IDE set to "RAID" mode then ata_piix will not find any SATA disks because it incorrectly tries the legacy mode. With the patch all 4 SATA drives become visible. I don't think it would break any other vendor's SATA, but you can be the judge of that. If so, perhaps we can restrict the test some more by checking vendor/device IDs.

Martins Krikis
Storage Components Division
Intel Massachusetts

drivers/scsi/libata-core.c +3 -0
@@ -3605,6 +3605,9 @@ int ata_pci_init_one (struct pci_dev *pd
 			legacy_mode = (1 << 3);
 	}
 
+	if ((pdev->class >> 8) == PCI_CLASS_STORAGE_RAID)
+		legacy_mode = 0;
+
 	/* FIXME... */
 	if ((!legacy_mode) && (n_ports > 1)) {
 		printk(KERN_ERR "ata: BUG: native mode, n_ports > 1\n");
#1 lore raw
Quoted 10 lines · Martins Krikis

Without this patch, if the BIOS of an ICH6R box has IDE set to "RAID" mode then ata_piix will not find any SATA disks because it incorrectly tries the legacy mode. With the patch all 4 SATA drives become visible. I don't think it would break any other vendor's SATA, but you can be the judge of that. If so, perhaps we can restrict the test some more by checking vendor/device IDs.

drivers/scsi/libata-core.c int ata_pci_init_one (struct pci_dev *pd · line 3613

Quoted 9 lines
drivers/scsi/libata-core.c +3 -0
@@ -3605,6 +3605,9 @@ int ata_pci_init_one (struct pci_dev *pd
 			legacy_mode = (1 << 3);
 	}
 
+	if ((pdev->class >> 8) == PCI_CLASS_STORAGE_RAID)
+		legacy_mode = 0;
+
 	/* FIXME... */
 	if ((!legacy_mode) && (n_ports > 1)) {
 		printk(KERN_ERR "ata: BUG: native mode, n_ports > 1\n");

hmmmmmm. Maybe "!= PCI_CLASS_STORAGE_IDE" instead?

Overall, however, I am worried about your report of the driver's behavior based on that BIOS's configuration. The driver follows the PCI IDE standard (previously SFF 8038i), where a register indicates whether its in legacy or native mode. As it see it, either
a) the driver logic for reading that register is wrong, or
b) BIOS incorrectly configuring the device, or
c) that register is only applicable for PCI_CLASS_STORAGE_IDE devices.

Comments either way?

Jeff

#2 lore raw
Quoted 21 lines · --- Jeff Garzik
Quoted 1 line · Martins Krikis

Without this patch, if the BIOS of an ICH6R box has IDE set to

"RAID"

Quoted 1 line

mode then ata_piix will not find any SATA disks because it

incorrectly

Quoted 1 line

tries the legacy mode. With the patch all 4 SATA drives become

visible.

Quoted 1 line

I don't think it would break any other vendor's SATA, but you can

be

Quoted 1 line

the judge of that. If so, perhaps we can restrict the test some

more

Quoted 3 lines

by checking vendor/device IDs.

--- linux-2.4.29/drivers/scsi/libata-core.c 2005-01-28

12:07:56.000000000 -0500

Quoted 1 line

+++ linux-2.4.29-iswraid/drivers/scsi/libata-core.c 2005-01-28

12:14:43.000000000 -0500

Quoted 4 lines
drivers/scsi/libata-core.c +0 -0
@@ -3605,6 +3605,9 @@ int ata_pci_init_one (struct pci_dev *pd
 			legacy_mode = (1 << 3);
 	}
 
Quoted 9 lines

drivers/scsi/libata-core.c int ata_pci_init_one (struct pci_dev *pd · line 3613

Quoted 6 lines
drivers/scsi/libata-core.c +3 -0
+	if ((pdev->class >> 8) == PCI_CLASS_STORAGE_RAID)
+		legacy_mode = 0;
+
 	/* FIXME... */
 	if ((!legacy_mode) && (n_ports > 1)) {
 		printk(KERN_ERR "ata: BUG: native mode, n_ports > 1\n");

hmmmmmm. Maybe "!= PCI_CLASS_STORAGE_IDE" instead?

Yes, that's much better. No need to even read the programming IF byte unless the class code identifies it as an IDE controller.

Quoted 11 lines

Overall, however, I am worried about your report of the driver's behavior based on that BIOS's configuration. The driver follows the PCI
IDE standard (previously SFF 8038i), where a register indicates whether
its in legacy or native mode. As it see it, either
a) the driver logic for reading that register is wrong, or
b) BIOS incorrectly configuring the device, or
c) that register is only applicable for PCI_CLASS_STORAGE_IDE devices.

Quoted 1 line

Comments either way?

I'd say "c". I don't have the spec, but my PCI course-book seems to imply so. I could send a new patch but I can't verify it just yet---the board decided to stop booting...

Martins

__________________________________
Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250