Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev:
pata-rb532-cf: remove set_irq_type from finish_io
[libata] pata_via: support VX855, future chips whose IDE controller use 0x0571
sata_mv: no longer experimental (v2)
sata_mv: msi masking fix (v2)
sata_mv: Properly initialize main irq mask
sata_mv: remove bogus nsect restriction
sata_mv: don't read hc_irq_cause
sata_mv: fix 8-port timeouts on 508x/6081 chips
sata_nv: fix MCP5x reset
sata_nv: rename nv_nf2_hardreset()
libata: set NODEV_HINT for 0x7f status
libata-sff: fix incorrect EH message

+104 -68
arch/arm/mach-integrator/clock.h
+3 -3
drivers/ata/Kconfig
··· 112 112 If unsure, say N. 113 113 114 114 config SATA_MV 115 - tristate "Marvell SATA support (HIGHLY EXPERIMENTAL)" 116 - depends on EXPERIMENTAL 115 + tristate "Marvell SATA support" 117 116 help 118 117 This option enables support for the Marvell Serial ATA family. 119 - Currently supports 88SX[56]0[48][01] chips. 118 + Currently supports 88SX[56]0[48][01] PCI(-X) chips, 119 + as well as the newer [67]042 PCI-X/PCIe and SOC devices. 120 120 121 121 If unsure, say N. 122 122
+11 -1
drivers/ata/libata-sff.c
··· 1322 1322 * condition. Mark hint. 1323 1323 */ 1324 1324 ata_ehi_push_desc(ehi, "ST-ATA: " 1325 - "DRQ=1 with device error, " 1325 + "DRQ=0 without device error, " 1326 1326 "dev_stat 0x%X", status); 1327 1327 qc->err_mask |= AC_ERR_HSM | 1328 1328 AC_ERR_NODEV_HINT; ··· 1357 1357 "dev_stat 0x%X", status); 1358 1358 qc->err_mask |= AC_ERR_HSM; 1359 1359 } 1360 + 1361 + /* There are oddball controllers with 1362 + * status register stuck at 0x7f and 1363 + * lbal/m/h at zero which makes it 1364 + * pass all other presence detection 1365 + * mechanisms we have. Set NODEV_HINT 1366 + * for it. Kernel bz#7241. 1367 + */ 1368 + if (status == 0x7f) 1369 + qc->err_mask |= AC_ERR_NODEV_HINT; 1360 1370 1361 1371 /* ata_pio_sectors() might change the 1362 1372 * state to HSM_ST_LAST. so, the state
-2
drivers/ata/pata_rb532_cf.c
··· 63 63 ata_sff_sync might be sufficient. */ 64 64 ata_sff_dma_pause(ap); 65 65 ndelay(RB500_CF_IO_DELAY); 66 - 67 - set_irq_type(info->irq, IRQ_TYPE_LEVEL_HIGH); 68 66 } 69 67 70 68 static void rb532_pata_exec_command(struct ata_port *ap,
+17 -5
drivers/ata/pata_via.c
··· 86 86 VIA_SATA_PATA = 0x800, /* SATA/PATA combined configuration */ 87 87 }; 88 88 89 + enum { 90 + VIA_IDFLAG_SINGLE = (1 << 0), /* single channel controller) */ 91 + }; 92 + 89 93 /* 90 94 * VIA SouthBridge chips. 91 95 */ ··· 101 97 u8 rev_max; 102 98 u16 flags; 103 99 } via_isa_bridges[] = { 100 + { "vx855", PCI_DEVICE_ID_VIA_VX855, 0x00, 0x2f, 101 + VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA }, 104 102 { "vx800", PCI_DEVICE_ID_VIA_VX800, 0x00, 0x2f, VIA_UDMA_133 | 105 103 VIA_BAD_AST | VIA_SATA_PATA }, 104 + { "vt8261", PCI_DEVICE_ID_VIA_8261, 0x00, 0x2f, 105 + VIA_UDMA_133 | VIA_BAD_AST }, 106 106 { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 107 107 { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, 108 108 { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST | VIA_SATA_PATA }, ··· 130 122 { "vt82c586", PCI_DEVICE_ID_VIA_82C586_0, 0x00, 0x0f, VIA_UDMA_NONE | VIA_SET_FIFO }, 131 123 { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK }, 132 124 { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK | VIA_BAD_ID }, 125 + { "vtxxxx", PCI_DEVICE_ID_VIA_ANON, 0x00, 0x2f, 126 + VIA_UDMA_133 | VIA_BAD_AST }, 133 127 { NULL } 134 128 }; 135 129 ··· 470 460 static int printed_version; 471 461 u8 enable; 472 462 u32 timing; 463 + unsigned long flags = id->driver_data; 473 464 int rc; 474 465 475 466 if (!printed_version++) ··· 480 469 if (rc) 481 470 return rc; 482 471 472 + if (flags & VIA_IDFLAG_SINGLE) 473 + ppi[1] = &ata_dummy_port_info; 474 + 483 475 /* To find out how the IDE will behave and what features we 484 476 actually have to look at the bridge not the IDE controller */ 485 - for (config = via_isa_bridges; config->id; config++) 477 + for (config = via_isa_bridges; config->id != PCI_DEVICE_ID_VIA_ANON; 478 + config++) 486 479 if ((isa = pci_get_device(PCI_VENDOR_ID_VIA + 487 480 !!(config->flags & VIA_BAD_ID), 488 481 config->id, NULL))) { ··· 497 482 pci_dev_put(isa); 498 483 } 499 484 500 - if (!config->id) { 501 - printk(KERN_WARNING "via: Unknown VIA SouthBridge, disabling.\n"); 502 - return -ENODEV; 503 - } 504 485 pci_dev_put(isa); 505 486 506 487 if (!(config->flags & VIA_NO_ENABLES)) { ··· 598 587 { PCI_VDEVICE(VIA, 0x1571), }, 599 588 { PCI_VDEVICE(VIA, 0x3164), }, 600 589 { PCI_VDEVICE(VIA, 0x5324), }, 590 + { PCI_VDEVICE(VIA, 0xC409), VIA_IDFLAG_SINGLE }, 601 591 602 592 { }, 603 593 };
+26 -30
drivers/ata/sata_mv.c
··· 33 33 * 34 34 * --> ATAPI support (Marvell claims the 60xx/70xx chips can do it). 35 35 * 36 - * --> Investigate problems with PCI Message Signalled Interrupts (MSI). 37 - * 38 - * --> Cache frequently-accessed registers in mv_port_priv to reduce overhead. 39 - * 40 36 * --> Develop a low-power-consumption strategy, and implement it. 41 37 * 42 38 * --> [Experiment, low priority] Investigate interrupt coalescing. ··· 68 72 #include <linux/libata.h> 69 73 70 74 #define DRV_NAME "sata_mv" 71 - #define DRV_VERSION "1.24" 75 + #define DRV_VERSION "1.25" 72 76 73 77 enum { 74 78 /* BAR's are enumerated in terms of pci_resource_start() terms */ ··· 346 350 EDMA_ARB_CFG_OFS = 0x38, 347 351 348 352 EDMA_HALTCOND_OFS = 0x60, /* GenIIe halt conditions */ 349 - 350 - GEN_II_NCQ_MAX_SECTORS = 256, /* max sects/io on Gen2 w/NCQ */ 351 353 352 354 /* Host private flags (hp_flags) */ 353 355 MV_HP_FLAG_MSI = (1 << 0), ··· 877 883 struct mv_host_priv *hpriv = ap->host->private_data; 878 884 int hardport = mv_hardport_from_port(ap->port_no); 879 885 void __iomem *hc_mmio = mv_hc_base_from_port( 880 - mv_host_base(ap->host), hardport); 881 - u32 hc_irq_cause, ipending; 886 + mv_host_base(ap->host), ap->port_no); 887 + u32 hc_irq_cause; 882 888 883 889 /* clear EDMA event indicators, if any */ 884 890 writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); 885 891 886 - /* clear EDMA interrupt indicator, if any */ 887 - hc_irq_cause = readl(hc_mmio + HC_IRQ_CAUSE_OFS); 888 - ipending = (DEV_IRQ | DMA_IRQ) << hardport; 889 - if (hc_irq_cause & ipending) { 890 - writelfl(hc_irq_cause & ~ipending, 891 - hc_mmio + HC_IRQ_CAUSE_OFS); 892 - } 892 + /* clear pending irq events */ 893 + hc_irq_cause = ~((DEV_IRQ | DMA_IRQ) << hardport); 894 + writelfl(hc_irq_cause, hc_mmio + HC_IRQ_CAUSE_OFS); 893 895 894 896 mv_edma_cfg(ap, want_ncq); 895 897 ··· 1089 1099 * 1090 1100 * Gen-II does not support NCQ over a port multiplier 1091 1101 * (no FIS-based switching). 1092 - * 1093 - * We don't have hob_nsect when doing NCQ commands on Gen-II. 1094 - * See mv_qc_prep() for more info. 1095 1102 */ 1096 1103 if (adev->flags & ATA_DFLAG_NCQ) { 1097 1104 if (sata_pmp_attached(adev->link->ap)) { 1098 1105 adev->flags &= ~ATA_DFLAG_NCQ; 1099 1106 ata_dev_printk(adev, KERN_INFO, 1100 1107 "NCQ disabled for command-based switching\n"); 1101 - } else if (adev->max_sectors > GEN_II_NCQ_MAX_SECTORS) { 1102 - adev->max_sectors = GEN_II_NCQ_MAX_SECTORS; 1103 - ata_dev_printk(adev, KERN_INFO, 1104 - "max_sectors limited to %u for NCQ\n", 1105 - adev->max_sectors); 1106 1108 } 1107 1109 } 1108 1110 } ··· 1432 1450 * only 11 bytes...so we must pick and choose required 1433 1451 * registers based on the command. So, we drop feature and 1434 1452 * hob_feature for [RW] DMA commands, but they are needed for 1435 - * NCQ. NCQ will drop hob_nsect. 1453 + * NCQ. NCQ will drop hob_nsect, which is not needed there 1454 + * (nsect is used only for the tag; feat/hob_feat hold true nsect). 1436 1455 */ 1437 1456 switch (tf->command) { 1438 1457 case ATA_CMD_READ: ··· 2197 2214 struct ata_host *host = dev_instance; 2198 2215 struct mv_host_priv *hpriv = host->private_data; 2199 2216 unsigned int handled = 0; 2217 + int using_msi = hpriv->hp_flags & MV_HP_FLAG_MSI; 2200 2218 u32 main_irq_cause, pending_irqs; 2201 2219 2202 2220 spin_lock(&host->lock); 2221 + 2222 + /* for MSI: block new interrupts while in here */ 2223 + if (using_msi) 2224 + writel(0, hpriv->main_irq_mask_addr); 2225 + 2203 2226 main_irq_cause = readl(hpriv->main_irq_cause_addr); 2204 2227 pending_irqs = main_irq_cause & hpriv->main_irq_mask; 2205 2228 /* ··· 2219 2230 handled = mv_host_intr(host, pending_irqs); 2220 2231 } 2221 2232 spin_unlock(&host->lock); 2233 + 2234 + /* for MSI: unmask; interrupt cause bits will retrigger now */ 2235 + if (using_msi) 2236 + writel(hpriv->main_irq_mask, hpriv->main_irq_mask_addr); 2237 + 2222 2238 return IRQ_RETVAL(handled); 2223 2239 } 2224 2240 ··· 2815 2821 writel(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); 2816 2822 2817 2823 /* clear pending irq events */ 2818 - hc_irq_cause = readl(hc_mmio + HC_IRQ_CAUSE_OFS); 2819 - hc_irq_cause &= ~((DEV_IRQ | DMA_IRQ) << hardport); 2824 + hc_irq_cause = ~((DEV_IRQ | DMA_IRQ) << hardport); 2820 2825 writelfl(hc_irq_cause, hc_mmio + HC_IRQ_CAUSE_OFS); 2821 2826 2822 2827 mv_enable_port_irqs(ap, ERR_IRQ); ··· 3067 3074 hpriv->main_irq_cause_addr = mmio + PCI_HC_MAIN_IRQ_CAUSE_OFS; 3068 3075 hpriv->main_irq_mask_addr = mmio + PCI_HC_MAIN_IRQ_MASK_OFS; 3069 3076 } 3077 + 3078 + /* initialize shadow irq mask with register's value */ 3079 + hpriv->main_irq_mask = readl(hpriv->main_irq_mask_addr); 3070 3080 3071 3081 /* global interrupt mask: 0 == mask everything */ 3072 3082 mv_set_main_irq_mask(host, ~0, 0); ··· 3426 3430 if (rc) 3427 3431 return rc; 3428 3432 3429 - /* Enable interrupts */ 3430 - if (msi && pci_enable_msi(pdev)) 3431 - pci_intx(pdev, 1); 3433 + /* Enable message-switched interrupts, if requested */ 3434 + if (msi && pci_enable_msi(pdev) == 0) 3435 + hpriv->hp_flags |= MV_HP_FLAG_MSI; 3432 3436 3433 3437 mv_dump_pci_cfg(pdev, 0x68); 3434 3438 mv_print_info(host);
+43 -27
drivers/ata/sata_nv.c
··· 305 305 static int nv_scr_read(struct ata_link *link, unsigned int sc_reg, u32 *val); 306 306 static int nv_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val); 307 307 308 + static int nv_noclassify_hardreset(struct ata_link *link, unsigned int *class, 309 + unsigned long deadline); 308 310 static void nv_nf2_freeze(struct ata_port *ap); 309 311 static void nv_nf2_thaw(struct ata_port *ap); 310 - static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class, 311 - unsigned long deadline); 312 312 static void nv_ck804_freeze(struct ata_port *ap); 313 313 static void nv_ck804_thaw(struct ata_port *ap); 314 314 static int nv_adma_slave_config(struct scsi_device *sdev); ··· 352 352 NFORCE3 = NFORCE2, /* NF2 == NF3 as far as sata_nv is concerned */ 353 353 CK804, 354 354 ADMA, 355 + MCP5x, 355 356 SWNCQ, 356 357 }; 357 358 ··· 364 363 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2), CK804 }, 365 364 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA), CK804 }, 366 365 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2), CK804 }, 367 - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA), SWNCQ }, 368 - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), SWNCQ }, 369 - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), SWNCQ }, 370 - { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), SWNCQ }, 366 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA), MCP5x }, 367 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2), MCP5x }, 368 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA), MCP5x }, 369 + { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2), MCP5x }, 371 370 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC }, 372 371 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC }, 373 372 { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC }, ··· 433 432 .inherits = &nv_common_ops, 434 433 .freeze = nv_nf2_freeze, 435 434 .thaw = nv_nf2_thaw, 436 - .hardreset = nv_nf2_hardreset, 435 + .hardreset = nv_noclassify_hardreset, 437 436 }; 438 437 439 438 /* CK804 finally gets hardreset right */ ··· 468 467 .host_stop = nv_adma_host_stop, 469 468 }; 470 469 470 + /* Kernel bz#12351 reports that when SWNCQ is enabled, for hotplug to 471 + * work, hardreset should be used and hardreset can't report proper 472 + * signature, which suggests that mcp5x is closer to nf2 as long as 473 + * reset quirkiness is concerned. Define separate ops for mcp5x with 474 + * nv_noclassify_hardreset(). 475 + */ 476 + static struct ata_port_operations nv_mcp5x_ops = { 477 + .inherits = &nv_common_ops, 478 + .hardreset = nv_noclassify_hardreset, 479 + }; 480 + 471 481 static struct ata_port_operations nv_swncq_ops = { 472 - .inherits = &nv_generic_ops, 482 + .inherits = &nv_mcp5x_ops, 473 483 474 484 .qc_defer = ata_std_qc_defer, 475 485 .qc_prep = nv_swncq_qc_prep, ··· 542 530 .udma_mask = NV_UDMA_MASK, 543 531 .port_ops = &nv_adma_ops, 544 532 .private_data = NV_PI_PRIV(nv_adma_interrupt, &nv_adma_sht), 533 + }, 534 + /* MCP5x */ 535 + { 536 + .flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY, 537 + .pio_mask = NV_PIO_MASK, 538 + .mwdma_mask = NV_MWDMA_MASK, 539 + .udma_mask = NV_UDMA_MASK, 540 + .port_ops = &nv_mcp5x_ops, 541 + .private_data = NV_PI_PRIV(nv_generic_interrupt, &nv_sht), 545 542 }, 546 543 /* SWNCQ */ 547 544 { ··· 1551 1530 return 0; 1552 1531 } 1553 1532 1533 + static int nv_noclassify_hardreset(struct ata_link *link, unsigned int *class, 1534 + unsigned long deadline) 1535 + { 1536 + bool online; 1537 + int rc; 1538 + 1539 + rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, 1540 + &online, NULL); 1541 + return online ? -EAGAIN : rc; 1542 + } 1543 + 1554 1544 static void nv_nf2_freeze(struct ata_port *ap) 1555 1545 { 1556 1546 void __iomem *scr_addr = ap->host->ports[0]->ioaddr.scr_addr; ··· 1584 1552 mask = ioread8(scr_addr + NV_INT_ENABLE); 1585 1553 mask |= (NV_INT_MASK << shift); 1586 1554 iowrite8(mask, scr_addr + NV_INT_ENABLE); 1587 - } 1588 - 1589 - static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class, 1590 - unsigned long deadline) 1591 - { 1592 - bool online; 1593 - int rc; 1594 - 1595 - rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, 1596 - &online, NULL); 1597 - return online ? -EAGAIN : rc; 1598 1555 } 1599 1556 1600 1557 static void nv_ck804_freeze(struct ata_port *ap) ··· 2376 2355 if (type == CK804 && adma_enabled) { 2377 2356 dev_printk(KERN_NOTICE, &pdev->dev, "Using ADMA mode\n"); 2378 2357 type = ADMA; 2379 - } 2380 - 2381 - if (type == SWNCQ) { 2382 - if (swncq_enabled) 2383 - dev_printk(KERN_NOTICE, &pdev->dev, 2384 - "Using SWNCQ mode\n"); 2385 - else 2386 - type = GENERIC; 2358 + } else if (type == MCP5x && swncq_enabled) { 2359 + dev_printk(KERN_NOTICE, &pdev->dev, "Using SWNCQ mode\n"); 2360 + type = SWNCQ; 2387 2361 } 2388 2362 2389 2363 ppi[0] = &nv_port_info[type];
+4
include/linux/pci_ids.h
··· 1357 1357 #define PCI_DEVICE_ID_VIA_8783_0 0x3208 1358 1358 #define PCI_DEVICE_ID_VIA_8237 0x3227 1359 1359 #define PCI_DEVICE_ID_VIA_8251 0x3287 1360 + #define PCI_DEVICE_ID_VIA_8261 0x3402 1360 1361 #define PCI_DEVICE_ID_VIA_8237A 0x3337 1361 1362 #define PCI_DEVICE_ID_VIA_8237S 0x3372 1362 1363 #define PCI_DEVICE_ID_VIA_SATA_EIDE 0x5324 ··· 1367 1366 #define PCI_DEVICE_ID_VIA_CX700 0x8324 1368 1367 #define PCI_DEVICE_ID_VIA_CX700_IDE 0x0581 1369 1368 #define PCI_DEVICE_ID_VIA_VX800 0x8353 1369 + #define PCI_DEVICE_ID_VIA_VX855 0x8409 1370 1370 #define PCI_DEVICE_ID_VIA_8371_1 0x8391 1371 1371 #define PCI_DEVICE_ID_VIA_82C598_1 0x8598 1372 1372 #define PCI_DEVICE_ID_VIA_838X_1 0xB188 1373 1373 #define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198 1374 + #define PCI_DEVICE_ID_VIA_C409_IDE 0XC409 1375 + #define PCI_DEVICE_ID_VIA_ANON 0xFFFF 1374 1376 1375 1377 #define PCI_VENDOR_ID_SIEMENS 0x110A 1376 1378 #define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102