* [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting
@ 2015-05-05 9:59 Gerd Hoffmann
2015-05-05 9:59 ` [Qemu-devel] [PATCH 1/2] Revert "xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set" Gerd Hoffmann
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-05-05 9:59 UTC (permalink / raw)
To: qemu-devel; +Cc: lersek, Gerd Hoffmann
Hi,
Laszlos fix unfortunaly had unwanted side effects, so we have
to take a different approach to fix the issue at hand.
please review,
Gerd
Gerd Hoffmann (2):
Revert "xhci: generate a Transfer Event for each Transfer TRB with the
IOC bit set"
xhci: fix events for setup trb.
hw/usb/hcd-xhci.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 1/2] Revert "xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set"
2015-05-05 9:59 [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting Gerd Hoffmann
@ 2015-05-05 9:59 ` Gerd Hoffmann
2015-05-05 9:59 ` [Qemu-devel] [PATCH 2/2] xhci: fix events for setup trb Gerd Hoffmann
2015-05-05 10:59 ` [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting Laszlo Ersek
2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-05-05 9:59 UTC (permalink / raw)
To: qemu-devel; +Cc: lersek, Gerd Hoffmann
This makes xhci generate multiple short packet events in case of
multi-trb transfers. Which is wrong. We need to fix this in a
different way.
This reverts commit aa6857891df614c620e6e9fc4bc4af6e0e49cafd.
---
hw/usb/hcd-xhci.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 2af3dd6..39aacf7 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1767,18 +1767,9 @@ static void xhci_xfer_report(XHCITransfer *xfer)
break;
}
- /*
- * XHCI 1.1, 4.11.3.1 Transfer Event TRB -- "each Transfer TRB
- * encountered with its IOC flag set to '1' shall generate a Transfer
- * Event."
- *
- * Otherwise, longer transfers can have multiple data TRBs (for scatter
- * gather). Short transfers and errors should be reported once per
- * transfer only.
- */
- if ((trb->control & TRB_TR_IOC) ||
- (!reported && ((shortpkt && (trb->control & TRB_TR_ISP)) ||
- (xfer->status != CC_SUCCESS && left == 0)))) {
+ if (!reported && ((trb->control & TRB_TR_IOC) ||
+ (shortpkt && (trb->control & TRB_TR_ISP)) ||
+ (xfer->status != CC_SUCCESS && left == 0))) {
event.slotid = xfer->slotid;
event.epid = xfer->epid;
event.length = (trb->status & 0x1ffff) - chunk;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PATCH 2/2] xhci: fix events for setup trb.
2015-05-05 9:59 [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting Gerd Hoffmann
2015-05-05 9:59 ` [Qemu-devel] [PATCH 1/2] Revert "xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set" Gerd Hoffmann
@ 2015-05-05 9:59 ` Gerd Hoffmann
2015-05-05 10:59 ` [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting Laszlo Ersek
2 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2015-05-05 9:59 UTC (permalink / raw)
To: qemu-devel; +Cc: lersek, Gerd Hoffmann
When we find a IOC bit set on a setup trb and therefore queue an event,
that should not stop events being generated for following data trbs.
So clear the 'reported' flag.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb/hcd-xhci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 39aacf7..927dc36 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1793,6 +1793,14 @@ static void xhci_xfer_report(XHCITransfer *xfer)
return;
}
}
+
+ switch (TRB_TYPE(*trb)) {
+ case TR_SETUP:
+ reported = 0;
+ shortpkt = 0;
+ break;
+ }
+
}
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting
2015-05-05 9:59 [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting Gerd Hoffmann
2015-05-05 9:59 ` [Qemu-devel] [PATCH 1/2] Revert "xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set" Gerd Hoffmann
2015-05-05 9:59 ` [Qemu-devel] [PATCH 2/2] xhci: fix events for setup trb Gerd Hoffmann
@ 2015-05-05 10:59 ` Laszlo Ersek
2 siblings, 0 replies; 4+ messages in thread
From: Laszlo Ersek @ 2015-05-05 10:59 UTC (permalink / raw)
To: Gerd Hoffmann, qemu-devel
On 05/05/15 11:59, Gerd Hoffmann wrote:
> Hi,
>
> Laszlos fix unfortunaly had unwanted side effects, so we have
> to take a different approach to fix the issue at hand.
>
> please review,
> Gerd
>
> Gerd Hoffmann (2):
> Revert "xhci: generate a Transfer Event for each Transfer TRB with the
> IOC bit set"
> xhci: fix events for setup trb.
>
> hw/usb/hcd-xhci.c | 23 +++++++++++------------
> 1 file changed, 11 insertions(+), 12 deletions(-)
>
Tested-by: Laszlo Ersek <lersek@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-05 10:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-05 9:59 [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting Gerd Hoffmann
2015-05-05 9:59 ` [Qemu-devel] [PATCH 1/2] Revert "xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set" Gerd Hoffmann
2015-05-05 9:59 ` [Qemu-devel] [PATCH 2/2] xhci: fix events for setup trb Gerd Hoffmann
2015-05-05 10:59 ` [Qemu-devel] [PATCH 0/2] xhci: fix control transfer event reporting Laszlo Ersek
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).