Skip to contentSkip to conversation

hang booting onboard HPT 366 with libata (PATA)

DISCUSSION Ricardo Lugo 2 participants 5 messages Dec 2, 2006

lore
Share & tools
lore
#0 lore raw

Hi all,

With the release of libata PATA support in 2.6.19, I am trying out libata with my HPT366 (built-on to motherboard), and it hangs at bootup while scanning for partitions. Additionally, it complains of abnormal status? Related information about my setup below:

- Abit BP6 motherboard running BIOS RV with HPT 1.28 (ie has functional ACPI DSDT table), has been recapped, not overclocked
- onboard HPT366 controller functions fine with the old IDE drivers (but only so long as I use UDMA mode <=3, mode 4 has reported problems on BP6)
- hard drive is an 80GB seagate 7200.1-ish that supports UDMA mode 5, partition scheme is (1-xfs, 2-swap)
- this hard drive is the only drive connected, but the kernel discovers one empty pata_piix controller and one empty pata_hpt366 controller before it.

Related boot messages:

---

ACPI: PCI Interrup 0000:00:13.1[B] -> GSI 18 (level, low) -> IRQ 16
ata5: PATA max UDMA/66 cmd 0xE400 ctl 0xE802 bmdma 0xEC00 irq 16
ata6: PATA max UDMA/66 cmd 0x0 ctl 0x2 bmdma 0xEC08 irq 16 scsi4 : pata_hpt366
ata5.00: ATA-6, max UDMA/100, 156301488 sectors: LBA48 ata5.00: ata5: dev 0 multi count 16
ata5.00 configured for UDMA/33
scsi5 : pata_hpt366
ATA: abnormal status 0x1C on port 0x7
scsi 4:0:0:0: Direct-Access ATA ST380011A 3.06 PQ: 0 ANSI: 5
SCSI device sda: 156301488 512-byte hdwr sectors (80026 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
SCSI device sda: 156301488 512-byte hdwr sectors (80026 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
sda:_

---

If there is anything I can test to help fix this issue or further diagnose it, please let me know.

- Ricardo

#1 lore raw
Quoted 3 lines

ACPI: PCI Interrup 0000:00:13.1[B] -> GSI 18 (level, low) -> IRQ 16
ata5: PATA max UDMA/66 cmd 0xE400 ctl 0xE802 bmdma 0xEC00 irq 16
ata6: PATA max UDMA/66 cmd 0x0 ctl 0x2 bmdma 0xEC08 irq 16

Ok so the underlying problem seems to be that the second channel of the card had no I/O resource assigned to it, presumably because it wasn't in use. We check various other "not in use" things but not that one.

I'll fix that up. I think it just needs another check in libata-sff.

Alan

#2 lore raw
Quoted 9 lines · On Sat, 2 Dec 2006 11:19:28 +0000 Alan <[email protected]> wrote:
Quoted 3 lines

ACPI: PCI Interrup 0000:00:13.1[B] -> GSI 18 (level, low) -> IRQ 16
ata5: PATA max UDMA/66 cmd 0xE400 ctl 0xE802 bmdma 0xEC00 irq 16
ata6: PATA max UDMA/66 cmd 0x0 ctl 0x2 bmdma 0xEC08 irq 16

Ok so the underlying problem seems to be that the second channel of the card had no I/O resource assigned to it, presumably because it wasn't in use. We check various other "not in use" things but not that one.

I'll fix that up. I think it just needs another check in libata-sff.

Try the following

ata/libata-sff.c renamed from ata/libata-sff.c~ +22 -0
@@ -826,6 +826,21 @@
 }
 
 #ifdef CONFIG_PCI
+
+static int ata_resources_present(struct pci_dev *pdev, int port)
+{
+	int i;
+	
+	/* Check the PCI resources for this channel are enabled */
+	port = port * 2;
+	for (i = 0; i < 2; i ++) {
+		if (pci_resource_start(pdev, port + i) == 0 ||
+			pci_resource_len(pdev, port + i) == 0)
+		return 0;
+	}
+	return 1;
+}
+		
 /**
  *	ata_pci_init_native_mode - Initialize native-mode driver
  *	@pdev:  pci device to be initialized
@@ -857,6 +872,13 @@
 
 	probe_ent->irq = pdev->irq;
 	probe_ent->irq_flags = IRQF_SHARED;
+	
+	/* Discard disabled ports. Some controllers show their
+	   unused channels this way */
+	if (ata_resources_present(pdev, 0) == 0)
+		ports &= ~ATA_PORT_PRIMARY;
+	if (ata_resources_present(pdev, 1) == 0)
+		ports &= ~ATA_PORT_SECONDARY;
 
 	if (ports & ATA_PORT_PRIMARY) {
 		probe_ent->port[p].cmd_addr = pci_resource_start(pdev, 0);
#3 lore raw
Quoted 7 lines · Alan
Quoted 4 lines · On Sat, 2 Dec 2006 11:19:28 +0000 Alan <[email protected]> wrote:
Quoted 3 lines

ACPI: PCI Interrup 0000:00:13.1[B] -> GSI 18 (level, low) -> IRQ 16
ata5: PATA max UDMA/66 cmd 0xE400 ctl 0xE802 bmdma 0xEC00 irq 16
ata6: PATA max UDMA/66 cmd 0x0 ctl 0x2 bmdma 0xEC08 irq 16

Quoted 7 lines
Quoted 5 lines

Ok so the underlying problem seems to be that the second channel of the card had no I/O resource assigned to it, presumably because it wasn't in use. We check various other "not in use" things but not that one.

I'll fix that up. I think it just needs another check in libata-sff.

Try the following

That certainly sped up the bootup process, but still hangs at the same place. Interestingly, if I append "nosmp" to kernel params, it hangs earlier and I get a different error. Specifics below:

ACPI: PCI Interrupt 0000:00:13.0[A] -> GSI 18 (level, low) -> IRQ 16
ata3: PATA max UDMA/66 cmd 0xD800 ctl 0xDC02 bmdma 0xE000 irq 16
scsi2: pata_hpt366
ATA: abnormal status 0x8 on port 0xD807
ACPI: PCI Interrupt 0000:00:13.1[B] -> GSI 18 (level, low) -> IRQ 16
ata4: PATA max UDMA/66 cmd 0xE400 ctl 0xE802 bmdma 0xEC00 irq 16
scsi3: pata_hpt366
ata4.00: ATA-6, max UDMA/100, 156301488 sectors: LBA48 ata4.00: configured for UDMA/33
scsi 3:0:0:0: Direct-Access ATA ST380011A 3.06 PQ: 0 ANSI: 5
SCSI device sda: 156301488 512-byte hdrwr sectors (80026 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
SCSI device sda: 156301488 512-byte hdrwr sectors (80026 MB)
sda: Write Protect is off
SCSI device sda: drive cache: write back
sda:_

--- nosmp ---
...
ACPI: PCI Interrupt 0000:00:13.1[B] -> GSI 18 (level, low) -> IRQ 16
ata4: PATA max UDMA/66 cmd 0xE400 ctl 0xE802 bmdma 0xEC00 irq 16
scsi3: pata_hpt366
ata4.00: qc timeout (cmd 0xec)
ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)

- Rick

#4 lore raw
Quoted 5 lines

ACPI: PCI Interrupt 0000:00:13.1[B] -> GSI 18 (level, low) -> IRQ 16
ata4: PATA max UDMA/66 cmd 0xE400 ctl 0xE802 bmdma 0xEC00 irq 16
scsi3: pata_hpt366
ata4.00: qc timeout (cmd 0xec)
ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)

Ok that wil need more work. I think that you are experiencing two independant bugs here and the patch fixed only the first.

Alan