* [PATCH] kill @force_restart and refine CLO for ahci_kick_engine()
@ 2009-08-07 7:05 Shane Huang
2009-08-07 7:58 ` Tejun Heo
0 siblings, 1 reply; 3+ messages in thread
From: Shane Huang @ 2009-08-07 7:05 UTC (permalink / raw)
To: jgarzik; +Cc: linux-ide, tj, Huang, Shane
This patch refines ahci_kick_engine() after discussion with Tejun about
FBS(FIS-based switching) support preparation:
a. Kill @force_restart and always kick the engine. The only case where
@force_restart is zero is when it's called from ahci_p5wdh_hardreset()
Actually at that point, BSY is pretty much guaranteed to be set.
b. If PMP is attached, ignore busy and always do CLO. (AHCI-1.3 9.2)
Signed-off-by: Shane Huang <shane.huang@amd.com>
Cc: Tejun Heo <tj@kernel.org>
diff -ruN a/drivers/ata/ahci.c b/drivers/ata/ahci.c
--- a/drivers/ata/ahci.c 2009-07-29 14:38:39.000000000 +0800
+++ b/drivers/ata/ahci.c 2009-08-06 17:36:59.000000000 +0800
@@ -1578,7 +1578,7 @@
pp->cmd_slot[tag].tbl_addr_hi = cpu_to_le32((cmd_tbl_dma >> 16) >> 16);
}
-static int ahci_kick_engine(struct ata_port *ap, int force_restart)
+static int ahci_kick_engine(struct ata_port *ap)
{
void __iomem *port_mmio = ahci_port_base(ap);
struct ahci_host_priv *hpriv = ap->host->private_data;
@@ -1586,18 +1586,16 @@
u32 tmp;
int busy, rc;
- /* do we need to kick the port? */
- busy = status & (ATA_BUSY | ATA_DRQ);
- if (!busy && !force_restart)
- return 0;
-
/* stop engine */
rc = ahci_stop_engine(ap);
if (rc)
goto out_restart;
- /* need to do CLO? */
- if (!busy) {
+ /* need to do CLO?
+ * always do CLO if PMP is attached (AHCI-1.3 9.2)
+ */
+ busy = status & (ATA_BUSY | ATA_DRQ);
+ if (!busy && !sata_pmp_attached(ap)) {
rc = 0;
goto out_restart;
}
@@ -1645,7 +1643,7 @@
tmp = ata_wait_register(port_mmio + PORT_CMD_ISSUE, 0x1, 0x1,
1, timeout_msec);
if (tmp & 0x1) {
- ahci_kick_engine(ap, 1);
+ ahci_kick_engine(ap);
return -EBUSY;
}
} else
@@ -1667,7 +1665,7 @@
DPRINTK("ENTER\n");
/* prepare for SRST (AHCI-1.1 10.4.1) */
- rc = ahci_kick_engine(ap, 1);
+ rc = ahci_kick_engine(ap);
if (rc && rc != -EOPNOTSUPP)
ata_link_printk(link, KERN_WARNING,
"failed to reset engine (errno=%d)\n", rc);
@@ -1873,7 +1871,7 @@
rc = ata_wait_after_reset(link, jiffies + 2 * HZ,
ahci_check_ready);
if (rc)
- ahci_kick_engine(ap, 0);
+ ahci_kick_engine(ap);
}
return rc;
}
@@ -2254,7 +2252,7 @@
/* make DMA engine forget about the failed command */
if (qc->flags & ATA_QCFLAG_FAILED)
- ahci_kick_engine(ap, 1);
+ ahci_kick_engine(ap);
}
static void ahci_pmp_attach(struct ata_port *ap)
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] kill @force_restart and refine CLO for ahci_kick_engine()
2009-08-07 7:05 [PATCH] kill @force_restart and refine CLO for ahci_kick_engine() Shane Huang
@ 2009-08-07 7:58 ` Tejun Heo
2009-08-07 8:04 ` Huang, Shane
0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2009-08-07 7:58 UTC (permalink / raw)
To: shane.huang; +Cc: jgarzik, linux-ide
Hello, Shane.
Please make the subject look like,
[PATCH #upstream] ahci: kill @force_restart....
Shane Huang wrote:
> This patch refines ahci_kick_engine() after discussion with Tejun about
> FBS(FIS-based switching) support preparation:
> a. Kill @force_restart and always kick the engine. The only case where
> @force_restart is zero is when it's called from ahci_p5wdh_hardreset()
> Actually at that point, BSY is pretty much guaranteed to be set.
> b. If PMP is attached, ignore busy and always do CLO. (AHCI-1.3 9.2)
>
> Signed-off-by: Shane Huang <shane.huang@amd.com>
> Cc: Tejun Heo <tj@kernel.org>
And put the followings here
---
DIFFSTAT OUTPUT
>
> diff -ruN a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> --- a/drivers/ata/ahci.c 2009-07-29 14:38:39.000000000 +0800
> +++ b/drivers/ata/ahci.c 2009-08-06 17:36:59.000000000 +0800
> @@ -1578,7 +1578,7 @@
and use -p when generating diffs. It's usually best to generate diff
from a git tree.
Other than the above peripheral issues,
Acked-by: Tejun Heo <tj@kernel.org>
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] kill @force_restart and refine CLO for ahci_kick_engine()
2009-08-07 7:58 ` Tejun Heo
@ 2009-08-07 8:04 ` Huang, Shane
0 siblings, 0 replies; 3+ messages in thread
From: Huang, Shane @ 2009-08-07 8:04 UTC (permalink / raw)
To: Tejun Heo; +Cc: jgarzik, linux-ide, Huang, Shane
Tejun,
> -----Original Message-----
> From: Tejun Heo [mailto:tj@kernel.org]
>
> Please make the subject look like,
>
> [PATCH #upstream] ahci: kill @force_restart....
>
> Shane Huang wrote:
> > This patch refines ahci_kick_engine() after discussion with
> Tejun about
> > FBS(FIS-based switching) support preparation:
> > a. Kill @force_restart and always kick the engine. The only
> case where
> > @force_restart is zero is when it's called from
> ahci_p5wdh_hardreset()
> > Actually at that point, BSY is pretty much guaranteed to be set.
> > b. If PMP is attached, ignore busy and always do CLO. (AHCI-1.3 9.2)
> >
> > Signed-off-by: Shane Huang <shane.huang@amd.com>
> > Cc: Tejun Heo <tj@kernel.org>
>
> And put the followings here
> ---
> DIFFSTAT OUTPUT
>
> >
> > diff -ruN a/drivers/ata/ahci.c b/drivers/ata/ahci.c
> > --- a/drivers/ata/ahci.c 2009-07-29 14:38:39.000000000 +0800
> > +++ b/drivers/ata/ahci.c 2009-08-06 17:36:59.000000000 +0800
> > @@ -1578,7 +1578,7 @@
>
> and use -p when generating diffs. It's usually best to generate diff
> from a git tree.
>
> Other than the above peripheral issues,
>
> Acked-by: Tejun Heo <tj@kernel.org>
OK, I will follow your suggestions next time when I submit patches,
for this patch, I will not re-submit.
Thanks
Shane
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-08-07 8:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07 7:05 [PATCH] kill @force_restart and refine CLO for ahci_kick_engine() Shane Huang
2009-08-07 7:58 ` Tejun Heo
2009-08-07 8:04 ` Huang, Shane
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.