]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] IDE fixes
authorJens Axboe <axboe@suse.de>
Fri, 20 Sep 2002 03:45:00 +0000 (20:45 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 20 Sep 2002 03:45:00 +0000 (20:45 -0700)
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.

drivers/ide/pci/cy82c693.c
drivers/ide/setup-pci.c

index b63a918413931c8b21d2d1897602d690935ff61f..06b5495a79fd845efc28ccc222de5633e8d650c8 100644 (file)
@@ -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, },
 };
 
index 66a95231b77323e3f7f8eda5bb6a3e01643eae43..61f384ebf281cda7b834eca6d64ca731541b8815 100644 (file)
@@ -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,10 +422,8 @@ 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);
                ide_pci_check_iomem(dev, d, 2*port+1);