Merge tag 'irqdomain-for-linus' of git://git.secretlab.ca/git/linux
[firefly-linux-kernel-4.4.55.git] / drivers / ata / libata-core.c
index adf002a3c584b3d2bd7fb27357df040a381f3b82..c24354d44f3d72266dcf8b3994c5070e6e5e55dd 100644 (file)
@@ -2401,7 +2401,7 @@ int ata_dev_configure(struct ata_device *dev)
                        cdb_intr_string = ", CDB intr";
                }
 
-               if (atapi_dmadir || atapi_id_dmadir(dev->id)) {
+               if (atapi_dmadir || (dev->horkage & ATA_HORKAGE_ATAPI_DMADIR) || atapi_id_dmadir(dev->id)) {
                        dev->flags |= ATA_DFLAG_DMADIR;
                        dma_dir_string = ", DMADIR";
                }
@@ -5436,7 +5436,7 @@ static int ata_port_runtime_idle(struct device *dev)
                                return -EBUSY;
        }
 
-       return pm_runtime_suspend(dev);
+       return 0;
 }
 
 static int ata_port_runtime_suspend(struct device *dev)
@@ -5642,6 +5642,7 @@ struct ata_port *ata_port_alloc(struct ata_host *host)
        ap->pflags |= ATA_PFLAG_INITIALIZING | ATA_PFLAG_FROZEN;
        ap->lock = &host->lock;
        ap->print_id = -1;
+       ap->local_port_no = -1;
        ap->host = host;
        ap->dev = host->dev;
 
@@ -6132,9 +6133,10 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
                kfree(host->ports[i]);
 
        /* give ports names and add SCSI hosts */
-       for (i = 0; i < host->n_ports; i++)
+       for (i = 0; i < host->n_ports; i++) {
                host->ports[i]->print_id = atomic_inc_return(&ata_print_id);
-
+               host->ports[i]->local_port_no = i + 1;
+       }
 
        /* Create associated sysfs transport objects  */
        for (i = 0; i < host->n_ports; i++) {
@@ -6502,6 +6504,7 @@ static int __init ata_parse_force_one(char **cur,
                { "nosrst",     .lflags         = ATA_LFLAG_NO_SRST },
                { "norst",      .lflags         = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
                { "rstonce",    .lflags         = ATA_LFLAG_RST_ONCE },
+               { "atapi_dmadir", .horkage_on   = ATA_HORKAGE_ATAPI_DMADIR },
        };
        char *start = *cur, *p = *cur;
        char *id, *val, *endp;