Patchwork ehci: fix compile error with EHCI_DEBUG enabled

login
register
mail settings
Submitter Gabriel L. Somlo
Date Nov. 12, 2012, 2:49 p.m.
Message ID <20121112144918.GA2107@hedwig.ini.cmu.edu>
Download mbox | patch
Permalink /patch/198405/
State New
Headers show

Comments

Gabriel L. Somlo - Nov. 12, 2012, 2:49 p.m.
This patch fixes a few debugging print statements whose arguments fell
out of sync over time with changes being made to the active code base.

Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
---

On Mon, Nov 12, 2012 at 11:26:18AM +0100, Gerd Hoffmann wrote:
> Seems macos doesn't like something in our ehci emulation ...
> Can you send a trace with all ehci tracepoints enabled?

Turning EHCI_DEBUG on gave me compile errors. This is my best guess
as to what the DPRINTF arguments *should* be, hope I guessed right :)

This patch works against both master and the q35 branch, BTW.

I'll reply to your email again with the debug output, figured I'd get
this out of the way first...

Thanks,
  Gabriel

 hw/usb/hcd-ehci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Stefan Hajnoczi - Nov. 16, 2012, 1:50 p.m.
On Mon, Nov 12, 2012 at 09:49:19AM -0500, Gabriel L. Somlo wrote:
> This patch fixes a few debugging print statements whose arguments fell
> out of sync over time with changes being made to the active code base.
> 
> Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
> ---
> 
> On Mon, Nov 12, 2012 at 11:26:18AM +0100, Gerd Hoffmann wrote:
> > Seems macos doesn't like something in our ehci emulation ...
> > Can you send a trace with all ehci tracepoints enabled?
> 
> Turning EHCI_DEBUG on gave me compile errors. This is my best guess
> as to what the DPRINTF arguments *should* be, hope I guessed right :)

In that case I'll let Gerd confirm whether or not the guesses are
correct.

Gerd: can you review and take this through the USB tree?

Thanks,
Stefan
Gerd Hoffmann - Nov. 16, 2012, 1:54 p.m.
On 11/16/12 14:50, Stefan Hajnoczi wrote:
> On Mon, Nov 12, 2012 at 09:49:19AM -0500, Gabriel L. Somlo wrote:
>> Turning EHCI_DEBUG on gave me compile errors. This is my best guess
>> as to what the DPRINTF arguments *should* be, hope I guessed right :)
> 
> In that case I'll let Gerd confirm whether or not the guesses are
> correct.

Already fixed in master.

cheers,
  Gerd

Patch

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index d9dc576..e3ccb59 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1188,7 +1188,7 @@  static void ehci_execute_complete(EHCIQueue *q)
            p->async == EHCI_ASYNC_FINISHED);
 
     DPRINTF("execute_complete: qhaddr 0x%x, next %x, qtdaddr 0x%x, status %d\n",
-            q->qhaddr, q->qh.next, q->qtdaddr, q->usb_status);
+            q->qhaddr, q->qh.next, q->qtdaddr, p->usb_status);
 
     if (p->usb_status < 0) {
         switch (p->usb_status) {
@@ -1305,8 +1305,8 @@  static int ehci_execute(EHCIPacket *p, const char *action)
     trace_usb_ehci_packet_action(p->queue, p, action);
     ret = usb_handle_packet(p->queue->dev, &p->packet);
     DPRINTF("submit: qh %x next %x qtd %x pid %x len %zd endp %x ret %d\n",
-            q->qhaddr, q->qh.next, q->qtdaddr, q->pid,
-            q->packet.iov.size, endp, ret);
+            p->queue->qhaddr, p->queue->qh.next, p->queue->qtdaddr, p->pid,
+            p->packet.iov.size, endp, ret);
 
     if (ret > BUFF_SIZE) {
         fprintf(stderr, "ret from usb_handle_packet > BUFF_SIZE\n");