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

RE: [Xen-devel] [PATCH]UHC should not generate interrupt when USBdevice returns NAK

  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Huang, Xinmei" <xinmei.huang@xxxxxxxxx>
  • Date: Fri, 8 Dec 2006 14:34:25 +0800
  • Delivery-date: Thu, 07 Dec 2006 22:34:37 -0800
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AccYIFUctQo+acaFStST+nWBI8j1CgACMYGgAJiXCUA=
  • Thread-topic: [Xen-devel] [PATCH]UHC should not generate interrupt when USBdevice returns NAK

Hi all,
Is there any comment on this patch?

Current HID(mouse/tablet) emulator in qemu-dm persistently returns a data in an 
INTERRUPT transfer, even if the device (mouse/tablet) keeps the same status as 
the last interrupt transfer.
This behavior does not reflect the HID/USB/UHCI spec. According to HID spec, 
USB HID device (using interrupt pipe) will return an NAK indicate no interrupt 
pending(i.e. no data needs to be transferred).
Current HID always returns a data package, notifying UHC the device have data 
to transfer and a interrupt on complete will generate at the end of the frame 
in which this interrupt transfer is completed. In fact, most of these 
interrupts are useless and time-consuming.
UHC should let a TD active if receiving an NAK (in non-setup transaction) and 
will not generate an interrtupt on complete for this TD. But current UHC 
emulator in qemu-dm behaves like this: 
        1)update int_mask when a TD is fetched
        2)check int_mask to decide to generate an interrupt or not after this 
TD is executed.If NAK is return when executing this TD, an interrupt on 
complete, which is unwanted, will still be generated.

This patch makes the UHC and HID device emulators work consistently with spec, 
decreasing unwanted interrupts to Guest OS.

>-----Original Message-----
>From: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx 
>[mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of 
>Huang, Xinmei
>Sent: 2006年12月5日 12:53
>To: xen-devel@xxxxxxxxxxxxxxxxxxx
>Subject: [Xen-devel] [PATCH]UHC should not generate interrupt 
>when USBdevice returns NAK
>This patch adds support for USB mouse/tablet status check and restricts
>Universal Host Controller interrupt generating when received NAK in
>interrupt transfer.
>According to usb spec, USB mouse/tablet device returns NAK to host
>controller if its status does not alter in interrupt transfer.
>And UHC should leave a TD active when receiving NAK and execute this
>incompleted TD in a subseqent frame. 
>UHC only generates an interrupt on complete after the TD with ICO bit=1
>is completed.
>This patch obliges UHC & USB mouse/tablet to behave consistently with
>Signed-off-by: Xinmei Huang <xinmei.huang@xxxxxxxxx>

Attachment: usb.uhci.patch
Description: usb.uhci.patch

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.