diff options
-rw-r--r-- | drivers/scsi/ahci.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index ee00aed9bdea..e02b9c65287b 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c | |||
@@ -406,32 +406,15 @@ static void ahci_scr_write (struct ata_port *ap, unsigned int sc_reg_in, | |||
406 | writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4)); | 406 | writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4)); |
407 | } | 407 | } |
408 | 408 | ||
409 | static int ahci_start_engine(void __iomem *port_mmio) | 409 | static void ahci_start_engine(void __iomem *port_mmio) |
410 | { | 410 | { |
411 | u32 tmp; | 411 | u32 tmp; |
412 | 412 | ||
413 | /* get current status */ | ||
414 | tmp = readl(port_mmio + PORT_CMD); | ||
415 | |||
416 | /* AHCI rev 1.1 section 10.3.1: | ||
417 | * Software shall not set PxCMD.ST to '1' until it verifies | ||
418 | * that PxCMD.CR is '0' and has set PxCMD.FRE to '1' | ||
419 | */ | ||
420 | if ((tmp & PORT_CMD_FIS_RX) == 0) | ||
421 | return -EPERM; | ||
422 | |||
423 | /* wait for engine to become idle */ | ||
424 | tmp = ata_wait_register(port_mmio + PORT_CMD, | ||
425 | PORT_CMD_LIST_ON, PORT_CMD_LIST_ON, 1,500); | ||
426 | if (tmp & PORT_CMD_LIST_ON) | ||
427 | return -EBUSY; | ||
428 | |||
429 | /* start DMA */ | 413 | /* start DMA */ |
414 | tmp = readl(port_mmio + PORT_CMD); | ||
430 | tmp |= PORT_CMD_START; | 415 | tmp |= PORT_CMD_START; |
431 | writel(tmp, port_mmio + PORT_CMD); | 416 | writel(tmp, port_mmio + PORT_CMD); |
432 | readl(port_mmio + PORT_CMD); /* flush */ | 417 | readl(port_mmio + PORT_CMD); /* flush */ |
433 | |||
434 | return 0; | ||
435 | } | 418 | } |
436 | 419 | ||
437 | static int ahci_stop_engine(void __iomem *port_mmio) | 420 | static int ahci_stop_engine(void __iomem *port_mmio) |