diff mbox

hw/usb-musb.c: Don't misuse usb_packet_complete()

Message ID 1308050644-4622-1-git-send-email-peter.maydell@linaro.org
State Accepted
Commit 000eb4fa525d0b9b2d2b2a2ad4925863af60e5f7
Headers show

Commit Message

Peter Maydell June 14, 2011, 11:24 a.m. UTC
In musb_packet() handle final processing of non-asynchronous
USB packets by directly calling musb_schedule_cb() rather than
going through usb_packet_complete(). The latter will trigger
an assertion because the packet doesn't belong to a device.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
The fix here is as suggested by Gerd.

 hw/usb-musb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Peter Maydell June 29, 2011, 9:43 a.m. UTC | #1
Gerd: ping?

thanks
-- PMM

On 14 June 2011 12:24, Peter Maydell <peter.maydell@linaro.org> wrote:
> In musb_packet() handle final processing of non-asynchronous
> USB packets by directly calling musb_schedule_cb() rather than
> going through usb_packet_complete(). The latter will trigger
> an assertion because the packet doesn't belong to a device.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> The fix here is as suggested by Gerd.
>
>  hw/usb-musb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/usb-musb.c b/hw/usb-musb.c
> index 6037193..3eed855 100644
> --- a/hw/usb-musb.c
> +++ b/hw/usb-musb.c
> @@ -611,7 +611,7 @@ static void musb_packet(MUSBState *s, MUSBEndPoint *ep,
>     }
>
>     ep->status[dir] = ret;
> -    usb_packet_complete(s->port.dev, &ep->packey[dir].p);
> +    musb_schedule_cb(s->port.dev, &ep->packey[dir].p);
>  }
>
>  static void musb_tx_packet_complete(USBPacket *packey, void *opaque)
> --
> 1.7.1
Gerd Hoffmann June 29, 2011, 9:58 a.m. UTC | #2
On 06/29/11 11:43, Peter Maydell wrote:
> Gerd: ping?

Oops, slipped through somehow.  Picked into the usb queue now.

cheers,
   Gerd
diff mbox

Patch

diff --git a/hw/usb-musb.c b/hw/usb-musb.c
index 6037193..3eed855 100644
--- a/hw/usb-musb.c
+++ b/hw/usb-musb.c
@@ -611,7 +611,7 @@  static void musb_packet(MUSBState *s, MUSBEndPoint *ep,
     }
 
     ep->status[dir] = ret;
-    usb_packet_complete(s->port.dev, &ep->packey[dir].p);
+    musb_schedule_cb(s->port.dev, &ep->packey[dir].p);
 }
 
 static void musb_tx_packet_complete(USBPacket *packey, void *opaque)