Commit f3533a9f authored by Jens Axboe's avatar Jens Axboe Committed by Linus Torvalds

[PATCH] IDE fixes

starting from 2.5.35 IDE stopped working on my alphas because of
following problems:

- ide_hwif_configure() ignores BARs for IDE base/control registers
  and assumes legacy 0x1f0/0x170 ports, unless controller reports
  native PCI mode (ProgIf bits 0 and 2).

  This is incorrect, as there are quite a few IDE chips operating
  in "semi-legacy" mode, i.e. legacy interrupts, but functional
  BAR0-3, like cy82c693 and ali5229. I guess Andre could give a lot
  more examples. :-)

  This happens to work on i386 simply because BIOS usually assigns
  legacy values to BAR0-3, but we can't rely on it.

  Just checking respective resource->start for zero should work in
  all cases.

- ide_pci_check_iomem(): resource->flags == 0 means "unconfigured" as well.
  Thus we avoid false positives.

- Apparently cut'n'paste typo in cy82c693.c - wrong PCI IDs.
parent d026dd46
......@@ -429,7 +429,7 @@ static int __devinit cy82c693_init_one(struct pci_dev *dev, const struct pci_dev
}
static struct pci_device_id cy82c693_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ 0, },
};
......
......@@ -389,7 +389,7 @@ static int ide_pci_check_iomem(struct pci_dev *dev, ide_pci_device_t *d, int bar
ulong flags = pci_resource_flags(dev, bar);
/* Unconfigured ? */
if(pci_resource_len(dev, bar) == 0)
if (!flags || pci_resource_len(dev, bar) == 0)
return 0;
/* I/O space */
......@@ -422,9 +422,7 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d,
unsigned long ctl = 0, base = 0;
ide_hwif_t *hwif;
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE ||
((dev->class & ~(0xfa))) ||
(dev->class & (port ? 4 : 1)) != 0)
if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE)
{
/* Possibly we should fail if these checks report true */
ide_pci_check_iomem(dev, d, 2*port);
......
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