On 1/30/23 16:37, Damien Le Moal wrote: > On 1/30/23 16:23, marius@xxxxxxxxxxxxxx wrote: >> January 30, 2023 4:39 AM, "Damien Le Moal" <damien.lemoal@xxxxxxxxxxxxxxxxxx> wrote: >>> >>> Apologies for asking you to test again, but could you try this simpler >>> version of the initial tweak: >>> >>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c >>> index 884ae73b11ea..2ea572628b1c 100644 >>> --- a/drivers/ata/libata-core.c >>> +++ b/drivers/ata/libata-core.c >>> @@ -3109,7 +3109,7 @@ int sata_down_spd_limit(struct ata_link *link, u32 >>> spd_limit) >>> */ >>> if (spd > 1) >>> mask &= (1 << (spd - 1)) - 1; >>> - else >>> + else if (link->sata_spd) >>> return -EINVAL; >>> >>> /* were we already at the bottom? */ >>> >>> This is a partial revert of the commit that created the issue in the >>> first place. But better check this is OK. >>> >>> -- >>> Damien Le Moal >>> Western Digital Research >> >> No problem. I'll test everything until you find the best possible fix for the kernel. >> >> It works: > > Perfect. I prefer this version of the fix as it actually does *exactly* what the > comment above the if/else hunk says, that is not force 1.5gbps speed if we > already have a recorded speed. But in your case, we do not have a recorded speed > (link->sata_spd == 0), so retrying with 1.5gbps is the right thing to do. > > I will write a nice commit message and post. I sent the official patch and CC-ed you. Can I add your "Tested-by: Marius Dinu <marius@xxxxxxxxxxxxxx>" tag to the patch and queue it ? -- Damien Le Moal Western Digital Research