From 5548f2b27f758a972fcfc61cc5cf19399e017600 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 3 Sep 2009 12:37:45 +0000 Subject: [PATCH] Patch by Marcus Overhagen, - check if we need to enable interrupts, - always trace old/new cmd. -alphabranch for now, needs testing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32921 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/generic/ata_adapter/ata_adapter.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/generic/ata_adapter/ata_adapter.c b/src/add-ons/kernel/generic/ata_adapter/ata_adapter.c index cd92dc43cf..bd310aa988 100644 --- a/src/add-ons/kernel/generic/ata_adapter/ata_adapter.c +++ b/src/add-ons/kernel/generic/ata_adapter/ata_adapter.c @@ -525,6 +525,10 @@ ata_adapter_detect_channel(pci_device_module_info *pci, pci_device *pci_device, // this should be done in ata_adapter_init_controller but there is crashes pcicmdOld = pcicmdNew = pci->read_pci_config(pci_device, PCI_command, 2); + if ((pcicmdNew & (1 << 10)) != 0) { + TRACE("PCI-ATA: enabling interrupts\n"); + pcicmdNew &= ~(1 << 10); + } if ((pcicmdNew & PCI_command_io) == 0) { TRACE("PCI-ATA: enabling io decoder\n"); pcicmdNew |= PCI_command_io; @@ -535,9 +539,9 @@ ata_adapter_detect_channel(pci_device_module_info *pci, pci_device *pci_device, } if (pcicmdOld != pcicmdNew) { pci->write_pci_config(pci_device, PCI_command, 2, pcicmdNew); - TRACE("PCI-ATA: pcicmd old 0x%04x, new 0x%04x\n", - pcicmdOld, pcicmdNew); } + TRACE("PCI-ATA: pcicmd old 0x%04x, new 0x%04x\n", + pcicmdOld, pcicmdNew); if (supports_compatibility_mode) {