Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata

Pull libata fixes from Tejun Heo:
"The most notable is the revert of lock splitting optimization in ahci.
This also made the IRQ handling threaded even when there's only one
IRQ in use. The conversion missed IRFQ_SHARED leading to screaming
IRQs problem in some cases and the threaded IRQ handling showed
performance regression in some LKP test cases. The changes are
reverted for now. It'll probably be retried once threaded IRQ
handling is removed from ahci.

Other than that, there's one fix for ahci and several patches adding
device IDs"

* 'for-3.18-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
ahci: fix AHCI parameters not taken into account
ata: sata_rcar: Add r8a7793 device support
ahci: Add Device IDs for Intel Sunrise Point PCH
ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks
Revert "AHCI: Optimize single IRQ interrupt processing"
Revert "AHCI: Do not acquire ata_host::lock from single IRQ handler"
ata: sata_rcar: Disable DIPM mode for r8a7790 ES1

+55 -72
+4 -2
Documentation/devicetree/bindings/ata/sata_rcar.txt
··· 3 3 Required properties: 4 4 - compatible : should contain one of the following: 5 5 - "renesas,sata-r8a7779" for R-Car H1 6 - - "renesas,sata-r8a7790" for R-Car H2 7 - - "renesas,sata-r8a7791" for R-Car M2 6 + - "renesas,sata-r8a7790-es1" for R-Car H2 ES1 7 + - "renesas,sata-r8a7790" for R-Car H2 other than ES1 8 + - "renesas,sata-r8a7791" for R-Car M2-W 9 + - "renesas,sata-r8a7793" for R-Car M2-N 8 10 - reg : address and length of the SATA registers; 9 11 - interrupts : must consist of one interrupt specifier. 10 12
+19 -9
drivers/ata/ahci.c
··· 60 60 /* board IDs by feature in alphabetical order */ 61 61 board_ahci, 62 62 board_ahci_ign_iferr, 63 + board_ahci_nomsi, 63 64 board_ahci_noncq, 64 65 board_ahci_nosntf, 65 66 board_ahci_yes_fbs, ··· 117 116 }, 118 117 [board_ahci_ign_iferr] = { 119 118 AHCI_HFLAGS (AHCI_HFLAG_IGN_IRQ_IF_ERR), 119 + .flags = AHCI_FLAG_COMMON, 120 + .pio_mask = ATA_PIO4, 121 + .udma_mask = ATA_UDMA6, 122 + .port_ops = &ahci_ops, 123 + }, 124 + [board_ahci_nomsi] = { 125 + AHCI_HFLAGS (AHCI_HFLAG_NO_MSI), 120 126 .flags = AHCI_FLAG_COMMON, 121 127 .pio_mask = ATA_PIO4, 122 128 .udma_mask = ATA_UDMA6, ··· 321 313 { PCI_VDEVICE(INTEL, 0x8c87), board_ahci }, /* 9 Series RAID */ 322 314 { PCI_VDEVICE(INTEL, 0x8c8e), board_ahci }, /* 9 Series RAID */ 323 315 { PCI_VDEVICE(INTEL, 0x8c8f), board_ahci }, /* 9 Series RAID */ 316 + { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */ 317 + { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */ 318 + { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */ 319 + { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */ 320 + { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */ 324 321 325 322 /* JMicron 360/1/3/5/6, match class to avoid IDE function */ 326 323 { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, ··· 488 475 { PCI_VDEVICE(ASMEDIA, 0x0612), board_ahci }, /* ASM1062 */ 489 476 490 477 /* 491 - * Samsung SSDs found on some macbooks. NCQ times out. 492 - * https://bugzilla.kernel.org/show_bug.cgi?id=60731 478 + * Samsung SSDs found on some macbooks. NCQ times out if MSI is 479 + * enabled. https://bugzilla.kernel.org/show_bug.cgi?id=60731 493 480 */ 494 - { PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_noncq }, 481 + { PCI_VDEVICE(SAMSUNG, 0x1600), board_ahci_nomsi }, 495 482 496 483 /* Enmotus */ 497 484 { PCI_DEVICE(0x1c44, 0x8000), board_ahci }, ··· 527 514 static void ahci_pci_save_initial_config(struct pci_dev *pdev, 528 515 struct ahci_host_priv *hpriv) 529 516 { 530 - unsigned int force_port_map = 0; 531 - unsigned int mask_port_map = 0; 532 - 533 517 if (pdev->vendor == PCI_VENDOR_ID_JMICRON && pdev->device == 0x2361) { 534 518 dev_info(&pdev->dev, "JMB361 has only one port\n"); 535 - force_port_map = 1; 519 + hpriv->force_port_map = 1; 536 520 } 537 521 538 522 /* ··· 539 529 */ 540 530 if (hpriv->flags & AHCI_HFLAG_MV_PATA) { 541 531 if (pdev->device == 0x6121) 542 - mask_port_map = 0x3; 532 + hpriv->mask_port_map = 0x3; 543 533 else 544 - mask_port_map = 0xf; 534 + hpriv->mask_port_map = 0xf; 545 535 dev_info(&pdev->dev, 546 536 "Disabling your PATA port. Use the boot option 'ahci.marvell_enable=0' to avoid this.\n"); 547 537 }
+17 -61
drivers/ata/libahci.c
··· 1778 1778 } 1779 1779 } 1780 1780 1781 - static void ahci_update_intr_status(struct ata_port *ap) 1781 + static void ahci_port_intr(struct ata_port *ap) 1782 1782 { 1783 1783 void __iomem *port_mmio = ahci_port_base(ap); 1784 - struct ahci_port_priv *pp = ap->private_data; 1785 1784 u32 status; 1786 1785 1787 1786 status = readl(port_mmio + PORT_IRQ_STAT); 1788 1787 writel(status, port_mmio + PORT_IRQ_STAT); 1789 1788 1790 - atomic_or(status, &pp->intr_status); 1789 + ahci_handle_port_interrupt(ap, port_mmio, status); 1791 1790 } 1792 1791 1793 1792 static irqreturn_t ahci_port_thread_fn(int irq, void *dev_instance) ··· 1803 1804 spin_lock_bh(ap->lock); 1804 1805 ahci_handle_port_interrupt(ap, port_mmio, status); 1805 1806 spin_unlock_bh(ap->lock); 1806 - 1807 - return IRQ_HANDLED; 1808 - } 1809 - 1810 - irqreturn_t ahci_thread_fn(int irq, void *dev_instance) 1811 - { 1812 - struct ata_host *host = dev_instance; 1813 - struct ahci_host_priv *hpriv = host->private_data; 1814 - u32 irq_masked = hpriv->port_map; 1815 - unsigned int i; 1816 - 1817 - for (i = 0; i < host->n_ports; i++) { 1818 - struct ata_port *ap; 1819 - 1820 - if (!(irq_masked & (1 << i))) 1821 - continue; 1822 - 1823 - ap = host->ports[i]; 1824 - if (ap) { 1825 - ahci_port_thread_fn(irq, ap); 1826 - VPRINTK("port %u\n", i); 1827 - } else { 1828 - VPRINTK("port %u (no irq)\n", i); 1829 - if (ata_ratelimit()) 1830 - dev_warn(host->dev, 1831 - "interrupt on disabled port %u\n", i); 1832 - } 1833 - } 1834 1807 1835 1808 return IRQ_HANDLED; 1836 1809 } ··· 1846 1875 1847 1876 irq_masked = irq_stat & hpriv->port_map; 1848 1877 1878 + spin_lock(&host->lock); 1879 + 1849 1880 for (i = 0; i < host->n_ports; i++) { 1850 1881 struct ata_port *ap; 1851 1882 ··· 1856 1883 1857 1884 ap = host->ports[i]; 1858 1885 if (ap) { 1859 - ahci_update_intr_status(ap); 1886 + ahci_port_intr(ap); 1860 1887 VPRINTK("port %u\n", i); 1861 1888 } else { 1862 1889 VPRINTK("port %u (no irq)\n", i); ··· 1879 1906 */ 1880 1907 writel(irq_stat, mmio + HOST_IRQ_STAT); 1881 1908 1909 + spin_unlock(&host->lock); 1910 + 1882 1911 VPRINTK("EXIT\n"); 1883 1912 1884 - return handled ? IRQ_WAKE_THREAD : IRQ_NONE; 1913 + return IRQ_RETVAL(handled); 1885 1914 } 1886 1915 1887 1916 unsigned int ahci_qc_issue(struct ata_queued_cmd *qc) ··· 2295 2320 */ 2296 2321 pp->intr_mask = DEF_PORT_IRQ; 2297 2322 2298 - spin_lock_init(&pp->lock); 2299 - ap->lock = &pp->lock; 2323 + /* 2324 + * Switch to per-port locking in case each port has its own MSI vector. 2325 + */ 2326 + if ((hpriv->flags & AHCI_HFLAG_MULTI_MSI)) { 2327 + spin_lock_init(&pp->lock); 2328 + ap->lock = &pp->lock; 2329 + } 2300 2330 2301 2331 ap->private_data = pp; 2302 2332 ··· 2462 2482 return rc; 2463 2483 } 2464 2484 2465 - static int ahci_host_activate_single_irq(struct ata_host *host, int irq, 2466 - struct scsi_host_template *sht) 2467 - { 2468 - int i, rc; 2469 - 2470 - rc = ata_host_start(host); 2471 - if (rc) 2472 - return rc; 2473 - 2474 - rc = devm_request_threaded_irq(host->dev, irq, ahci_single_irq_intr, 2475 - ahci_thread_fn, IRQF_SHARED, 2476 - dev_driver_string(host->dev), host); 2477 - if (rc) 2478 - return rc; 2479 - 2480 - for (i = 0; i < host->n_ports; i++) 2481 - ata_port_desc(host->ports[i], "irq %d", irq); 2482 - 2483 - rc = ata_host_register(host, sht); 2484 - if (rc) 2485 - devm_free_irq(host->dev, irq, host); 2486 - 2487 - return rc; 2488 - } 2489 - 2490 2485 /** 2491 2486 * ahci_host_activate - start AHCI host, request IRQs and register it 2492 2487 * @host: target ATA host ··· 2487 2532 if (hpriv->flags & AHCI_HFLAG_MULTI_MSI) 2488 2533 rc = ahci_host_activate_multi_irqs(host, irq, sht); 2489 2534 else 2490 - rc = ahci_host_activate_single_irq(host, irq, sht); 2535 + rc = ata_host_activate(host, irq, ahci_single_irq_intr, 2536 + IRQF_SHARED, sht); 2491 2537 return rc; 2492 2538 } 2493 2539 EXPORT_SYMBOL_GPL(ahci_host_activate);
+15
drivers/ata/sata_rcar.c
··· 146 146 enum sata_rcar_type { 147 147 RCAR_GEN1_SATA, 148 148 RCAR_GEN2_SATA, 149 + RCAR_R8A7790_ES1_SATA, 149 150 }; 150 151 151 152 struct sata_rcar_priv { ··· 764 763 ap->udma_mask = ATA_UDMA6; 765 764 ap->flags |= ATA_FLAG_SATA; 766 765 766 + if (priv->type == RCAR_R8A7790_ES1_SATA) 767 + ap->flags |= ATA_FLAG_NO_DIPM; 768 + 767 769 ioaddr->cmd_addr = base + SDATA_REG; 768 770 ioaddr->ctl_addr = base + SSDEVCON_REG; 769 771 ioaddr->scr_addr = base + SCRSSTS_REG; ··· 796 792 sata_rcar_gen1_phy_init(priv); 797 793 break; 798 794 case RCAR_GEN2_SATA: 795 + case RCAR_R8A7790_ES1_SATA: 799 796 sata_rcar_gen2_phy_init(priv); 800 797 break; 801 798 default: ··· 843 838 .data = (void *)RCAR_GEN2_SATA 844 839 }, 845 840 { 841 + .compatible = "renesas,sata-r8a7790-es1", 842 + .data = (void *)RCAR_R8A7790_ES1_SATA 843 + }, 844 + { 846 845 .compatible = "renesas,sata-r8a7791", 846 + .data = (void *)RCAR_GEN2_SATA 847 + }, 848 + { 849 + .compatible = "renesas,sata-r8a7793", 847 850 .data = (void *)RCAR_GEN2_SATA 848 851 }, 849 852 { }, ··· 862 849 { "sata_rcar", RCAR_GEN1_SATA }, /* Deprecated by "sata-r8a7779" */ 863 850 { "sata-r8a7779", RCAR_GEN1_SATA }, 864 851 { "sata-r8a7790", RCAR_GEN2_SATA }, 852 + { "sata-r8a7790-es1", RCAR_R8A7790_ES1_SATA }, 865 853 { "sata-r8a7791", RCAR_GEN2_SATA }, 854 + { "sata-r8a7793", RCAR_GEN2_SATA }, 866 855 { }, 867 856 }; 868 857 MODULE_DEVICE_TABLE(platform, sata_rcar_id_table);