aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorThang Q. Nguyen <tqnguyen@apm.com>2012-04-17 04:43:13 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-07-25 15:13:53 -0400
commit3a8b788f61a5b85f3a3a4630dc5f4c13b91e1bba (patch)
tree6424c2e9b394548f9ffd279910ccfc4305c402d4 /drivers/ata
parent2fc75da0c59634b81223af497c4a037822f6e457 (diff)
sata_dwc_460ex: support hardreset
The hardreset operation is currently not supported. This causes sometime the SATA driver does cause kernel crash because of none-determined state.a This patch will fix the issue. Signed-off-by: Thang Q. Nguyen <tqnguyen@apm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_dwc_460ex.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 69f7cde49c6..ae13ef1945b 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -1581,10 +1581,31 @@ static void sata_dwc_qc_prep(struct ata_queued_cmd *qc)
1581 1581
1582static void sata_dwc_error_handler(struct ata_port *ap) 1582static void sata_dwc_error_handler(struct ata_port *ap)
1583{ 1583{
1584 ap->link.flags |= ATA_LFLAG_NO_HRST;
1585 ata_sff_error_handler(ap); 1584 ata_sff_error_handler(ap);
1586} 1585}
1587 1586
1587int sata_dwc_hardreset(struct ata_link *link, unsigned int *class,
1588 unsigned long deadline)
1589{
1590 struct sata_dwc_device *hsdev = HSDEV_FROM_AP(link->ap);
1591 int ret;
1592
1593 ret = sata_sff_hardreset(link, class, deadline);
1594
1595 sata_dwc_enable_interrupts(hsdev);
1596
1597 /* Reconfigure the DMA control register */
1598 out_le32(&hsdev->sata_dwc_regs->dmacr,
1599 SATA_DWC_DMACR_TXRXCH_CLEAR);
1600
1601 /* Reconfigure the DMA Burst Transaction Size register */
1602 out_le32(&hsdev->sata_dwc_regs->dbtsr,
1603 SATA_DWC_DBTSR_MWR(AHB_DMA_BRST_DFLT) |
1604 SATA_DWC_DBTSR_MRD(AHB_DMA_BRST_DFLT));
1605
1606 return ret;
1607}
1608
1588/* 1609/*
1589 * scsi mid-layer and libata interface structures 1610 * scsi mid-layer and libata interface structures
1590 */ 1611 */
@@ -1604,6 +1625,7 @@ static struct ata_port_operations sata_dwc_ops = {
1604 .inherits = &ata_sff_port_ops, 1625 .inherits = &ata_sff_port_ops,
1605 1626
1606 .error_handler = sata_dwc_error_handler, 1627 .error_handler = sata_dwc_error_handler,
1628 .hardreset = sata_dwc_hardreset,
1607 1629
1608 .qc_prep = sata_dwc_qc_prep, 1630 .qc_prep = sata_dwc_qc_prep,
1609 .qc_issue = sata_dwc_qc_issue, 1631 .qc_issue = sata_dwc_qc_issue,