From: John Snow <jsnow@redhat.com>
To: Mateusz Albecki <mateusz.p.albecki@gmail.com>
Cc: qemu-devel@nongnu.org,
Mateusz Albecki <mateusz.albecki@outlook.com>,
Niklas Cassel <niklas.cassel@wdc.com>,
Niklas Cassel <nks@flawful.org>
Subject: Re: [PATCH 1/1] hw/ide/core.c: fix handling of unsupported commands
Date: Wed, 17 May 2023 17:32:56 -0400 [thread overview]
Message-ID: <CAFn=p-bcAW9aMymmWeVSMeyuT88YDZ2iYVh-t1GoogbBBPFjSw@mail.gmail.com> (raw)
In-Reply-To: <20230416222838.36642-2-mateusz.p.albecki@gmail.com>
On Sun, Apr 16, 2023 at 6:29 PM Mateusz Albecki
<mateusz.p.albecki@gmail.com> wrote:
>
> From: Mateusz Albecki <mateusz.albecki@outlook.com>
>
> Current code will not call ide_cmd_done when aborting the unsupported
> command which will lead to the command timeout on the driver side instead
> of getting a D2H FIS with ABRT indication. This can lead to problems on the
> driver side as the spec mandates that device should return a D2H FIS with
> ABRT bit set in ERR register(from SATA 3.1 section 16.3.3.8.6)
>
> Signed-off-by: Mateusz Albecki <mateusz.p.albecki@gmail.com>
> ---
> hw/ide/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/ide/core.c b/hw/ide/core.c
> index 45d14a25e9..d7027bbd4d 100644
> --- a/hw/ide/core.c
> +++ b/hw/ide/core.c
> @@ -2146,6 +2146,7 @@ void ide_bus_exec_cmd(IDEBus *bus, uint32_t val)
>
> if (!ide_cmd_permitted(s, val)) {
> ide_abort_command(s);
> + ide_cmd_done(s);
> ide_bus_set_irq(s->bus);
> return;
> }
> --
> 2.40.0
>
I recently noticed that Niklas Cassel sent a patch to fix unsupported
command handling:
https://lists.gnu.org/archive/html/qemu-devel/2023-04/msg05552.html
I suspect that his approach is the more technically correct one and
that calling ide_cmd_done here is a heavy cudgel that may have
unintended consequences. Am I mistaken?
Can you check that Niklas's patch solves your issue? I think you're
both solving the same problem. I've CC'd him on this patch as well.
--js
next prev parent reply other threads:[~2023-05-17 21:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-16 22:28 [PATCH 0/1] hw/ide/core.c: fix handling of unsupported commands Mateusz Albecki
2023-04-16 22:28 ` [PATCH 1/1] " Mateusz Albecki
2023-05-17 21:32 ` John Snow [this message]
2023-05-22 21:16 ` Mateusz Albecki
2023-05-23 14:35 ` John Snow
2023-05-24 8:17 ` Niklas Cassel
2023-05-24 15:20 ` John Snow
2023-06-01 14:03 ` Niklas Cassel
2023-06-01 16:39 ` John Snow
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='CAFn=p-bcAW9aMymmWeVSMeyuT88YDZ2iYVh-t1GoogbBBPFjSw@mail.gmail.com' \
--to=jsnow@redhat.com \
--cc=mateusz.albecki@outlook.com \
--cc=mateusz.p.albecki@gmail.com \
--cc=niklas.cassel@wdc.com \
--cc=nks@flawful.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).