mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
ahci: separate out ahci_do_softreset()
Separate out ahci_do_softreset() which takes @pmp as its last argument. This will be used to implement ahci_pmp_softreset(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
91c4a2e092
commit
a9cf5e8581
1 changed files with 10 additions and 4 deletions
|
@ -1023,8 +1023,8 @@ static int ahci_exec_polled_cmd(struct ata_port *ap, int pmp,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ahci_softreset(struct ata_port *ap, unsigned int *class,
|
static int ahci_do_softreset(struct ata_port *ap, unsigned int *class,
|
||||||
unsigned long deadline)
|
int pmp, unsigned long deadline)
|
||||||
{
|
{
|
||||||
const char *reason = NULL;
|
const char *reason = NULL;
|
||||||
unsigned long now, msecs;
|
unsigned long now, msecs;
|
||||||
|
@ -1054,7 +1054,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
|
||||||
msecs = jiffies_to_msecs(deadline - now);
|
msecs = jiffies_to_msecs(deadline - now);
|
||||||
|
|
||||||
tf.ctl |= ATA_SRST;
|
tf.ctl |= ATA_SRST;
|
||||||
if (ahci_exec_polled_cmd(ap, 0, &tf, 0,
|
if (ahci_exec_polled_cmd(ap, pmp, &tf, 0,
|
||||||
AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY, msecs)) {
|
AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY, msecs)) {
|
||||||
rc = -EIO;
|
rc = -EIO;
|
||||||
reason = "1st FIS failed";
|
reason = "1st FIS failed";
|
||||||
|
@ -1066,7 +1066,7 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
|
||||||
|
|
||||||
/* issue the second D2H Register FIS */
|
/* issue the second D2H Register FIS */
|
||||||
tf.ctl &= ~ATA_SRST;
|
tf.ctl &= ~ATA_SRST;
|
||||||
ahci_exec_polled_cmd(ap, 0, &tf, 0, 0, 0);
|
ahci_exec_polled_cmd(ap, pmp, &tf, 0, 0, 0);
|
||||||
|
|
||||||
/* spec mandates ">= 2ms" before checking status.
|
/* spec mandates ">= 2ms" before checking status.
|
||||||
* We wait 150ms, because that was the magic delay used for
|
* We wait 150ms, because that was the magic delay used for
|
||||||
|
@ -1094,6 +1094,12 @@ static int ahci_softreset(struct ata_port *ap, unsigned int *class,
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ahci_softreset(struct ata_port *ap, unsigned int *class,
|
||||||
|
unsigned long deadline)
|
||||||
|
{
|
||||||
|
return ahci_do_softreset(ap, class, 0, deadline);
|
||||||
|
}
|
||||||
|
|
||||||
static int ahci_hardreset(struct ata_port *ap, unsigned int *class,
|
static int ahci_hardreset(struct ata_port *ap, unsigned int *class,
|
||||||
unsigned long deadline)
|
unsigned long deadline)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue