All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Paul Zimmerman <pauldzim@gmail.com>
Cc: Sai Pavan Boddu <saipava@xilinx.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	Vikram Garhwal <fnuv@xilinx.com>
Subject: Re: Failure prints during format or mounting a usb storage device
Date: Thu, 9 Jul 2020 09:57:02 +0200	[thread overview]
Message-ID: <20200709075702.2mrm45ncbfmmikde@sirius.home.kraxel.org> (raw)
In-Reply-To: <CADBGO7_08su0HqP1uiwvkLfwq3NUmUxoLhRK5H3b0v=C4iPYFg@mail.gmail.com>

> Starting at line 1746 is the first CBW, it's for an Inquiry command.
> 
> Starting at line 1759 is the response, notice at line 1761 the MSD debug
> says "Data in 64/36", which is strange.

Not really.  First is the packet size, second is the (remaining) data
size.  Inquiry data is 36 bytes, and dwc2 uses 64 byte instead of 36
byte transfers.

> Then the MSD defers the packet, even though the full 36 bytes has
> already been received.

Yes, and this is the problem.  The condition checks whenever there is
room left in the usb packet.  But we should also check whenever there
is actually more data pending, so how about this:

    if (p->actual_length < p->iov.size && s->mode == USB_MSDM_DATAIN) {
        DPRINTF("Deferring packet %p [wait data-in]\n", p);

take care,
  Gerd



  reply	other threads:[~2020-07-09  7:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-04 18:21 Failure prints during format or mounting a usb storage device Sai Pavan Boddu
2020-07-04 18:24 ` Paul Zimmerman
2020-07-06 22:21   ` Paul Zimmerman
2020-07-06 23:12     ` Paul Zimmerman
2020-07-07  7:57       ` Gerd Hoffmann
2020-07-07 20:23         ` Paul Zimmerman
2020-07-08  7:29           ` Gerd Hoffmann
2020-07-08  7:57             ` Paul Zimmerman
2020-07-08 10:29               ` Gerd Hoffmann
2020-07-09  6:02                 ` Paul Zimmerman
2020-07-09  7:57                   ` Gerd Hoffmann [this message]
2020-07-09 21:55                     ` Paul Zimmerman

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=20200709075702.2mrm45ncbfmmikde@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=fnuv@xilinx.com \
    --cc=pauldzim@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=saipava@xilinx.com \
    /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.