Skip to content

Commit fe6c581

Browse files
committed
Merge branch 'for-4.5-fixes' into for-4.6
2 parents 51b1b28 + dc8b4af commit fe6c581

File tree

4 files changed

+61
-4
lines changed

4 files changed

+61
-4
lines changed

drivers/ata/ahci.c

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,21 @@ static const struct pci_device_id ahci_pci_tbl[] = {
372372
{ PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */
373373
{ PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
374374
{ PCI_VDEVICE(INTEL, 0x2822), board_ahci }, /* Lewisburg RAID*/
375+
{ PCI_VDEVICE(INTEL, 0x2823), board_ahci }, /* Lewisburg AHCI*/
375376
{ PCI_VDEVICE(INTEL, 0x2826), board_ahci }, /* Lewisburg RAID*/
377+
{ PCI_VDEVICE(INTEL, 0x2827), board_ahci }, /* Lewisburg RAID*/
376378
{ PCI_VDEVICE(INTEL, 0xa182), board_ahci }, /* Lewisburg AHCI*/
377379
{ PCI_VDEVICE(INTEL, 0xa184), board_ahci }, /* Lewisburg RAID*/
378380
{ PCI_VDEVICE(INTEL, 0xa186), board_ahci }, /* Lewisburg RAID*/
379381
{ 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*/
380384
{ PCI_VDEVICE(INTEL, 0xa202), board_ahci }, /* Lewisburg AHCI*/
381385
{ PCI_VDEVICE(INTEL, 0xa204), board_ahci }, /* Lewisburg RAID*/
382386
{ PCI_VDEVICE(INTEL, 0xa206), board_ahci }, /* Lewisburg RAID*/
383387
{ 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*/
384390

385391
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
386392
{ 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)
13601366
{}
13611367
#endif
13621368

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+
13631407
/*
13641408
* ahci_init_msix() - optionally enable per-port MSI-X otherwise defer
13651409
* to single msi.
@@ -1595,6 +1639,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
15951639
if (ahci_broken_devslp(pdev))
15961640
hpriv->flags |= AHCI_HFLAG_NO_DEVSLP;
15971641

1642+
#ifdef CONFIG_ARM64
1643+
if (pdev->vendor == 0x177d && pdev->device == 0xa01c)
1644+
hpriv->irq_handler = ahci_thunderx_irq_handler;
1645+
#endif
1646+
15981647
/* save initial config */
15991648
ahci_pci_save_initial_config(pdev, hpriv);
16001649

drivers/ata/libahci.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,8 +1211,7 @@ static void ahci_port_init(struct device *dev, struct ata_port *ap,
12111211

12121212
/* mark esata ports */
12131213
tmp = readl(port_mmio + PORT_CMD);
1214-
if ((tmp & PORT_CMD_HPCP) ||
1215-
((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS)))
1214+
if ((tmp & PORT_CMD_ESP) && (hpriv->cap & HOST_CAP_SXS))
12161215
ap->pflags |= ATA_PFLAG_EXTERNAL;
12171216
}
12181217

drivers/ata/pata_rb532_cf.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
#include <linux/libata.h>
3333
#include <scsi/scsi_host.h>
3434

35+
#include <asm/mach-rc32434/rb.h>
36+
3537
#define DRV_NAME "pata-rb532-cf"
3638
#define DRV_VERSION "0.1.0"
3739
#define DRV_DESC "PATA driver for RouterBOARD 532 Compact Flash"
@@ -107,6 +109,7 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
107109
int gpio;
108110
struct resource *res;
109111
struct ata_host *ah;
112+
struct cf_device *pdata;
110113
struct rb532_cf_info *info;
111114
int ret;
112115

@@ -122,7 +125,13 @@ static int rb532_pata_driver_probe(struct platform_device *pdev)
122125
return -ENOENT;
123126
}
124127

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;
126135
if (gpio < 0) {
127136
dev_err(&pdev->dev, "no GPIO found for irq%d\n", irq);
128137
return -ENOENT;

include/linux/libata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ struct ata_device {
720720
union {
721721
u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
722722
u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */
723-
};
723+
} ____cacheline_aligned;
724724

725725
/* DEVSLP Timing Variables from Identify Device Data Log */
726726
u8 devslp_timing[ATA_LOG_DEVSLP_SIZE];

0 commit comments

Comments
 (0)