public inbox for linux-ide@vger.kernel.org
 help / color / mirror / Atom feed
From: marius@psihoexpert.ro
To: "Damien Le Moal" <damien.lemoal@opensource.wdc.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: Bug report for ahci-mvebu driver
Date: Sat, 28 Jan 2023 17:08:52 +0000	[thread overview]
Message-ID: <55834657003f5a4579b326ee61fe1e80@psihoexpert.ro> (raw)
In-Reply-To: <fbbbad64-482e-93eb-14e7-01b54a92d2b3@opensource.wdc.com>

January 27, 2023 8:28 AM, "Damien Le Moal" <damien.lemoal@opensource.wdc.com> wrote:

> On 1/27/23 14:13, Damien Le Moal wrote:
> 
>> Marius,
>> 
>> Thanks again for testing.
>> Could you try a new variation of the fix shown below ? This newer fix
>> should avoid uselessly going down to 1.5 Gbps as shown above.
>> Thanks !
>> 
>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>> index 884ae73b11ea..04938db566e5 100644
>> --- a/drivers/ata/libata-core.c
>> +++ b/drivers/ata/libata-core.c
>> @@ -3085,10 +3085,31 @@ int sata_down_spd_limit(struct ata_link *link, u32
>> spd_limit)
>> * If not, use cached value in link->sata_spd.
>> */
>> rc = sata_scr_read(link, SCR_STATUS, &sstatus);
>> - if (rc == 0 && ata_sstatus_online(sstatus))
>> + if (rc == 0 && ata_sstatus_online(sstatus)) {
>> spd = (sstatus >> 4) & 0xf;
>> - else
>> + } else {
>> + /*
>> + * If we reach here, the device is still offline or not
>> + * reporting a current speed yet. If we do not have a recorded
>> + * speed either, it means that probing the drive is failing,
>> + * most likely because problem with link speed autonegotiation
>> + * (e.g. reported case with mvebu adapter with a port multiplier
>> + * device). In this case, assume that probing was done at Gen3
>> + * speed and set the recorded speed to lower Gen2. With this,
>> + * the next probe retry will be done after sata_set_spd()
>> + * explicitly lowers the link speed. If the device then
>> + * responds, the actual maximum speed will be set once
>> + * libata-eh finishes the device revalidation.
>> + */
>> + if (!link->sata_spd) {
>> + link->sata_spd = 2;
>> + ata_link_warn(link,
>> + "No reported link speed. Assuming %s\n",
>> + sata_spd_string(link->sata_spd));
>> + return;
> 
> Oops. My bad. This should be "return 0;" of course.
> 
>> + }
>> spd = link->sata_spd;
>> + }
>> 
>> mask = link->sata_spd_limit;
>> if (mask <= 1)
> 
> --
> Damien Le Moal
> Western Digital Research


It doesn't work.

[   15.145150][  T113] hardreset, Online=>Offline
[   15.145159][  T113] sata_set_spd_needed, scontrol=0x300
[   15.149632][  T113] __sata_set_spd_needed, initial limit=0xFFFFFFFF
[   15.154910][  T113] __sata_set_spd_needed, corrected limit=0xFFFFFFFF
[   15.161211][  T113] __sata_set_spd_needed, target=0x0
[   15.167700][  T113] __sata_set_spd_needed, spd=0x0
[   15.172781][  T113] __sata_set_spd_needed, final *scontrol=0x300
[   15.178685][  T113] resume, do loop
[   15.413909][  T113] resume, after do loop
[   15.473909][  T113] debounce, SCR=0x100
..
[   16.553930][  T113] debounce, SCR=0x100
[   16.557791][  T113] resume, return at end of function
[   16.561650][  T113] hardreset, ata_phys_link_offline check failed
[   16.566754][  T113] ata2: SATA link down (SStatus 101 SControl 300)
[   16.579222][  T113] sata_down_spd_limit: limit 0x1, cur spd 0x0, saved limit 0xffffffff, hw limit 0xffffffff
[   16.589115][  T113] ata2: No reported link speed. Assuming 3.0 Gbps
[   16.595436][  T113] hardreset, Online=>Offline
[   16.595442][  T113] sata_set_spd_needed, scontrol=0x300
[   16.599911][  T113] __sata_set_spd_needed, initial limit=0xFFFFFFFF
[   16.605178][  T113] __sata_set_spd_needed, corrected limit=0xFFFFFFFF
[   16.611479][  T113] __sata_set_spd_needed, target=0x0
[   16.617975][  T113] __sata_set_spd_needed, spd=0x0
[   16.623055][  T113] __sata_set_spd_needed, final *scontrol=0x300
[   16.628957][  T113] resume, do loop
[   16.863910][  T113] resume, after do loop
[   16.923909][  T113] debounce, SCR=0x100
...
[   18.123908][  T113] debounce, SCR=0x100
[   18.127770][  T113] resume, return at end of function
[   18.131628][  T113] hardreset, ata_phys_link_offline check failed
[   18.136731][  T113] ata2: SATA link down (SStatus 100 SControl 300)
[   18.149196][  T113] sata_down_spd_limit: limit 0x1, cur spd 0x0, saved limit 0xffffffff, hw limit 0xffffffff
[   18.159089][  T113] ata2: No reported link speed. Assuming 3.0 Gbps
[   18.165409][  T113] hardreset, Online=>Offline
[   18.165415][  T113] sata_set_spd_needed, scontrol=0x300
[   18.169884][  T113] __sata_set_spd_needed, initial limit=0xFFFFFFFF
[   18.175151][  T113] __sata_set_spd_needed, corrected limit=0xFFFFFFFF
[   18.181451][  T113] __sata_set_spd_needed, target=0x0
[   18.187946][  T113] __sata_set_spd_needed, spd=0x0
[   18.193025][  T113] __sata_set_spd_needed, final *scontrol=0x300
[   18.198927][  T113] resume, do loop
[   18.433909][  T113] resume, after do loop
[   18.493909][  T113] debounce, SCR=0x100
...
[   20.413909][  T113] debounce, SCR=0x100
[   20.417768][  T113] resume, return at end of function
[   20.421627][  T113] hardreset, ata_phys_link_offline check failed
[   20.426730][  T113] ata2: SATA link down (SStatus 100 SControl 300)
[   20.439196][  T113] sata_down_spd_limit: limit 0x1, cur spd 0x0, saved limit 0xffffffff, hw limit 0xffffffff
[   20.449089][  T113] ata2: No reported link speed. Assuming 3.0 Gbps
[   20.455409][  T113] hardreset, Online=>Offline
[   20.455415][  T113] sata_set_spd_needed, scontrol=0x300
[   20.459884][  T113] __sata_set_spd_needed, initial limit=0xFFFFFFFF
[   20.465151][  T113] __sata_set_spd_needed, corrected limit=0xFFFFFFFF
[   20.471452][  T113] __sata_set_spd_needed, target=0x0
[   20.477947][  T113] __sata_set_spd_needed, spd=0x0
[   20.483027][  T113] __sata_set_spd_needed, final *scontrol=0x300
[   20.488929][  T113] resume, do loop
[   20.723909][  T113] resume, after do loop
[   20.783909][  T113] debounce, SCR=0x0
[   20.843909][  T113] debounce, SCR=0x0
[   20.903909][  T113] debounce, SCR=0x0
[   20.963909][  T113] debounce, SCR=0x0
[   21.023909][  T113] debounce, SCR=0x100
[   21.083909][  T113] debounce, SCR=0x100
[   21.143909][  T113] debounce, SCR=0x100
[   21.203929][  T113] debounce, SCR=0x100
[   21.263909][  T113] debounce, SCR=0x100
[   21.267768][  T113] resume, return at end of function
[   21.271626][  T113] hardreset, ata_phys_link_offline check failed
[   21.276728][  T113] ata2: SATA link down (SStatus 101 SControl 300)
[   21.289194][  T113] sata_down_spd_limit: limit 0x1, cur spd 0x0, saved limit 0xffffffff, hw limit 0xffffffff
[   21.299086][  T113] ata2: No reported link speed. Assuming 3.0 Gbps
[   21.305407][  T113] hardreset, Online=>Offline
[   21.305413][  T113] sata_set_spd_needed, scontrol=0x300
[   21.309882][  T113] __sata_set_spd_needed, initial limit=0xFFFFFFFF
[   21.315149][  T113] __sata_set_spd_needed, corrected limit=0xFFFFFFFF
[   21.321448][  T113] __sata_set_spd_needed, target=0x0
[   21.327943][  T113] __sata_set_spd_needed, spd=0x0
[   21.333024][  T113] __sata_set_spd_needed, final *scontrol=0x300
[   21.338925][  T113] resume, do loop
[   21.573909][  T113] resume, after do loop
[   21.633909][  T113] debounce, SCR=0x101
...
[   22.893908][  T113] debounce, SCR=0x100
[   22.897769][  T113] resume, return at end of function
[   22.901628][  T113] hardreset, ata_phys_link_offline check failed
[   22.906731][  T113] ata2: SATA link down (SStatus 100 SControl 300)
[   22.919179][  T113] ata2: EH pending after 5 tries, giving up


  reply	other threads:[~2023-01-28 17:08 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-01 19:21 Bug report for ahci-mvebu driver Dinu Marius
2022-11-06  7:05 ` Damien Le Moal
2022-11-07  9:22   ` marius
2022-11-08  6:27     ` Damien Le Moal
2022-11-09 19:52       ` marius
2022-11-09 19:55       ` marius
2022-11-10  2:05         ` Damien Le Moal
2022-11-11 22:32           ` marius
2022-11-12  1:57             ` Damien Le Moal
2022-11-14 20:52               ` marius
2022-11-15  3:02                 ` Damien Le Moal
2022-11-15  7:28                   ` marius
2022-11-15  8:10                     ` Damien Le Moal
2022-11-18 18:24                       ` Dinu Marius
2022-11-24  2:40                         ` Damien Le Moal
2022-12-04  1:41                           ` marius
2022-12-04 10:22                             ` Pali Rohár
2022-12-04 21:14                               ` marius
2022-12-04 21:46                                 ` Pali Rohár
2022-12-05  2:02                                 ` Damien Le Moal
2022-12-06  6:08                             ` Damien Le Moal
2022-12-07 18:27                               ` marius
2022-12-07 21:54                                 ` Damien Le Moal
2022-12-07 22:51                                 ` Damien Le Moal
2022-12-08 18:06                                   ` marius
2022-12-09  0:34                                     ` Damien Le Moal
2022-12-09  2:58                                     ` Damien Le Moal
2022-12-09  7:31                                       ` marius
2022-12-09  9:28                                         ` Damien Le Moal
2022-12-09 18:30                                           ` marius
2023-01-14 18:01                                             ` marius
2023-01-15 23:37                                               ` Damien Le Moal
2023-01-17  8:26                                               ` Damien Le Moal
2023-01-18 19:43                                                 ` marius
2023-01-19  0:29                                                   ` Damien Le Moal
2023-01-19 18:46                                                     ` marius
2023-01-23  7:02                                                       ` Damien Le Moal
2023-01-23 20:00                                                         ` marius
2023-01-23 23:00                                                           ` Damien Le Moal
2023-01-24  8:04                                                             ` marius
2023-01-24  9:53                                                               ` Damien Le Moal
2023-01-24 17:02                                                                 ` marius
2023-01-27  5:13                                                                   ` Damien Le Moal
2023-01-27  6:28                                                                     ` Damien Le Moal
2023-01-28 17:08                                                                       ` marius [this message]
2023-01-29  2:23                                                                         ` Damien Le Moal
2023-01-29 10:24                                                                           ` marius
2023-01-30  1:16                                                                             ` Damien Le Moal
2023-01-30  2:38                                                                             ` Damien Le Moal
2023-01-30  7:23                                                                               ` marius
2023-01-30  7:37                                                                                 ` Damien Le Moal
2023-01-30 23:22                                                                                   ` Damien Le Moal
2023-01-31  7:20                                                                                     ` marius
2023-01-31  7:28                                                                                       ` Damien Le Moal
2023-02-07 18:40                                                                                         ` marius
2023-02-07 23:39                                                                                           ` Damien Le Moal
2023-02-08 12:17                                                                                             ` marius
2023-02-08 23:00                                                                                               ` Damien Le Moal
2023-02-12 13:14                                                                                                 ` marius
2023-02-12 23:11                                                                                                   ` Damien Le Moal
2023-01-24 17:06                                           ` Bug report for sata_via driver marius
2023-01-25  1:26                                             ` Damien Le Moal
2022-12-08 21:26                               ` Bug report for ahci-mvebu driver Pali Rohár
2022-12-09  1:54                                 ` Damien Le Moal
2022-11-26 14:26 ` Pali Rohár
2023-01-23  9:10 ` Hajo Noerenberg
2023-01-23 12:13   ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55834657003f5a4579b326ee61fe1e80@psihoexpert.ro \
    --to=marius@psihoexpert.ro \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox