From: Niklas Cassel <cassel@kernel.org>
To: Eyal Lebedinsky <eyal@eyal.emu.id.au>
Cc: list linux-ide <linux-ide@vger.kernel.org>
Subject: Re: ata timeout exceptions
Date: Mon, 10 Nov 2025 14:11:17 +0100 [thread overview]
Message-ID: <aRHkdW6q94QVylVX@ryzen> (raw)
In-Reply-To: <1d86c6d3-a944-422a-9b96-7a768d7e89d8@eyal.emu.id.au>
On Mon, Nov 10, 2025 at 09:41:29AM +1100, Eyal Lebedinsky wrote:
> > > 2) Why do I get only one command_timeout counted (originally, with ncq active) and none when ncq is disabled?
> >
> > You are right that even if it is only a single command that times out,
> > the whole queue will be drained and retried.
> > (Because we always do a hard reset after a command timeout.)
> >
> > command_timeout is most likely increased only by one because it was
> > only a single command that timed out. (The other commands might have
> > been queued but were never executed/finished.)
> >
> > I have no idea why a command timeout, when NCQ has been disabled,
> > does not increase the command_timeout counter. My expectation would
> > have been for the counter to still be increased by one.
> This is an older SMA disk, and I will not be surprised if the disk was not even executing the command yet
> but was doing some housekeeping when it was reset. After raising the timeout 30s to 180s I still had one
> case where a reset was invoked. I see (iostat was running) that there was no activity on the disk that whole time.
>
> Or maybe it is just a fw bug in the disk (ST8000AS0002-1NA17Z from 2016)?
> Is it possible that a reset when a command is pending is not counted in the smart log?
>
> Interestingly, after repeated consecutive resets the link speed was downshifted 6.0->3.0->1.5g.
> Now it boots at 3.0g when it used to always boot at 6.0g.
> There must be a real issue there which is why the disk will be replaced anyway.
>
> Regardless, I now have a better understanding of the i/o path.
I'm not sure how the command_timeout counter in the smart log works.
But from the Linux driver perspective, if an I/O has not completed within the
timeout, we will reset the controller, and retry the outstanding commands.
This timeout is defined by Linux, and is by default 30 seconds, like you
mentioned.
Not sure how the drive FW counts a command_timeout, but it is possible that
this internal counter has a timeout that is different from 30 seconds.
For AHCI, performing a hardreset is done by writing a register, so it is not
actually a command that is sent down to the drive. (For a softreset on the
other hand, a command is actually sent down to the drive.)
Kind regards,
Niklas
next prev parent reply other threads:[~2025-11-10 13:11 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-03 4:13 ata timeout exceptions Eyal Lebedinsky
2025-11-09 20:40 ` Niklas Cassel
2025-11-09 22:41 ` Eyal Lebedinsky
2025-11-10 13:11 ` Niklas Cassel [this message]
2025-11-14 4:32 ` Eyal Lebedinsky
2025-11-18 15:17 ` Niklas Cassel
2025-11-18 23:05 ` Eyal Lebedinsky
2025-11-19 5:41 ` Damien Le Moal
2025-11-19 13:37 ` Eyal Lebedinsky
2025-11-20 3:34 ` Damien Le Moal
2025-11-20 11:38 ` Eyal Lebedinsky
2025-11-20 12:18 ` Damien Le Moal
2025-11-20 23:53 ` Eyal Lebedinsky
2025-12-16 23:39 ` Eyal Lebedinsky
2025-12-17 1:35 ` Damien Le Moal
2025-12-17 11:56 ` Eyal Lebedinsky
2025-12-17 12:02 ` Niklas Cassel
2025-12-20 4:03 ` Eyal Lebedinsky
2025-12-21 8:34 ` Damien Le Moal
2025-12-21 12:12 ` Eyal Lebedinsky
2025-12-21 22:43 ` Eyal Lebedinsky
2025-12-21 23:14 ` Damien Le Moal
2025-12-22 2:10 ` Eyal Lebedinsky
2025-12-22 3:43 ` Damien Le Moal
2025-12-22 5:57 ` Eyal Lebedinsky
2025-12-30 22:43 ` Eyal Lebedinsky
2026-01-02 1:21 ` Damien Le Moal
2026-01-02 6:30 ` Eyal Lebedinsky
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=aRHkdW6q94QVylVX@ryzen \
--to=cassel@kernel.org \
--cc=eyal@eyal.emu.id.au \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.