Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy...
[pandora-kernel.git] / drivers / ide / ide-acpi.c
index 6bff81a..899d565 100644 (file)
@@ -16,6 +16,7 @@
 #include <acpi/acpi.h>
 #include <linux/ide.h>
 #include <linux/pci.h>
+#include <linux/dmi.h>
 
 #include <acpi/acpi_bus.h>
 #include <acpi/acnames.h>
@@ -65,6 +66,39 @@ extern int ide_noacpi;
 extern int ide_noacpitfs;
 extern int ide_noacpionboot;
 
+static bool ide_noacpi_psx;
+static int no_acpi_psx(const struct dmi_system_id *id)
+{
+       ide_noacpi_psx = true;
+       printk(KERN_NOTICE"%s detected - disable ACPI _PSx.\n", id->ident);
+       return 0;
+}
+
+static const struct dmi_system_id ide_acpi_dmi_table[] = {
+       /* Bug 9673. */
+       /* We should check if this is because ACPI NVS isn't save/restored. */
+       {
+               .callback = no_acpi_psx,
+               .ident    = "HP nx9005",
+               .matches  = {
+                       DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies Ltd."),
+                       DMI_MATCH(DMI_BIOS_VERSION, "KAM1.60")
+               },
+       },
+
+       { }     /* terminate list */
+};
+
+static int ide_acpi_blacklist(void)
+{
+       static int done;
+       if (done)
+               return 0;
+       done = 1;
+       dmi_check_system(ide_acpi_dmi_table);
+       return 0;
+}
+
 /**
  * ide_get_dev_handle - finds acpi_handle and PCI device.function
  * @dev: device to locate
@@ -350,7 +384,7 @@ static int taskfile_load_raw(ide_drive_t *drive,
 
        memset(&args, 0, sizeof(ide_task_t));
        args.command_type = IDE_DRIVE_TASK_NO_DATA;
-       args.data_phase   = TASKFILE_IN;
+       args.data_phase   = TASKFILE_NO_DATA;
        args.handler      = &task_no_data_intr;
 
        /* convert gtf to IDE Taskfile */
@@ -623,7 +657,7 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on)
 {
        int unit;
 
-       if (ide_noacpi)
+       if (ide_noacpi || ide_noacpi_psx)
                return;
 
        DEBPRINT("ENTER:\n");
@@ -649,7 +683,6 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on)
        if (!on)
                acpi_bus_set_power(hwif->acpidata->obj_handle, ACPI_STATE_D3);
 }
-EXPORT_SYMBOL_GPL(ide_acpi_set_state);
 
 /**
  * ide_acpi_init - initialize the ACPI link for an IDE interface
@@ -669,6 +702,8 @@ void ide_acpi_init(ide_hwif_t *hwif)
        struct ide_acpi_drive_link      *master;
        struct ide_acpi_drive_link      *slave;
 
+       ide_acpi_blacklist();
+
        hwif->acpidata = kzalloc(sizeof(struct ide_acpi_hwif_link), GFP_KERNEL);
        if (!hwif->acpidata)
                return;