qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] usb: drop active assert when pid is invalid


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH v2] usb: drop active assert when pid is invalid
Date: Tue, 16 Feb 2016 15:38:58 +0100

  Hi,

> > When clearing RS in cmd we should also set HALTED in status I think.

> Actually, uhci_frame_timer() had done this work.
> 
> if (!(s->cmd & UHCI_CMD_RS)) {
>         /* Full stop */
>         trace_usb_uhci_schedule_stop();
>         qemu_del_timer(s->frame_timer);
>         uhci_async_cancel_all(s);
>         /* set hchalted bit in status - UHCI11D 2.1.2 */
>         s->status |= UHCI_STS_HCHALTED;
>         return;
>     }

Ok, all fine then.

>  
> > How do we reach the assert above?  Maybe it is enough to move this pid
> 
> > check to the start of the uhci_handle_td function to avoid triggering
> 
> > the assert?
> 
> > 
> 
> If Qemu read a wrong td, and then get a wrong pid, assertion will be reached.
> I thought that method, but I gave up as more complicated.

I think if we avoid calling usb_packet_setup with an invalid pid things
should work fine.  So checking whenever the pid is valid as very first
thing in uhci_handle_td() should work, no?

cheers,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]