[PATCH] dm-crypt: zero key before freeing it
[powerpc.git] / drivers / pci / quirks.c
index 5627ce1..f28ebdd 100644 (file)
@@ -462,11 +462,11 @@ static void __devinit quirk_vt82c686_acpi(struct pci_dev *dev)
 
        pci_read_config_word(dev, 0x70, &hm);
        hm &= PCI_BASE_ADDRESS_IO_MASK;
-       quirk_io_region(dev, hm, 128, PCI_BRIDGE_RESOURCES + 1, "vt82c868 HW-mon");
+       quirk_io_region(dev, hm, 128, PCI_BRIDGE_RESOURCES + 1, "vt82c686 HW-mon");
 
        pci_read_config_dword(dev, 0x90, &smb);
        smb &= PCI_BASE_ADDRESS_IO_MASK;
-       quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 2, "vt82c868 SMB");
+       quirk_io_region(dev, smb, 16, PCI_BRIDGE_RESOURCES + 2, "vt82c686 SMB");
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA,    PCI_DEVICE_ID_VIA_82C686_4,     quirk_vt82c686_acpi );
 
@@ -1098,6 +1098,23 @@ static void __init quirk_alder_ioapic(struct pci_dev *pdev)
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL,  PCI_DEVICE_ID_INTEL_EESSC,      quirk_alder_ioapic );
 #endif
 
+enum ide_combined_type { COMBINED = 0, IDE = 1, LIBATA = 2 };
+/* Defaults to combined */
+static enum ide_combined_type combined_mode;
+
+static int __init combined_setup(char *str)
+{
+       if (!strncmp(str, "ide", 3))
+               combined_mode = IDE;
+       else if (!strncmp(str, "libata", 6))
+               combined_mode = LIBATA;
+       else /* "combined" or anything else defaults to old behavior */
+               combined_mode = COMBINED;
+
+       return 1;
+}
+__setup("combined_mode=", combined_setup);
+
 #ifdef CONFIG_SCSI_SATA_INTEL_COMBINED
 static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev)
 {
@@ -1164,6 +1181,19 @@ static void __devinit quirk_intel_ide_combined(struct pci_dev *pdev)
        if (prog & comb)
                return;
 
+       /* Don't reserve any so the IDE driver can get them (but only if
+        * combined_mode=ide).
+        */
+       if (combined_mode == IDE)
+               return;
+
+       /* Grab them both for libata if combined_mode=libata. */
+       if (combined_mode == LIBATA) {
+               request_region(0x1f0, 8, "libata");     /* port 0 */
+               request_region(0x170, 8, "libata");     /* port 1 */
+               return;
+       }
+
        /* SATA port is in legacy mode.  Reserve port so that
         * IDE driver does not attempt to use it.  If request_region
         * fails, it will be obvious at boot time, so we don't bother
@@ -1243,6 +1273,21 @@ static void __devinit quirk_netmos(struct pci_dev *dev)
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos);
 
+
+static void __devinit fixup_rev1_53c810(struct pci_dev* dev)
+{
+       /* rev 1 ncr53c810 chips don't set the class at all which means
+        * they don't get their resources remapped. Fix that here.
+        */
+
+       if (dev->class == PCI_CLASS_NOT_DEFINED) {
+               printk(KERN_INFO "NCR 53c810 rev 1 detected, setting PCI class.\n");
+               dev->class = PCI_CLASS_STORAGE_SCSI;
+       }
+}
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C810, fixup_rev1_53c810);
+
+
 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, struct pci_fixup *end)
 {
        while (f < end) {