qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB MSD: Set s->req to NULL after handling a packet
@ 2025-07-10 16:38 Hannes Bredberg
  2025-07-10 19:32 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Bredberg @ 2025-07-10 16:38 UTC (permalink / raw)
  To: qemu-devel

This fixes compatibility for OSes which enqueue multiple data transfers
on the same endpoint without waiting for the previous one to be ACKed by
the mass storage device.

Signed-off-by: Hannes Bredberg <hannesbredberg@gmail.com>
---
 hw/usb/dev-storage.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index b13fe345c4..43d57afd00 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -182,13 +182,14 @@ static void usb_msd_packet_complete(MSDState *s,
int status)
     USBPacket *p = s->packet;

     /*
-     * Set s->packet to NULL before calling usb_packet_complete
+     * Set s->packet and s->req to NULL before calling usb_packet_complete
      * because another request may be issued before
      * usb_packet_complete returns.
      */
     trace_usb_msd_packet_complete();
     p->status = status;
     s->packet = NULL;
+    s->req = NULL;
     usb_packet_complete(&s->dev, p);
 }

--
2.47.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] USB MSD: Set s->req to NULL after handling a packet
  2025-07-10 16:38 [PATCH] USB MSD: Set s->req to NULL after handling a packet Hannes Bredberg
@ 2025-07-10 19:32 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2025-07-10 19:32 UTC (permalink / raw)
  To: Hannes Bredberg; +Cc: qemu-devel

On Thu, 10 Jul 2025 at 18:54, Hannes Bredberg <hannesbredberg@gmail.com> wrote:
>
> This fixes compatibility for OSes which enqueue multiple data transfers
> on the same endpoint without waiting for the previous one to be ACKed by
> the mass storage device.

Which OSes are these? If there's a specific one that users
might be having problems with and we're fixing a bug for
them, that's worth noting.

thanks
-- PMM


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-10 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-10 16:38 [PATCH] USB MSD: Set s->req to NULL after handling a packet Hannes Bredberg
2025-07-10 19:32 ` Peter Maydell

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).