diff options
author | Tejun Heo <tj@kernel.org> | 2016-03-11 12:30:17 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2016-03-11 12:30:17 -0500 |
commit | fe6c58146d42785386ca69bb1e35d53ac5940cb7 (patch) | |
tree | be4006ac033d638071f65851403c42b382b23427 | |
parent | 51b1b2867b81450bd198b691c70dccb582e961ff (diff) | |
parent | dc8b4afc4a04fac8ee55a19b59f2356a25e7e778 (diff) |
Merge branch 'for-4.5-fixes' into for-4.6
-rw-r--r-- | drivers/ata/ahci.c | 49 | ||||
-rw-r--r-- | drivers/ata/libahci.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_rb532_cf.c | 11 | ||||
-rw-r--r-- | include/linux/libata.h | 2 |
4 files changed, 61 insertions, 4 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 196f0287cba1..1fe592009c2e 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -372,15 +372,21 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
372 | { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */ | 372 | { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */ |
373 | { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */ | 373 | { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */ |
374 | { PCI_VDEVICE(INTEL, 0x2822), board_ahci }, /* Lewisburg RAID*/ | 374 | { PCI_VDEVICE(INTEL, 0x2822), board_ahci }, /* Lewisburg RAID*/ |
375 | { PCI_VDEVICE(INTEL, 0x2823), board_ahci }, /* Lewisburg AHCI*/ | ||
375 | { PCI_VDEVICE(INTEL, 0x2826), board_ahci }, /* Lewisburg RAID*/ | 376 | { PCI_VDEVICE(INTEL, 0x2826), board_ahci }, /* Lewisburg RAID*/ |
377 | { PCI_VDEVICE(INTEL, 0x2827), board_ahci }, /* Lewisburg RAID*/ | ||
376 | { PCI_VDEVICE(INTEL, 0xa182), board_ahci }, /* Lewisburg AHCI*/ | 378 | { PCI_VDEVICE(INTEL, 0xa182), board_ahci }, /* Lewisburg AHCI*/ |
377 | { PCI_VDEVICE(INTEL, 0xa184), board_ahci }, /* Lewisburg RAID*/ | 379 | { PCI_VDEVICE(INTEL, 0xa184), board_ahci }, /* Lewisburg RAID*/ |
378 | { PCI_VDEVICE(INTEL, 0xa186), board_ahci }, /* Lewisburg RAID*/ | 380 | { PCI_VDEVICE(INTEL, 0xa186), board_ahci }, /* Lewisburg RAID*/ |
379 | { PCI_VDEVICE(INTEL, 0xa18e), board_ahci }, /* Lewisburg RAID*/ | 381 | { PCI_VDEVICE(INTEL, 0xa18e), board_ahci }, /* Lewisburg RAID*/ |
382 | { PCI_VDEVICE(INTEL, 0xa1d2), board_ahci }, /* Lewisburg RAID*/ | ||
383 | { PCI_VDEVICE(INTEL, 0xa1d6), board_ahci }, /* Lewisburg RAID*/ | ||
380 | { PCI_VDEVICE(INTEL, 0xa202), board_ahci }, /* Lewisburg AHCI*/ | 384 | { PCI_VDEVICE(INTEL, 0xa202), board_ahci }, /* Lewisburg AHCI*/ |
381 | { PCI_VDEVICE(INTEL, 0xa204), board_ahci }, /* Lewisburg RAID*/ | 385 | { PCI_VDEVICE(INTEL, 0xa204), board_ahci }, /* Lewisburg RAID*/ |
382 | { PCI_VDEVICE(INTEL, 0xa206), board_ahci }, /* Lewisburg RAID*/ | 386 | { PCI_VDEVICE(INTEL, 0xa206), board_ahci }, /* Lewisburg RAID*/ |
383 | { PCI_VDEVICE(INTEL, 0xa20e), board_ahci }, /* Lewisburg RAID*/ | 387 | { PCI_VDEVICE(INTEL, 0xa20e), board_ahci }, /* Lewisburg RAID*/ |
388 | { PCI_VDEVICE(INTEL, 0xa252), board_ahci }, /* Lewisburg RAID*/ | ||
389 | { PCI_VDEVICE(INTEL, 0xa256), board_ahci }, /* Lewisburg RAID*/ | ||
384 | 390 | ||
385 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ | 391 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ |
386 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 392 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
@@ -1360,6 +1366,44 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host) | |||
1360 | {} | 1366 | {} |
1361 | #endif | 1367 | #endif |
1362 | 1368 | ||
1369 | #ifdef CONFIG_ARM64 | ||
1370 | /* | ||
1371 | * Due to ERRATA#22536, ThunderX needs to handle HOST_IRQ_STAT differently. | ||
1372 | * Workaround is to make sure all pending IRQs are served before leaving | ||
1373 | * handler. | ||
1374 | */ | ||
1375 | static irqreturn_t ahci_thunderx_irq_handler(int irq, void *dev_instance) | ||
1376 | { | ||
1377 | struct ata_host *host = dev_instance; | ||
1378 | struct ahci_host_priv *hpriv; | ||
1379 | unsigned int rc = 0; | ||
1380 | void __iomem *mmio; | ||
1381 | u32 irq_stat, irq_masked; | ||
1382 | unsigned int handled = 1; | ||
1383 | |||
1384 | VPRINTK("ENTER\n"); | ||
1385 | hpriv = host->private_data; | ||
1386 | mmio = hpriv->mmio; | ||
1387 | irq_stat = readl(mmio + HOST_IRQ_STAT); | ||
1388 | if (!irq_stat) | ||
1389 | return IRQ_NONE; | ||
1390 | |||
1391 | do { | ||
1392 | irq_masked = irq_stat & hpriv->port_map; | ||
1393 | spin_lock(&host->lock); | ||
1394 | rc = ahci_handle_port_intr(host, irq_masked); | ||
1395 | if (!rc) | ||
1396 | handled = 0; | ||
1397 | writel(irq_stat, mmio + HOST_IRQ_STAT); | ||
1398 | irq_stat = readl(mmio + HOST_IRQ_STAT); | ||
1399 | spin_unlock(&host->lock); | ||
1400 | } while (irq_stat); | ||
1401 | VPRINTK("EXIT\n"); | ||
1402 | |||
1403 | return IRQ_RETVAL(handled); | ||
1404 | } | ||
1405 | #endif | ||
1406 | |||
1363 | /* | 1407 | /* |
1364 | * ahci_init_msix() - optionally enable per-port MSI-X otherwise defer | 1408 | * ahci_init_msix() - optionally enable per-port MSI-X otherwise defer |
1365 | * to single msi. | 1409 | * to single msi. |
@@ -1595,6 +1639,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1595 | if (ahci_broken_devslp(pdev)) | 1639 | if (ahci_broken_devslp(pdev)) |
1596 | hpriv->flags |= AHCI_HFLAG_NO_DEVSLP; | 1640 | hpriv->flags |= AHCI_HFLAG_NO_DEVSLP; |
1597 | 1641 | ||
1642 | #ifdef CONFIG_ARM64 | ||
1643 | if (pdev->vendor == 0x177d && pdev->device == 0xa01c) | ||
1644 | hpriv->irq_handler = ahci_thunderx_irq_handler; | ||
1645 | #endif | ||
1646 | |||
1598 | /* save initial config */ | 1647 | /* save initial config */ |
1599 | ahci_pci_save_initial_config(pdev, hpriv); | 1648 | ahci_pci_save_initial_config(pdev, hpriv); |
1600 | 1649 | ||
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 2d21b46db714..3982054060b8 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -1211,8 +1211,7 @@ static void ahci_port_init(struct device *dev, struct ata_port *ap, | |||
1211 | 1211 | ||
1212 | /* mark esata ports */ | 1212 | /* mark esata ports */ |
1213 | tmp = readl(port_mmio + PORT_CMD); | 1213 | tmp = readl(port_mmio + PORT_CMD); |
1214 | if ((tmp & PORT_CMD_HPCP) || | 1214 | if ((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS)) |
1215 | ((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS))) | ||
1216 | ap->pflags |= ATA_PFLAG_EXTERNAL; | 1215 | ap->pflags |= ATA_PFLAG_EXTERNAL; |
1217 | } | 1216 | } |
1218 | 1217 | ||
diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c index 12fe0f3bb7e9..c8b6a780a290 100644 --- a/drivers/ata/pata_rb532_cf.c +++ b/drivers/ata/pata_rb532_cf.c | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <linux/libata.h> | 32 | #include <linux/libata.h> |
33 | #include <scsi/scsi_host.h> | 33 | #include <scsi/scsi_host.h> |
34 | 34 | ||
35 | #include <asm/mach-rc32434/rb.h> | ||
36 | |||
35 | #define DRV_NAME "pata-rb532-cf" | 37 | #define DRV_NAME "pata-rb532-cf" |
36 | #define DRV_VERSION "0.1.0" | 38 | #define DRV_VERSION "0.1.0" |
37 | #define DRV_DESC "PATA driver for RouterBOARD 532 Compact Flash" | 39 | #define DRV_DESC "PATA driver for RouterBOARD 532 Compact Flash" |
@@ -107,6 +109,7 @@ static int rb532_pata_driver_probe(struct platform_device *pdev) | |||
107 | int gpio; | 109 | int gpio; |
108 | struct resource *res; | 110 | struct resource *res; |
109 | struct ata_host *ah; | 111 | struct ata_host *ah; |
112 | struct cf_device *pdata; | ||
110 | struct rb532_cf_info *info; | 113 | struct rb532_cf_info *info; |
111 | int ret; | 114 | int ret; |
112 | 115 | ||
@@ -122,7 +125,13 @@ static int rb532_pata_driver_probe(struct platform_device *pdev) | |||
122 | return -ENOENT; | 125 | return -ENOENT; |
123 | } | 126 | } |
124 | 127 | ||
125 | gpio = irq_to_gpio(irq); | 128 | pdata = dev_get_platdata(&pdev->dev); |
129 | if (!pdata) { | ||
130 | dev_err(&pdev->dev, "no platform data specified\n"); | ||
131 | return -EINVAL; | ||
132 | } | ||
133 | |||
134 | gpio = pdata->gpio_pin; | ||
126 | if (gpio < 0) { | 135 | if (gpio < 0) { |
127 | dev_err(&pdev->dev, "no GPIO found for irq%d\n", irq); | 136 | dev_err(&pdev->dev, "no GPIO found for irq%d\n", irq); |
128 | return -ENOENT; | 137 | return -ENOENT; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index bec2abbd7ab2..2c4ebef79d0c 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -720,7 +720,7 @@ struct ata_device { | |||
720 | union { | 720 | union { |
721 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ | 721 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ |
722 | u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */ | 722 | u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */ |
723 | }; | 723 | } ____cacheline_aligned; |
724 | 724 | ||
725 | /* DEVSLP Timing Variables from Identify Device Data Log */ | 725 | /* DEVSLP Timing Variables from Identify Device Data Log */ |
726 | u8 devslp_timing[ATA_LOG_DEVSLP_SIZE]; | 726 | u8 devslp_timing[ATA_LOG_DEVSLP_SIZE]; |