]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/ide/ide.c
ide: remove "idex=dma" kernel parameter
[karo-tx-linux.git] / drivers / ide / ide.c
index 5e88a060df06da4c22f7e399a35ee60e9ccae5a0..02336595144a65a1af9cffaf166af151f7cd8fe0 100644 (file)
@@ -100,8 +100,6 @@ static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */
 
 int noautodma = 0;
 
-EXPORT_SYMBOL(noautodma);
-
 #ifdef CONFIG_BLK_DEV_IDEACPI
 int ide_noacpi = 0;
 int ide_noacpitfs = 1;
@@ -396,8 +394,9 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
        hwif->cds                       = tmp_hwif->cds;
 #endif
 
-       hwif->tuneproc                  = tmp_hwif->tuneproc;
-       hwif->speedproc                 = tmp_hwif->speedproc;
+       hwif->set_pio_mode              = tmp_hwif->set_pio_mode;
+       hwif->set_dma_mode              = tmp_hwif->set_dma_mode;
+       hwif->mdma_filter               = tmp_hwif->mdma_filter;
        hwif->udma_filter               = tmp_hwif->udma_filter;
        hwif->selectproc                = tmp_hwif->selectproc;
        hwif->reset_poll                = tmp_hwif->reset_poll;
@@ -417,7 +416,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t *tmp_hwif)
        hwif->dma_exec_cmd              = tmp_hwif->dma_exec_cmd;
        hwif->dma_start                 = tmp_hwif->dma_start;
        hwif->ide_dma_end               = tmp_hwif->ide_dma_end;
-       hwif->ide_dma_check             = tmp_hwif->ide_dma_check;
        hwif->ide_dma_on                = tmp_hwif->ide_dma_on;
        hwif->dma_off_quietly           = tmp_hwif->dma_off_quietly;
        hwif->ide_dma_test_irq          = tmp_hwif->ide_dma_test_irq;
@@ -822,7 +820,7 @@ int set_using_dma(ide_drive_t *drive, int arg)
        if (!drive->id || !(drive->id->capability & 1))
                goto out;
 
-       if (hwif->ide_dma_check == NULL)
+       if (hwif->ide_dma_on == NULL)
                goto out;
 
        err = -EBUSY;
@@ -866,8 +864,9 @@ int set_pio_mode(ide_drive_t *drive, int arg)
        if (arg < 0 || arg > 255)
                return -EINVAL;
 
-       if (!HWIF(drive)->tuneproc)
+       if (drive->hwif->set_pio_mode == NULL)
                return -ENOSYS;
+
        if (drive->special.b.set_tune)
                return -EBUSY;
        ide_init_drive_cmd(&rq);
@@ -914,6 +913,7 @@ static int generic_ide_suspend(struct device *dev, pm_message_t mesg)
        struct request rq;
        struct request_pm_state rqpm;
        ide_task_t args;
+       int ret;
 
        /* Call ACPI _GTM only once */
        if (!(drive->dn % 2))
@@ -930,7 +930,14 @@ static int generic_ide_suspend(struct device *dev, pm_message_t mesg)
                mesg.event = PM_EVENT_FREEZE;
        rqpm.pm_state = mesg.event;
 
-       return ide_do_drive_cmd(drive, &rq, ide_wait);
+       ret = ide_do_drive_cmd(drive, &rq, ide_wait);
+       /* only call ACPI _PS3 after both drivers are suspended */
+       if (!ret && (((drive->dn % 2) && hwif->drives[0].present
+                && hwif->drives[1].present)
+                || !hwif->drives[0].present
+                || !hwif->drives[1].present))
+               ide_acpi_set_state(hwif, 0);
+       return ret;
 }
 
 static int generic_ide_resume(struct device *dev)
@@ -943,8 +950,10 @@ static int generic_ide_resume(struct device *dev)
        int err;
 
        /* Call ACPI _STM only once */
-       if (!(drive->dn % 2))
+       if (!(drive->dn % 2)) {
+               ide_acpi_set_state(hwif, 1);
                ide_acpi_push_timing(hwif);
+       }
 
        ide_acpi_exec_tfs(drive);
 
@@ -1387,7 +1396,7 @@ static int __init ide_setup(char *s)
                 */
                static const char *ide_words[] = {
                        "noprobe", "serialize", "minus3", "minus4",
-                       "reset", "dma", "ata66", "minus8", "minus9",
+                       "reset", "minus6", "ata66", "minus8", "minus9",
                        "minus10", "four", "qd65xx", "ht6560b", "cmd640_vlb",
                        "dtc2278", "umc8672", "ali14xx", NULL };
                hw = s[3] - '0';
@@ -1466,6 +1475,7 @@ static int __init ide_setup(char *s)
                        case -10: /* minus10 */
                        case -9: /* minus9 */
                        case -8: /* minus8 */
+                       case -6:
                        case -4:
                        case -3:
                                goto bad_option;
@@ -1480,9 +1490,6 @@ static int __init ide_setup(char *s)
 #else
                                goto bad_hwif;
 #endif
-                       case -6: /* dma */
-                               hwif->autodma = 1;
-                               goto obsolete_option;
                        case -5: /* "reset" */
                                hwif->reset = 1;
                                goto obsolete_option;
@@ -1651,20 +1658,13 @@ static struct device_attribute ide_dev_attrs[] = {
        __ATTR_NULL
 };
 
-static int ide_uevent(struct device *dev, char **envp, int num_envp,
-                     char *buffer, int buffer_size)
+static int ide_uevent(struct device *dev, struct kobj_uevent_env *env)
 {
        ide_drive_t *drive = to_ide_device(dev);
-       int i = 0;
-       int length = 0;
-
-       add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
-                      "MEDIA=%s", media_string(drive));
-       add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
-                      "DRIVENAME=%s", drive->name);
-       add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length,
-                      "MODALIAS=ide:m-%s", media_string(drive));
-       envp[i] = NULL;
+
+       add_uevent_var(env, "MEDIA=%s", media_string(drive));
+       add_uevent_var(env, "DRIVENAME=%s", drive->name);
+       add_uevent_var(env, "MODALIAS=ide:m-%s", media_string(drive));
        return 0;
 }