Re: Bug report for ahci-mvebu driver

marius
2023-01-23T20:00:48Z

January 23, 2023 9:02 AM, "Damien Le Moal" <damien.lemoal@opensource.wdc.com> wrote:

> But I think I got an idea of what is wrong here. Can you try this patch:
>
> diff --git a/drivers/ata/libata-sata.c b/drivers/ata/libata-sata.c
> index 18ef14e749a0..cb12054c733f 100644
> --- a/drivers/ata/libata-sata.c
> +++ b/drivers/ata/libata-sata.c
> @@ -436,7 +436,8 @@ static int __sata_set_spd_needed(struct ata_link
> *link, u32 *scontrol)
> limit &= (1 << host_link->sata_spd) - 1;
>
> if (limit == UINT_MAX)
> - target = 0;
> + /* Try highest gen 3 limit */
> + target = 3;
> else
> target = fls(limit);

It doesn't work. I didn't really expect it to work, since manually forcing 3Gbps didn't work either - probably a hardware issue like you said.

I think that the old behaviour (before commit 2dc0b46b5ea30f169b0b272253ea846a5a281731) of slowing down sata speed when a connection can't be established is in fact the right thing to do. Maybe a longer delay before reducing the link speed would satisfy the random cases that the commit author reported. Maybe he was just having a loose connector issue - especially since he only reported one case.

Marius Dinu