qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] usb-storage: fix SYNCHRONIZE_CACHE
Date: Tue,  7 Aug 2012 10:59:40 +0200	[thread overview]
Message-ID: <1344329980-25015-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1344329980-25015-1-git-send-email-kraxel@redhat.com>

Commit 59310659073d85745854f2f10c4292555c5a1c51 is incomplete,
we'll arrive in the scsi command complete callback in CSW state
and must handle that case correctly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/dev-storage.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c
index 976fe1a..ff48d91 100644
--- a/hw/usb/dev-storage.c
+++ b/hw/usb/dev-storage.c
@@ -247,6 +247,9 @@ static void usb_msd_command_complete(SCSIRequest *req, uint32_t status, size_t r
                the status read packet.  */
             usb_msd_send_status(s, p);
             s->mode = USB_MSDM_CBW;
+        } else if (s->mode == USB_MSDM_CSW) {
+            usb_msd_send_status(s, p);
+            s->mode = USB_MSDM_CBW;
         } else {
             if (s->data_len) {
                 int len = (p->iov.size - p->result);
-- 
1.7.1

  parent reply	other threads:[~2012-08-07  8:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07  8:59 [Qemu-devel] [PULL 0/2] usb patch queue Gerd Hoffmann
2012-08-07  8:59 ` [Qemu-devel] [PATCH 1/2] usb-storage: improve debug logging Gerd Hoffmann
2012-08-07  8:59 ` Gerd Hoffmann [this message]
2012-08-10 11:13   ` [Qemu-devel] [PATCH 2/2] usb-storage: fix SYNCHRONIZE_CACHE Michael Tokarev
2012-08-07 15:36 ` [Qemu-devel] [PULL 0/2] usb patch queue Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2012-07-13  9:44 [Qemu-devel] [PATCH 1/2] usb-storage: improve debug logging Gerd Hoffmann
2012-07-13  9:44 ` [Qemu-devel] [PATCH 2/2] usb-storage: fix SYNCHRONIZE_CACHE Gerd Hoffmann

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=1344329980-25015-3-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --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).