From: Damien Le Moal <damien.lemoal@opensource.wdc.com>
To: marius@psihoexpert.ro
Cc: linux-ide@vger.kernel.org
Subject: Re: Bug report for ahci-mvebu driver
Date: Mon, 30 Jan 2023 10:16:24 +0900 [thread overview]
Message-ID: <949cb9c5-8f38-72d4-e8bb-c367be602347@opensource.wdc.com> (raw)
In-Reply-To: <8cd8066ac1059ae0fef280a3cf6ab03c@psihoexpert.ro>
On 2023/01/29 19:24, marius@psihoexpert.ro wrote:
> January 29, 2023 4:25 AM, "Damien Le Moal" <damien.lemoal@opensource.wdc.com> wrote:
>>
>> OK. That is because the limit is not being changed with the added "return 0".
>> What about this version:
>>
>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>> index 884ae73b11ea..f404e2c2869e 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 speed limit to the lower Gen2 speed.
>> + * 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_limit == UINT_MAX) {
>> + link->sata_spd_limit = 2;
>> + ata_link_warn(link,
>> + "No reported SATA link speed. Limiting to
>> %s\n",
>> + sata_spd_string(link->sata_spd_limit));
>> + return 0;
>> + }
>> spd = link->sata_spd;
>> + }
>>
>> mask = link->sata_spd_limit;
>> if (mask <= 1)
>>
>> Does this work ?
>>
>> --
>> Damien Le Moal
>> Western Digital Research
>
>
> No, it doesn't work.
OK. So it seems that your adapter really wants the initial scan at 1.5 Gbps...
Since the initial tweak worked, I will post the official patch for it. I will CC
you. Please retest to be sure and send a "Tested-by:" tag ! Thanks !
>
> [ 29.743388][ T113] hardreset, Online=>Offline
> [ 29.743397][ T113] sata_set_spd_needed, scontrol=0x300
> [ 29.747893][ T113] __sata_set_spd_needed, initial limit=0xFFFFFFFF
> [ 29.753149][ T113] __sata_set_spd_needed, corrected limit=0xFFFFFFFF
> [ 29.759464][ T113] __sata_set_spd_needed, target=0x0
> [ 29.765953][ T113] __sata_set_spd_needed, spd=0x0
> [ 29.771033][ T113] __sata_set_spd_needed, final *scontrol=0x300
> [ 29.776937][ T113] resume, do loop
> [ 30.003803][ T113] resume, after do loop
> [ 30.063823][ T113] debounce, SCR=0x100
> ...
> [ 31.443802][ T113] debounce, SCR=0x100
> [ 31.447663][ T113] resume, return at end of function
> [ 31.451522][ T113] hardreset, ata_phys_link_offline check failed
> [ 31.456625][ T113] ata2: SATA link down (SStatus 100 SControl 300)
> [ 31.469093][ T113] sata_down_spd_limit: limit 0x1, cur spd 0x0, saved limit 0xffffffff, hw limit 0xffffffff
> [ 31.478986][ T113] ata2: No reported SATA link speed. Limiting to 3.0 Gbps
> [ 31.486004][ T113] hardreset, Online=>Offline
> [ 31.486010][ T113] sata_set_spd_needed, scontrol=0x300
> [ 31.490479][ T113] __sata_set_spd_needed, initial limit=0x2
> [ 31.495747][ T113] __sata_set_spd_needed, corrected limit=0x2
> [ 31.501437][ T113] __sata_set_spd_needed, target=0x2
> [ 31.507321][ T113] __sata_set_spd_needed, spd=0x0
> [ 31.512401][ T113] __sata_set_spd_needed, final *scontrol=0x320
> [ 31.517233][ T113] __sata_set_spd_needed, initial limit=0x2
> [ 31.523272][ T113] __sata_set_spd_needed, corrected limit=0x2
> [ 31.528975][ T113] __sata_set_spd_needed, target=0x2
> [ 31.534852][ T113] __sata_set_spd_needed, spd=0x0
> [ 31.539933][ T113] __sata_set_spd_needed, final *scontrol=0x324
> [ 31.545834][ T113] resume, do loop
> [ 31.773802][ T113] resume, after do loop
> [ 31.833802][ T113] debounce, SCR=0x101
> ...
> [ 32.433802][ T113] debounce, SCR=0x100
> [ 32.437663][ T113] resume, return at end of function
> [ 32.441522][ T113] hardreset, ata_phys_link_offline check failed
> [ 32.446624][ T113] ata2: SATA link down (SStatus 100 SControl 320)
> [ 32.459090][ T113] sata_down_spd_limit: limit 0x1, cur spd 0x0, saved limit 0xffffffff, hw limit 0xffffffff
> [ 32.468982][ T113] ata2: No reported SATA link speed. Limiting to 3.0 Gbps
> [ 32.475999][ T113] hardreset, Online=>Offline
> [ 32.476005][ T113] sata_set_spd_needed, scontrol=0x320
> [ 32.480474][ T113] __sata_set_spd_needed, initial limit=0x2
> [ 32.485741][ T113] __sata_set_spd_needed, corrected limit=0x2
> [ 32.491432][ T113] __sata_set_spd_needed, target=0x2
> [ 32.497315][ T113] __sata_set_spd_needed, spd=0x2
> [ 32.502395][ T113] __sata_set_spd_needed, final *scontrol=0x320
> [ 32.508296][ T113] resume, do loop
> [ 32.743801][ T113] resume, after do loop
> [ 32.803802][ T113] debounce, SCR=0x100
> ...
> [ 34.423802][ T113] debounce, SCR=0x100
> [ 34.427662][ T113] resume, return at end of function
> [ 34.431520][ T113] hardreset, ata_phys_link_offline check failed
> [ 34.436624][ T113] ata2: SATA link down (SStatus 100 SControl 320)
> [ 34.449088][ T113] sata_down_spd_limit: limit 0x1, cur spd 0x0, saved limit 0xffffffff, hw limit 0xffffffff
> [ 34.458981][ T113] ata2: No reported SATA link speed. Limiting to 3.0 Gbps
> [ 34.465998][ T113] hardreset, Online=>Offline
> [ 34.466004][ T113] sata_set_spd_needed, scontrol=0x320
> [ 34.470473][ T113] __sata_set_spd_needed, initial limit=0x2
> [ 34.475740][ T113] __sata_set_spd_needed, corrected limit=0x2
> [ 34.481430][ T113] __sata_set_spd_needed, target=0x2
> [ 34.487314][ T113] __sata_set_spd_needed, spd=0x2
> [ 34.492393][ T113] __sata_set_spd_needed, final *scontrol=0x320
> [ 34.498294][ T113] resume, do loop
> [ 34.723823][ T113] resume, after do loop
> [ 34.783802][ T113] debounce, SCR=0x101
> ...
> [ 36.763802][ T113] debounce, SCR=0x100
> [ 36.767662][ T113] debounce, loop end with timeout
> [ 36.771521][ T113] hardreset, sata_link_resume check failed
> [ 36.776445][ T113] ata2: COMRESET failed (errno=-32)
> [ 36.787224][ T113] ata2: reset failed (errno=-32), retrying in 8 secs
> [ 44.643801][ T113] sata_down_spd_limit: limit 0x0, cur spd 0x0, saved limit 0x2, hw limit 0xffffffff
> [ 44.653073][ T113] hardreset, Online=>Offline
> [ 44.653079][ T113] sata_set_spd_needed, scontrol=0x320
> [ 44.657569][ T113] __sata_set_spd_needed, initial limit=0x2
> [ 44.662823][ T113] __sata_set_spd_needed, corrected limit=0x2
> [ 44.668527][ T113] __sata_set_spd_needed, target=0x2
> [ 44.674403][ T113] __sata_set_spd_needed, spd=0x2
> [ 44.679484][ T113] __sata_set_spd_needed, final *scontrol=0x320
> [ 44.685385][ T113] resume, do loop
> [ 44.913802][ T113] resume, after do loop
> [ 44.973802][ T113] debounce, SCR=0x100
> ...
> [ 46.233802][ T113] debounce, SCR=0x100
> [ 46.237663][ T113] resume, return at end of function
> [ 46.241520][ T113] hardreset, ata_phys_link_offline check failed
> [ 46.246622][ T113] ata2: SATA link down (SStatus 100 SControl 320)
> [ 46.259088][ T113] sata_down_spd_limit: limit 0x1, cur spd 0x0, saved limit 0xffffffff, hw limit 0xffffffff
> [ 46.268981][ T113] ata2: No reported SATA link speed. Limiting to 3.0 Gbps
> [ 46.275997][ T113] hardreset, Online=>Offline
> [ 46.276003][ T113] sata_set_spd_needed, scontrol=0x320
> [ 46.280473][ T113] __sata_set_spd_needed, initial limit=0x2
> [ 46.285740][ T113] __sata_set_spd_needed, corrected limit=0x2
> [ 46.291430][ T113] __sata_set_spd_needed, target=0x2
> [ 46.297314][ T113] __sata_set_spd_needed, spd=0x2
> [ 46.302394][ T113] __sata_set_spd_needed, final *scontrol=0x320
> [ 46.308296][ T113] resume, do loop
> [ 46.543802][ T113] resume, after do loop
> [ 46.603802][ T113] debounce, SCR=0x100
> ...
> [ 47.683802][ T113] debounce, SCR=0x100
> [ 47.687662][ T113] resume, return at end of function
> [ 47.691520][ T113] hardreset, ata_phys_link_offline check failed
> [ 47.696636][ T113] ata2: SATA link down (SStatus 101 SControl 320)
> [ 47.709086][ T113] ata2: EH pending after 5 tries, giving up
>
> Marius Dinu
>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2023-01-30 1:16 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
2023-01-29 2:23 ` Damien Le Moal
2023-01-29 10:24 ` marius
2023-01-30 1:16 ` Damien Le Moal [this message]
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=949cb9c5-8f38-72d4-e8bb-c367be602347@opensource.wdc.com \
--to=damien.lemoal@opensource.wdc.com \
--cc=linux-ide@vger.kernel.org \
--cc=marius@psihoexpert.ro \
/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