From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Niklas Cassel <nks@flawful.org>, John Snow <jsnow@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
Damien Le Moal <dlemoal@kernel.org>,
Niklas Cassel <niklas.cassel@wdc.com>
Subject: Re: [PATCH v3 8/8] hw/ide/ahci: fix broken SError handling
Date: Wed, 19 Jul 2023 13:59:38 +0200 [thread overview]
Message-ID: <e1966f41-5e65-7cd8-d558-46b11a0eb553@linaro.org> (raw)
In-Reply-To: <20230609140844.202795-9-nks@flawful.org>
On 9/6/23 16:08, Niklas Cassel wrote:
> From: Niklas Cassel <niklas.cassel@wdc.com>
>
> When encountering an NCQ error, you should not write the NCQ tag to the
> SError register. This is completely wrong.
>
> The SError register has a clear definition, where each bit represents a
> different error, see PxSERR definition in AHCI 1.3.1.
>
> If we write a random value (like the NCQ tag) in SError, e.g. Linux will
> read SError, and will trigger arbitrary error handling depending on the
> NCQ tag that happened to be executing.
>
> In case of success, ncq_cb() will call ncq_finish().
> In case of error, ncq_cb() will call ncq_err() (which will clear
> ncq_tfs->used), and then call ncq_finish(), thus using ncq_tfs->used is
> sufficient to tell if finished should get set or not.
>
Cc: qemu-stable@nongnu.org
Fixes: f6ad2e32f8 ("ahci: add ahci emulation")
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
> ---
> hw/ide/ahci.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
next prev parent reply other threads:[~2023-07-19 12:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 14:08 [PATCH v3 0/8] misc AHCI cleanups Niklas Cassel
2023-06-09 14:08 ` [PATCH v3 1/8] hw/ide/ahci: remove stray backslash Niklas Cassel
2023-06-09 14:08 ` [PATCH v3 2/8] hw/ide/core: set ERR_STAT in unsupported command completion Niklas Cassel
2023-07-19 11:43 ` Philippe Mathieu-Daudé
2023-06-09 14:08 ` [PATCH v3 3/8] hw/ide/ahci: write D2H FIS when processing NCQ command Niklas Cassel
2023-06-09 14:08 ` [PATCH v3 4/8] hw/ide/ahci: simplify and document PxCI handling Niklas Cassel
2023-06-09 14:08 ` [PATCH v3 5/8] hw/ide/ahci: PxSACT and PxCI is cleared when PxCMD.ST is cleared Niklas Cassel
2023-07-19 11:50 ` Philippe Mathieu-Daudé
2023-06-09 14:08 ` [PATCH v3 6/8] hw/ide/ahci: PxCI should not get cleared when ERR_STAT is set Niklas Cassel
2023-06-09 14:08 ` [PATCH v3 7/8] hw/ide/ahci: fix ahci_write_fis_sdb() Niklas Cassel
2023-07-19 11:53 ` Philippe Mathieu-Daudé
2023-06-09 14:08 ` [PATCH v3 8/8] hw/ide/ahci: fix broken SError handling Niklas Cassel
2023-07-19 11:59 ` Philippe Mathieu-Daudé [this message]
2023-07-19 12:06 ` Michael Tokarev
2023-07-19 12:11 ` Philippe Mathieu-Daudé
2023-07-19 10:47 ` [PATCH v3 0/8] misc AHCI cleanups Niklas Cassel
2023-07-25 12:58 ` Philippe Mathieu-Daudé
2023-07-25 19:00 ` John Snow
2023-08-07 10:32 ` Niklas Cassel
2023-08-07 17:37 ` John Snow
2023-08-31 8:32 ` Philippe Mathieu-Daudé
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=e1966f41-5e65-7cd8-d558-46b11a0eb553@linaro.org \
--to=philmd@linaro.org \
--cc=dlemoal@kernel.org \
--cc=jsnow@redhat.com \
--cc=niklas.cassel@wdc.com \
--cc=nks@flawful.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).