]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
PCI: Log IDE resource quirk in dmesg
authorBjorn Helgaas <bhelgaas@google.com>
Wed, 5 Mar 2014 21:07:03 +0000 (14:07 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 19 Mar 2014 21:00:17 +0000 (15:00 -0600)
Make a note in dmesg when we overwrite legacy IDE BAR info.  We previously
logged something like this:

  pci 0000:00:1f.1: reg 0x10: [io  0x0000-0x0007]

and then silently overwrote the resource.  There's an example in the
bugzilla below.  This doesn't fix the bugzilla; it just makes what's going
on more obvious.

No functional change; merely adds some dev_info() calls.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=48451
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/probe.c

index 78335efbbb742f8bad8b9ecd47d7e3e26b10a504..93dad114eaef4051f333b5b856c924f7b45d1bb0 100644 (file)
@@ -1126,10 +1126,10 @@ int pci_setup_device(struct pci_dev *dev)
                pci_read_config_word(dev, PCI_SUBSYSTEM_ID, &dev->subsystem_device);
 
                /*
-                *      Do the ugly legacy mode stuff here rather than broken chip
-                *      quirk code. Legacy mode ATA controllers have fixed
-                *      addresses. These are not always echoed in BAR0-3, and
-                *      BAR0-3 in a few cases contain junk!
+                * Do the ugly legacy mode stuff here rather than broken chip
+                * quirk code. Legacy mode ATA controllers have fixed
+                * addresses. These are not always echoed in BAR0-3, and
+                * BAR0-3 in a few cases contain junk!
                 */
                if (class == PCI_CLASS_STORAGE_IDE) {
                        u8 progif;
@@ -1140,11 +1140,15 @@ int pci_setup_device(struct pci_dev *dev)
                                res = &dev->resource[0];
                                res->flags = LEGACY_IO_RESOURCE;
                                pcibios_bus_to_resource(dev->bus, res, &region);
+                               dev_info(&dev->dev, "legacy IDE quirk: reg 0x10: %pR\n",
+                                        res);
                                region.start = 0x3F6;
                                region.end = 0x3F6;
                                res = &dev->resource[1];
                                res->flags = LEGACY_IO_RESOURCE;
                                pcibios_bus_to_resource(dev->bus, res, &region);
+                               dev_info(&dev->dev, "legacy IDE quirk: reg 0x14: %pR\n",
+                                        res);
                        }
                        if ((progif & 4) == 0) {
                                region.start = 0x170;
@@ -1152,11 +1156,15 @@ int pci_setup_device(struct pci_dev *dev)
                                res = &dev->resource[2];
                                res->flags = LEGACY_IO_RESOURCE;
                                pcibios_bus_to_resource(dev->bus, res, &region);
+                               dev_info(&dev->dev, "legacy IDE quirk: reg 0x18: %pR\n",
+                                        res);
                                region.start = 0x376;
                                region.end = 0x376;
                                res = &dev->resource[3];
                                res->flags = LEGACY_IO_RESOURCE;
                                pcibios_bus_to_resource(dev->bus, res, &region);
+                               dev_info(&dev->dev, "legacy IDE quirk: reg 0x1c: %pR\n",
+                                        res);
                        }
                }
                break;