Patchwork ata: increase retry count but shorten duration for Calxeda controller

login
register
mail settings
Submitter Mark Langsdorf
Date May 29, 2013, 3:51 p.m.
Message ID <1369842679-9680-1-git-send-email-mark.langsdorf@calxeda.com>
Download mbox | patch
Permalink /patch/247296/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Mark Langsdorf - May 29, 2013, 3:51 p.m.
The Calxeda SATA phy intermittently fails to bring up a link with Gen3
Retrying the phy hard reset can work around the issue, but the drive
may fail again. In less than 150 out of 15000 test runs, it took more
than 10 tries for the link to be established (but never more than 35).
Increase the retry count to guarantee the link is established.

Also, the default 2 second time-out on a failed drive is too long in
this situation. Shorten it to 500 ms. This was also tested 15000 times
on 24 drives and none of them experienced a time out.

Signed-off-by: Mark Langsdorf <mark.langsdorf@calxeda.com>
---
 drivers/ata/sata_highbank.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Timur Tabi - May 29, 2013, 8:12 p.m.
On Wed, May 29, 2013 at 10:51 AM, Mark Langsdorf
<mark.langsdorf@calxeda.com> wrote:
>
>  {
> -       const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
> +       unsigned long timing[] = { 5, 100, 500};


You didn't address my comments the last time you posted this.  I'll
post them again:


Why are you dropping the 'const'?

Assuming it works, this should be more efficient:

static const unsigned long timing[] = {5, 100, 500};
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Langsdorf - May 29, 2013, 8:35 p.m.
On 05/29/2013 03:12 PM, Timur Tabi wrote:
> On Wed, May 29, 2013 at 10:51 AM, Mark Langsdorf
> <mark.langsdorf@calxeda.com> wrote:
>>
>>  {
>> -       const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
>> +       unsigned long timing[] = { 5, 100, 500};
> 
> 
> You didn't address my comments the last time you posted this.  I'll
> post them again:
> 
> 
> Why are you dropping the 'const'?
> 
> Assuming it works, this should be more efficient:
> 
> static const unsigned long timing[] = {5, 100, 500};

I thought there was a compile issue, but I just rechecked and there
wasn't. I'll fix for the next submission.

Thanks for the review.

--Mark Langsdorf

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo - May 30, 2013, 6:58 a.m.
On Wed, May 29, 2013 at 03:35:28PM -0500, Mark Langsdorf wrote:
> On 05/29/2013 03:12 PM, Timur Tabi wrote:
> > On Wed, May 29, 2013 at 10:51 AM, Mark Langsdorf
> > <mark.langsdorf@calxeda.com> wrote:
> >>
> >>  {
> >> -       const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
> >> +       unsigned long timing[] = { 5, 100, 500};
> > 
> > 
> > You didn't address my comments the last time you posted this.  I'll
> > post them again:
> > 
> > 
> > Why are you dropping the 'const'?
> > 
> > Assuming it works, this should be more efficient:
> > 
> > static const unsigned long timing[] = {5, 100, 500};
> 
> I thought there was a compile issue, but I just rechecked and there
> wasn't. I'll fix for the next submission.

Also, please add a comment explaining why those parameters are
necessary and how they're determined - ie. the bulk of the commit
message; otherwise, it looks pretty random.

Thanks.

Patch

diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c
index 0d7c4c2..536936f 100644
--- a/drivers/ata/sata_highbank.c
+++ b/drivers/ata/sata_highbank.c
@@ -199,7 +199,7 @@  static int highbank_initialize_phys(struct device *dev, void __iomem *addr)
 static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class,
 				unsigned long deadline)
 {
-	const unsigned long *timing = sata_ehc_deb_timing(&link->eh_context);
+	unsigned long timing[] = { 5, 100, 500};
 	struct ata_port *ap = link->ap;
 	struct ahci_port_priv *pp = ap->private_data;
 	u8 *d2h_fis = pp->rx_fis + RX_FIS_D2H_REG;
@@ -207,7 +207,7 @@  static int ahci_highbank_hardreset(struct ata_link *link, unsigned int *class,
 	bool online;
 	u32 sstatus;
 	int rc;
-	int retry = 10;
+	int retry = 100;
 
 	ahci_stop_engine(ap);