@@ -372,15 +372,21 @@ static const struct pci_device_id ahci_pci_tbl[] = {
372
372
{ PCI_VDEVICE (INTEL , 0xa107 ), board_ahci }, /* Sunrise Point-H RAID */
373
373
{ PCI_VDEVICE (INTEL , 0xa10f ), board_ahci }, /* Sunrise Point-H RAID */
374
374
{ PCI_VDEVICE (INTEL , 0x2822 ), board_ahci }, /* Lewisburg RAID*/
375
+ { PCI_VDEVICE (INTEL , 0x2823 ), board_ahci }, /* Lewisburg AHCI*/
375
376
{ PCI_VDEVICE (INTEL , 0x2826 ), board_ahci }, /* Lewisburg RAID*/
377
+ { PCI_VDEVICE (INTEL , 0x2827 ), board_ahci }, /* Lewisburg RAID*/
376
378
{ PCI_VDEVICE (INTEL , 0xa182 ), board_ahci }, /* Lewisburg AHCI*/
377
379
{ PCI_VDEVICE (INTEL , 0xa184 ), board_ahci }, /* Lewisburg RAID*/
378
380
{ PCI_VDEVICE (INTEL , 0xa186 ), board_ahci }, /* Lewisburg RAID*/
379
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
384
{ PCI_VDEVICE (INTEL , 0xa202 ), board_ahci }, /* Lewisburg AHCI*/
381
385
{ PCI_VDEVICE (INTEL , 0xa204 ), board_ahci }, /* Lewisburg RAID*/
382
386
{ PCI_VDEVICE (INTEL , 0xa206 ), board_ahci }, /* Lewisburg RAID*/
383
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
391
/* JMicron 360/1/3/5/6, match class to avoid IDE function */
386
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
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
1408
* ahci_init_msix() - optionally enable per-port MSI-X otherwise defer
1365
1409
* to single msi.
@@ -1595,6 +1639,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1595
1639
if (ahci_broken_devslp (pdev ))
1596
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
1647
/* save initial config */
1599
1648
ahci_pci_save_initial_config (pdev , hpriv );
1600
1649
0 commit comments