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 '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:
sata_nv: reinstate nv_hardreset() for non generic controllers

+40 -6
+40 -6
drivers/ata/sata_nv.c
··· 309 309 static void nv_nf2_thaw(struct ata_port *ap); 310 310 static void nv_ck804_freeze(struct ata_port *ap); 311 311 static void nv_ck804_thaw(struct ata_port *ap); 312 + static int nv_hardreset(struct ata_link *link, unsigned int *class, 313 + unsigned long deadline); 312 314 static int nv_adma_slave_config(struct scsi_device *sdev); 313 315 static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc); 314 316 static void nv_adma_qc_prep(struct ata_queued_cmd *qc); ··· 405 403 .slave_configure = nv_swncq_slave_config, 406 404 }; 407 405 408 - static struct ata_port_operations nv_generic_ops = { 406 + /* OSDL bz3352 reports that some nv controllers can't determine device 407 + * signature reliably and nv_hardreset is implemented to work around 408 + * the problem. This was reported on nf3 and it's unclear whether any 409 + * other controllers are affected. However, the workaround has been 410 + * applied to all variants and there isn't much to gain by trying to 411 + * find out exactly which ones are affected at this point especially 412 + * because NV has moved over to ahci for newer controllers. 413 + */ 414 + static struct ata_port_operations nv_common_ops = { 409 415 .inherits = &ata_bmdma_port_ops, 410 - .hardreset = ATA_OP_NULL, 416 + .hardreset = nv_hardreset, 411 417 .scr_read = nv_scr_read, 412 418 .scr_write = nv_scr_write, 413 419 }; 414 420 421 + /* OSDL bz11195 reports that link doesn't come online after hardreset 422 + * on generic nv's and there have been several other similar reports 423 + * on linux-ide. Disable hardreset for generic nv's. 424 + */ 425 + static struct ata_port_operations nv_generic_ops = { 426 + .inherits = &nv_common_ops, 427 + .hardreset = ATA_OP_NULL, 428 + }; 429 + 415 430 static struct ata_port_operations nv_nf2_ops = { 416 - .inherits = &nv_generic_ops, 431 + .inherits = &nv_common_ops, 417 432 .freeze = nv_nf2_freeze, 418 433 .thaw = nv_nf2_thaw, 419 434 }; 420 435 421 436 static struct ata_port_operations nv_ck804_ops = { 422 - .inherits = &nv_generic_ops, 437 + .inherits = &nv_common_ops, 423 438 .freeze = nv_ck804_freeze, 424 439 .thaw = nv_ck804_thaw, 425 440 .host_stop = nv_ck804_host_stop, 426 441 }; 427 442 428 443 static struct ata_port_operations nv_adma_ops = { 429 - .inherits = &nv_generic_ops, 444 + .inherits = &nv_common_ops, 430 445 431 446 .check_atapi_dma = nv_adma_check_atapi_dma, 432 447 .sff_tf_read = nv_adma_tf_read, ··· 467 448 }; 468 449 469 450 static struct ata_port_operations nv_swncq_ops = { 470 - .inherits = &nv_generic_ops, 451 + .inherits = &nv_common_ops, 471 452 472 453 .qc_defer = ata_std_qc_defer, 473 454 .qc_prep = nv_swncq_qc_prep, ··· 1603 1584 mask |= (NV_INT_MASK_MCP55 << shift); 1604 1585 writel(mask, mmio_base + NV_INT_ENABLE_MCP55); 1605 1586 ata_sff_thaw(ap); 1587 + } 1588 + 1589 + static int nv_hardreset(struct ata_link *link, unsigned int *class, 1590 + unsigned long deadline) 1591 + { 1592 + int rc; 1593 + 1594 + /* SATA hardreset fails to retrieve proper device signature on 1595 + * some controllers. Request follow up SRST. For more info, 1596 + * see http://bugzilla.kernel.org/show_bug.cgi?id=3352 1597 + */ 1598 + rc = sata_sff_hardreset(link, class, deadline); 1599 + if (rc) 1600 + return rc; 1601 + return -EAGAIN; 1606 1602 } 1607 1603 1608 1604 static void nv_adma_error_handler(struct ata_port *ap)