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