Commit d8fcd116 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

[PATCH] ahci: cosmetic changes to ahci_start/stop_engine()

* fascist-format comments according to comment style used in libata
  core layer.

* if() -> if ()
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarZhao, Forrest <forrest.zhao@intel.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 254950cd
...@@ -410,30 +410,23 @@ static int ahci_start_engine(void __iomem *port_mmio) ...@@ -410,30 +410,23 @@ static int ahci_start_engine(void __iomem *port_mmio)
{ {
u32 tmp; u32 tmp;
/* /* get current status */
* Get current status
*/
tmp = readl(port_mmio + PORT_CMD); tmp = readl(port_mmio + PORT_CMD);
/* /* AHCI rev 1.1 section 10.3.1:
* AHCI rev 1.1 section 10.3.1:
* Software shall not set PxCMD.ST to '1' until it verifies * Software shall not set PxCMD.ST to '1' until it verifies
* that PxCMD.CR is '0' and has set PxCMD.FRE to '1' * that PxCMD.CR is '0' and has set PxCMD.FRE to '1'
*/ */
if ((tmp & PORT_CMD_FIS_RX) == 0) if ((tmp & PORT_CMD_FIS_RX) == 0)
return -EPERM; return -EPERM;
/* /* wait for engine to become idle */
* wait for engine to become idle.
*/
tmp = ata_wait_register(port_mmio + PORT_CMD, tmp = ata_wait_register(port_mmio + PORT_CMD,
PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1,500); PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1,500);
if(tmp & PORT_CMD_LIST_ON) if (tmp & PORT_CMD_LIST_ON)
return -EBUSY; return -EBUSY;
/* /* start DMA */
* Start DMA
*/
tmp |= PORT_CMD_START; tmp |= PORT_CMD_START;
writel(tmp, port_mmio + PORT_CMD); writel(tmp, port_mmio + PORT_CMD);
readl(port_mmio + PORT_CMD); /* flush */ readl(port_mmio + PORT_CMD); /* flush */
...@@ -447,20 +440,18 @@ static int ahci_stop_engine(void __iomem *port_mmio) ...@@ -447,20 +440,18 @@ static int ahci_stop_engine(void __iomem *port_mmio)
tmp = readl(port_mmio + PORT_CMD); tmp = readl(port_mmio + PORT_CMD);
/* Check if the HBA is idle */ /* check if the HBA is idle */
if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0) if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0)
return 0; return 0;
/* Setting HBA to idle */ /* setting HBA to idle */
tmp &= ~PORT_CMD_START; tmp &= ~PORT_CMD_START;
writel(tmp, port_mmio + PORT_CMD); writel(tmp, port_mmio + PORT_CMD);
/* wait for engine to stop. This could be /* wait for engine to stop. This could be as long as 500 msec */
* as long as 500 msec
*/
tmp = ata_wait_register(port_mmio + PORT_CMD, tmp = ata_wait_register(port_mmio + PORT_CMD,
PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500); PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1, 500);
if(tmp & PORT_CMD_LIST_ON) if (tmp & PORT_CMD_LIST_ON)
return -EIO; return -EIO;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment