Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176034823
D60739.id189952.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D60739.id189952.diff
View Options
diff --git a/usr.sbin/bhyve/pci_xhci.c b/usr.sbin/bhyve/pci_xhci.c
--- a/usr.sbin/bhyve/pci_xhci.c
+++ b/usr.sbin/bhyve/pci_xhci.c
@@ -746,7 +746,6 @@
uint64_t erdp;
int erdp_idx;
int err;
- struct xhci_trb *evtrbptr;
err = XHCI_TRB_ERROR_SUCCESS;
@@ -765,8 +764,6 @@
erdp, rts->erstba_p->qwEvrsTablePtr,
rts->erstba_p->dwEvrsTableSize, do_intr));
- evtrbptr = &rts->erst_p[rts->er_enq_idx];
-
/* TODO: multi-segment table */
if (rts->er_events_cnt >= rts->er_size) {
DPRINTF(("pci_xhci[%d] cannot insert event; ring full",
@@ -778,29 +775,30 @@
if (rts->er_events_cnt == rts->er_size - 1) {
struct xhci_trb errev;
- if ((evtrbptr->dwTrb3 & 0x1) == (rts->event_pcs & 0x1)) {
-
- DPRINTF(("pci_xhci[%d] insert evt err: ring full",
- __LINE__));
-
- errev.qwTrb0 = 0;
- errev.dwTrb2 = XHCI_TRB_2_ERROR_SET(
- XHCI_TRB_ERROR_EV_RING_FULL);
- errev.dwTrb3 = XHCI_TRB_3_TYPE_SET(
- XHCI_TRB_EVENT_HOST_CTRL) |
- rts->event_pcs;
- rts->er_events_cnt++;
- memcpy(&rts->erst_p[rts->er_enq_idx], &errev,
- sizeof(struct xhci_trb));
- rts->er_enq_idx = (rts->er_enq_idx + 1) % rts->er_size;
- err = XHCI_TRB_ERROR_EV_RING_FULL;
- do_intr = 1;
+ /*
+ * Only the Event Ring Full Error goes into the last free slot
+ * (xHCI 4.9.4); like any other event it carries the producer
+ * cycle state, which toggles when the ring wraps.
+ */
+ DPRINTF(("pci_xhci[%d] insert evt err: ring full",
+ __LINE__));
- goto done;
- }
- } else {
+ errev.qwTrb0 = 0;
+ errev.dwTrb2 = XHCI_TRB_2_ERROR_SET(XHCI_TRB_ERROR_EV_RING_FULL);
+ errev.dwTrb3 = XHCI_TRB_3_TYPE_SET(XHCI_TRB_EVENT_HOST_CTRL) |
+ rts->event_pcs;
rts->er_events_cnt++;
+ memcpy(&rts->erst_p[rts->er_enq_idx], &errev,
+ sizeof(struct xhci_trb));
+ rts->er_enq_idx = (rts->er_enq_idx + 1) % rts->er_size;
+ if (rts->er_enq_idx == 0)
+ rts->event_pcs ^= 1;
+ err = XHCI_TRB_ERROR_EV_RING_FULL;
+ do_intr = 1;
+
+ goto done;
}
+ rts->er_events_cnt++;
evtrb->dwTrb3 &= ~XHCI_TRB_3_CYCLE_BIT;
evtrb->dwTrb3 |= rts->event_pcs;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 16, 12:17 PM (9 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40883913
Default Alt Text
D60739.id189952.diff (2 KB)
Attached To
Mode
D60739: bhyve: Keep the xhci event ring's fill count right when it is nearly full
Attached
Detach File
Event Timeline
Log In to Comment