DragonFly bugs List (threaded) for 2009-06
DragonFly BSD
DragonFly bugs List (threaded) for 2009-06
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: ahci: attachment to atapi device


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Jun 2009 08:19:59 -0700 (PDT)

    Ok guys, also try this patch and see if it prints out 
    that BIOS disabled line on the console.  In addition to the
    other patch.

    And after that, maybe try uncommenting the pci_write_config
    for 0x92...  but not after testing the patch as-is.

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>

diff --git a/sys/dev/disk/ahci/ahci_attach.c b/sys/dev/disk/ahci/ahci_attach.c
index 68f4059..67551aa 100644
--- a/sys/dev/disk/ahci/ahci_attach.c
+++ b/sys/dev/disk/ahci/ahci_attach.c
@@ -159,6 +159,15 @@ ahci_pci_attach(device_t dev)
 	int error;
 	const char *revision;
 
+/*
+	pci_write_config(dev, 0x92, pci_read_config(dev, 0x92, 2) | 0x0F, 2);
+*/
+	if (pci_read_config(dev, PCIR_COMMAND, 2) & 0x0400) {
+		device_printf(dev, "BIOS disabled PCI interrupt, re-enabling\n");
+		pci_write_config(dev, PCIR_COMMAND,
+			pci_read_config(dev, PCIR_COMMAND, 2) & ~0x0400, 2);
+	}
+
 	/*
 	 * Map the AHCI controller's IRQ and BAR(5) (hardware registers)
 	 */



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]