* [PATCH 4/5] ahci: update new users of new added functions
@ 2006-07-20 5:21 zhao, forrest
0 siblings, 0 replies; only message in thread
From: zhao, forrest @ 2006-07-20 5:21 UTC (permalink / raw)
To: jgarzik, htejun, hare, axboe; +Cc: linux-ide
1 Use ahci_start_fis_rx(), ahci_port_spinup(), ahci_start_engine() in
ahci_port_start()
2 Use ahci_stop_engine(), ahci_stop_fis_rx() in ahci_host_init()
Signed-off-by: Forrest Zhao <forrest.zhao@intel.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Jens Axboe <axboe@suse.de>
---
drivers/scsi/ahci.c | 50 ++++++++++++++++++++++
+---------------------------
1 files changed, 23 insertions(+), 27 deletions(-)
9c57dea5678c608c5257ad2e6a363c52fd563ca8
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c
index 50d0183..5e04ef4 100644
--- a/drivers/scsi/ahci.c
+++ b/drivers/scsi/ahci.c
@@ -442,20 +442,20 @@ static int ahci_port_start(struct ata_po
ap->private_data = pp;
- if (hpriv->cap & HOST_CAP_64)
- writel((pp->cmd_slot_dma >> 16) >> 16, port_mmio +
PORT_LST_ADDR_HI);
- writel(pp->cmd_slot_dma & 0xffffffff, port_mmio +
PORT_LST_ADDR);
- readl(port_mmio + PORT_LST_ADDR); /* flush */
-
- if (hpriv->cap & HOST_CAP_64)
- writel((pp->rx_fis_dma >> 16) >> 16, port_mmio +
PORT_FIS_ADDR_HI);
- writel(pp->rx_fis_dma & 0xffffffff, port_mmio + PORT_FIS_ADDR);
- readl(port_mmio + PORT_FIS_ADDR); /* flush */
+ /*
+ * Driver is setup; initialize the HBA
+ */
+ ahci_start_fis_rx(port_mmio, pp, hpriv);
- writel(PORT_CMD_ICC_ACTIVE | PORT_CMD_FIS_RX |
- PORT_CMD_POWER_ON | PORT_CMD_SPIN_UP |
- PORT_CMD_START, port_mmio + PORT_CMD);
- readl(port_mmio + PORT_CMD); /* flush */
+ rc = ahci_port_spinup(port_mmio, hpriv->cap);
+ if (rc)
+ ata_port_printk(ap, KERN_WARNING,
+ "Could not spinup port (%d)\n", rc);
+
+ rc = ahci_start_engine(port_mmio);
+ if (rc)
+ ata_port_printk(ap, KERN_WARNING, "Could not start DMA
engine"
+ "of port (%d)\n", rc);
return 0;
}
@@ -1411,20 +1411,16 @@ static int ahci_host_init(struct ata_pro
(unsigned long) mmio, i);
/* make sure port is not active */
- tmp = readl(port_mmio + PORT_CMD);
- VPRINTK("PORT_CMD 0x%x\n", tmp);
- if (tmp & (PORT_CMD_LIST_ON | PORT_CMD_FIS_ON |
- PORT_CMD_FIS_RX | PORT_CMD_START)) {
- tmp &= ~(PORT_CMD_LIST_ON | PORT_CMD_FIS_ON |
- PORT_CMD_FIS_RX | PORT_CMD_START);
- writel(tmp, port_mmio + PORT_CMD);
- readl(port_mmio + PORT_CMD); /* flush */
-
- /* spec says 500 msecs for each bit, so
- * this is slightly incorrect.
- */
- msleep(500);
- }
+
+ rc = ahci_stop_engine(port_mmio);
+ if (rc)
+ printk(KERN_WARNING "ata%u: DMA engine busy (%d)
\n",
+ i, rc);
+
+ rc = ahci_stop_fis_rx(port_mmio);
+ if (rc)
+ printk(KERN_WARNING "ata%u: FIS RX not stopped
(%d)\n",
+ i, rc);
writel(PORT_CMD_SPIN_UP, port_mmio + PORT_CMD);
--
1.2.6
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2006-07-20 5:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-20 5:21 [PATCH 4/5] ahci: update new users of new added functions zhao, forrest
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).