[ide] PCI quirk for ICH3-M IDE

From: Jim Paris <jim@jtan.com>

Bartlomiej: I have an ICH3-M controller on my laptop.  The BIOS is
leaving the prog-if as 0x8E (primary = legacy, secondary = native).
When the PCI interrupt is routed (either in the IDE driver's
pci_enable_device, or earlier if pci=routeirq is used), unhandled
interrupts cause IRQ 9 to be disabled, breaking most of my other
hardware.  This seems to be caused by having the nonexistant secondary
interface set to native mode.  According to the datasheet I checked,
having different modes for primary/secondary is not an allowed
combination anyway, so the following PCI quirk checks for this case
and forces both interfaces to legacy if true.

It may make sense to make this more generic (this problem may affect
other PCI IDs as well), or it may be better solved in the IDE driver,
at least when pci=routeirq is not used.  But the following patch does
work well for me.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent ee7b812c
......@@ -699,6 +699,26 @@ static void __init quirk_svwks_csb5ide(struct pci_dev *pdev)
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, quirk_svwks_csb5ide );
/*
* Intel 82801CAM ICH3-M datasheet says IDE modes must be the same
*/
static void __init quirk_ide_samemode(struct pci_dev *pdev)
{
u8 prog;
pci_read_config_byte(pdev, PCI_CLASS_PROG, &prog);
if (((prog & 1) && !(prog & 4)) || ((prog & 4) && !(prog & 1))) {
printk(KERN_INFO "PCI: IDE mode mismatch; forcing legacy mode\n");
prog &= ~5;
pdev->class &= ~5;
pci_write_config_byte(pdev, PCI_CLASS_PROG, prog);
/* need to re-assign BARs for compat mode */
quirk_ide_bases(pdev);
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10, quirk_ide_samemode);
/* This was originally an Alpha specific thing, but it really fits here.
* The i82375 PCI/EISA bridge appears as non-classified. Fix that.
*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment