qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: QEMU Developers <qemu-devel@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] usb-musb: calls usb_packet_complete() on packets with no owner
Date: Mon, 13 Jun 2011 12:39:06 +0100	[thread overview]
Message-ID: <BANLkTi=-U4GwwPMX=NyS-isRae-66zKDaw@mail.gmail.com> (raw)

The function usb_packet_complete() in hw/usb.c says:
/* Notify the controller that an async packet is complete.  This should only
   be called for packets previously deferred by returning USB_RET_ASYNC from
   handle_packet. */

and this is checked by means of an assert(p->owner != NULL). However,
hw/usb-musb.c's musb_packet() function does this:

    if (s->port.dev)
        ret = usb_handle_packet(s->port.dev, &ep->packey[dir].p);
    else
        ret = USB_RET_NODEV;

    if (ret == USB_RET_ASYNC) {
        ep->status[dir] = len;
        return;
    }

    ep->status[dir] = ret;
    usb_packet_complete(s->port.dev, &ep->packey[dir].p);

which will call usb_packet_complete() on packets which did not
return USB_RET_ASYNC from usb_handle_packet, and so trips this
assert.

Any suggestions about what the right way to fix this is?
(I'm a bit confused about the comment that usb_packet_complete
is to 'notify the controller' -- usb-musb is the controller...)

(I do have a repro case but it's in qemu-linaro because it
uses the omap3 port; I can't seem to persuade my n800 image
to actually use the usb-otg.)

thanks
-- PMM

             reply	other threads:[~2011-06-13 11:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-13 11:39 Peter Maydell [this message]
2011-06-14  7:16 ` [Qemu-devel] usb-musb: calls usb_packet_complete() on packets with no owner 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='BANLkTi=-U4GwwPMX=NyS-isRae-66zKDaw@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=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).