All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Zimmerman <pauldzim@gmail.com>
To: Gerd Hoffmann <kraxel@redhat.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 14:55:21 -0700	[thread overview]
Message-ID: <CADBGO7-yccD+F6EZ-SqGc4pFgYoueQ-HvEAMyBLwO_BuXpN3SQ@mail.gmail.com> (raw)
In-Reply-To: <20200709075702.2mrm45ncbfmmikde@sirius.home.kraxel.org>

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

On Thu, Jul 9, 2020 at 12:57 AM Gerd Hoffmann <kraxel@redhat.com> wrote:

> > 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
>
>
Hi Gerd,

Hey, that works! But we still need to keep the rest of 7ad3d51ebb8a,
or else s->data_len eventually goes negative and we hit the assertion
on line 447 "Assertion `le32_to_cpu(s->csw.residue) == 0' failed.

But with that, hcd-dwc2 seems to work fine, and also the error
messages that Sai saw with hcd-xhci are gone.

Do you want to submit the patch for this?

Thanks,
Paul

[-- Attachment #2: Type: text/html, Size: 2726 bytes --]

      reply	other threads:[~2020-07-09 21:56 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
2020-07-09 21:55                     ` Paul Zimmerman [this message]

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=CADBGO7-yccD+F6EZ-SqGc4pFgYoueQ-HvEAMyBLwO_BuXpN3SQ@mail.gmail.com \
    --to=pauldzim@gmail.com \
    --cc=fnuv@xilinx.com \
    --cc=kraxel@redhat.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.