|
Lines 307-316
static int nv_scr_write(struct ata_link *link, unsigned int sc_reg, u32 val);
Link Here
|
| 307 |
|
307 |
|
| 308 |
static void nv_nf2_freeze(struct ata_port *ap); |
308 |
static void nv_nf2_freeze(struct ata_port *ap); |
| 309 |
static void nv_nf2_thaw(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); |
| 310 |
static void nv_ck804_freeze(struct ata_port *ap); |
312 |
static void nv_ck804_freeze(struct ata_port *ap); |
| 311 |
static void nv_ck804_thaw(struct ata_port *ap); |
313 |
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); |
| 314 |
static int nv_adma_slave_config(struct scsi_device *sdev); |
314 |
static int nv_adma_slave_config(struct scsi_device *sdev); |
| 315 |
static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc); |
315 |
static int nv_adma_check_atapi_dma(struct ata_queued_cmd *qc); |
| 316 |
static void nv_adma_qc_prep(struct ata_queued_cmd *qc); |
316 |
static void nv_adma_qc_prep(struct ata_queued_cmd *qc); |
|
Lines 405-421
static struct scsi_host_template nv_swncq_sht = {
Link Here
|
| 405 |
.slave_configure = nv_swncq_slave_config, |
405 |
.slave_configure = nv_swncq_slave_config, |
| 406 |
}; |
406 |
}; |
| 407 |
|
407 |
|
| 408 |
/* OSDL bz3352 reports that some nv controllers can't determine device |
|
|
| 409 |
* signature reliably and nv_hardreset is implemented to work around |
| 410 |
* the problem. This was reported on nf3 and it's unclear whether any |
| 411 |
* other controllers are affected. However, the workaround has been |
| 412 |
* applied to all variants and there isn't much to gain by trying to |
| 413 |
* find out exactly which ones are affected at this point especially |
| 414 |
* because NV has moved over to ahci for newer controllers. |
| 415 |
*/ |
| 416 |
static struct ata_port_operations nv_common_ops = { |
408 |
static struct ata_port_operations nv_common_ops = { |
| 417 |
.inherits = &ata_bmdma_port_ops, |
409 |
.inherits = &ata_bmdma_port_ops, |
| 418 |
.hardreset = nv_hardreset, |
|
|
| 419 |
.scr_read = nv_scr_read, |
410 |
.scr_read = nv_scr_read, |
| 420 |
.scr_write = nv_scr_write, |
411 |
.scr_write = nv_scr_write, |
| 421 |
}; |
412 |
}; |
|
Lines 429-440
static struct ata_port_operations nv_generic_ops = {
Link Here
|
| 429 |
.hardreset = ATA_OP_NULL, |
420 |
.hardreset = ATA_OP_NULL, |
| 430 |
}; |
421 |
}; |
| 431 |
|
422 |
|
|
|
423 |
/* OSDL bz3352 reports that nf2/3 controllers can't determine device |
| 424 |
* signature reliably. Use sata_std_hardreset(). |
| 425 |
*/ |
| 432 |
static struct ata_port_operations nv_nf2_ops = { |
426 |
static struct ata_port_operations nv_nf2_ops = { |
| 433 |
.inherits = &nv_common_ops, |
427 |
.inherits = &nv_common_ops, |
| 434 |
.freeze = nv_nf2_freeze, |
428 |
.freeze = nv_nf2_freeze, |
| 435 |
.thaw = nv_nf2_thaw, |
429 |
.thaw = nv_nf2_thaw, |
|
|
430 |
.hardreset = nv_nf2_hardreset, |
| 436 |
}; |
431 |
}; |
| 437 |
|
432 |
|
|
|
433 |
/* CK804 finally gets hardreset right */ |
| 438 |
static struct ata_port_operations nv_ck804_ops = { |
434 |
static struct ata_port_operations nv_ck804_ops = { |
| 439 |
.inherits = &nv_common_ops, |
435 |
.inherits = &nv_common_ops, |
| 440 |
.freeze = nv_ck804_freeze, |
436 |
.freeze = nv_ck804_freeze, |
|
Lines 443-449
static struct ata_port_operations nv_ck804_ops = {
Link Here
|
| 443 |
}; |
439 |
}; |
| 444 |
|
440 |
|
| 445 |
static struct ata_port_operations nv_adma_ops = { |
441 |
static struct ata_port_operations nv_adma_ops = { |
| 446 |
.inherits = &nv_common_ops, |
442 |
.inherits = &nv_ck804_ops, |
| 447 |
|
443 |
|
| 448 |
.check_atapi_dma = nv_adma_check_atapi_dma, |
444 |
.check_atapi_dma = nv_adma_check_atapi_dma, |
| 449 |
.sff_tf_read = nv_adma_tf_read, |
445 |
.sff_tf_read = nv_adma_tf_read, |
|
Lines 467-473
static struct ata_port_operations nv_adma_ops = {
Link Here
|
| 467 |
}; |
463 |
}; |
| 468 |
|
464 |
|
| 469 |
static struct ata_port_operations nv_swncq_ops = { |
465 |
static struct ata_port_operations nv_swncq_ops = { |
| 470 |
.inherits = &nv_common_ops, |
466 |
.inherits = &nv_generic_ops, |
| 471 |
|
467 |
|
| 472 |
.qc_defer = ata_std_qc_defer, |
468 |
.qc_defer = ata_std_qc_defer, |
| 473 |
.qc_prep = nv_swncq_qc_prep, |
469 |
.qc_prep = nv_swncq_qc_prep, |
|
Lines 1553-1558
static void nv_nf2_thaw(struct ata_port *ap)
Link Here
|
| 1553 |
iowrite8(mask, scr_addr + NV_INT_ENABLE); |
1549 |
iowrite8(mask, scr_addr + NV_INT_ENABLE); |
| 1554 |
} |
1550 |
} |
| 1555 |
|
1551 |
|
|
|
1552 |
static int nv_nf2_hardreset(struct ata_link *link, unsigned int *class, |
| 1553 |
unsigned long deadline) |
| 1554 |
{ |
| 1555 |
bool online; |
| 1556 |
int rc; |
| 1557 |
|
| 1558 |
rc = sata_link_hardreset(link, sata_deb_timing_hotplug, deadline, |
| 1559 |
&online, NULL); |
| 1560 |
return online ? -EAGAIN : rc; |
| 1561 |
} |
| 1562 |
|
| 1556 |
static void nv_ck804_freeze(struct ata_port *ap) |
1563 |
static void nv_ck804_freeze(struct ata_port *ap) |
| 1557 |
{ |
1564 |
{ |
| 1558 |
void __iomem *mmio_base = ap->host->iomap[NV_MMIO_BAR]; |
1565 |
void __iomem *mmio_base = ap->host->iomap[NV_MMIO_BAR]; |
|
Lines 1605-1625
static void nv_mcp55_thaw(struct ata_port *ap)
Link Here
|
| 1605 |
ata_sff_thaw(ap); |
1612 |
ata_sff_thaw(ap); |
| 1606 |
} |
1613 |
} |
| 1607 |
|
1614 |
|
| 1608 |
static int nv_hardreset(struct ata_link *link, unsigned int *class, |
|
|
| 1609 |
unsigned long deadline) |
| 1610 |
{ |
| 1611 |
int rc; |
| 1612 |
|
| 1613 |
/* SATA hardreset fails to retrieve proper device signature on |
| 1614 |
* some controllers. Request follow up SRST. For more info, |
| 1615 |
* see http://bugzilla.kernel.org/show_bug.cgi?id=3352 |
| 1616 |
*/ |
| 1617 |
rc = sata_sff_hardreset(link, class, deadline); |
| 1618 |
if (rc) |
| 1619 |
return rc; |
| 1620 |
return -EAGAIN; |
| 1621 |
} |
| 1622 |
|
| 1623 |
static void nv_adma_error_handler(struct ata_port *ap) |
1615 |
static void nv_adma_error_handler(struct ata_port *ap) |
| 1624 |
{ |
1616 |
{ |
| 1625 |
struct nv_adma_port_priv *pp = ap->private_data; |
1617 |
struct nv_adma_port_priv *pp = ap->private_data; |