Patchwork libata: clear error mask of old error history

login
register
mail settings
Submitter Lin Ming
Date April 20, 2012, 1:38 a.m.
Message ID <1334885938.4927.11.camel@minggr>
Download mbox | patch
Permalink /patch/153903/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Lin Ming - April 20, 2012, 1:38 a.m.
The old error history was cleared in ata_ering_clear().
It only sets ATA_EFLAG_OLD_ER eflags, but the err_mask was not cleared.
So ata_ering_map() still iterates the old error history.

This causes problem, for example, wrong probe trials count were returned in
ata_eh_schedule_probe(), which in turn causes SATA link speed to be slowed down
to 1.5Gbps.

Reported-and-tested-by: Martin Mokrejs <mmokrejs@fold.natur.cuni.cz>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---

Hi Jeff,

This patch fixes an old regression introduced in 2.6.37-rc1
of commit d902747.

So it should be included into stable releases since 2.6.37.

 drivers/ata/libata-eh.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Sergei Shtylyov - April 20, 2012, 10:29 a.m.
Hello.

On 20-04-012 5:38, Lin Ming wrote:

> The old error history was cleared in ata_ering_clear().
> It only sets ATA_EFLAG_OLD_ER eflags, but the err_mask was not cleared.
> So ata_ering_map() still iterates the old error history.

> This causes problem, for example, wrong probe trials count were returned in
> ata_eh_schedule_probe(), which in turn causes SATA link speed to be slowed down
> to 1.5Gbps.

> Reported-and-tested-by: Martin Mokrejs<mmokrejs@fold.natur.cuni.cz>
> Signed-off-by: Lin Ming<ming.m.lin@intel.com>
> ---

> Hi Jeff,

> This patch fixes an old regression introduced in 2.6.37-rc1
> of commit d902747.

> So it should be included into stable releases since 2.6.37.

    You should have included:

Cc: stable@vger.kernel.org # 2.6.37+

after your signoff in this case.

MBR, Sergei
--
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
Lin Ming - April 23, 2012, 1:09 a.m.
On Fri, Apr 20, 2012 at 6:29 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
>
> On 20-04-012 5:38, Lin Ming wrote:
>
>> The old error history was cleared in ata_ering_clear().
>> It only sets ATA_EFLAG_OLD_ER eflags, but the err_mask was not cleared.
>> So ata_ering_map() still iterates the old error history.
>
>
>> This causes problem, for example, wrong probe trials count were returned
>> in
>> ata_eh_schedule_probe(), which in turn causes SATA link speed to be slowed
>> down
>> to 1.5Gbps.
>
>
>> Reported-and-tested-by: Martin Mokrejs<mmokrejs@fold.natur.cuni.cz>
>> Signed-off-by: Lin Ming<ming.m.lin@intel.com>
>> ---
>
>
>> Hi Jeff,
>
>
>> This patch fixes an old regression introduced in 2.6.37-rc1
>> of commit d902747.
>
>
>> So it should be included into stable releases since 2.6.37.
>
>
>   You should have included:
>
> Cc: stable@vger.kernel.org # 2.6.37+
>
> after your signoff in this case.

Re-send with stable CCed.

Thanks.

>
> MBR, Sergei
--
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

Patch

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index c61316e..4c6f49b 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -419,9 +419,10 @@  int ata_ering_map(struct ata_ering *ering,
 	return rc;
 }
 
-int ata_ering_clear_cb(struct ata_ering_entry *ent, void *void_arg)
+static int ata_ering_clear_cb(struct ata_ering_entry *ent, void *void_arg)
 {
 	ent->eflags |= ATA_EFLAG_OLD_ER;
+	ent->err_mask = 0;
 	return 0;
 }