From b746377f45503eb79db46c650476815fcf18939b Mon Sep 17 00:00:00 2001 From: Xiaoguang Wu Date: Wed, 8 Aug 2018 20:58:01 +0800 Subject: [PATCH] DM USB: xHCI: fix an xHCI issue to enable UOS s3 feature Current DM design use two variables to do the indexing of xHCI Event Ring: er_enq_idx and er_events_cnt. They are members of the struct pci_xhci_rtsregs. In UOS, during the process of xHCI resuming, the xHCI driver will restore the ERSTBA (Event Ring Segment Table Base Address) register to be the value before suspending. And at this point, the old DM implementation will set both er_enq_idx and er_events_cnt to be zero, so the DM will access the Event Ring from the start position in the buffer. But at the same time the UOS xHCI driver still wants to access the old position in the Event Ring before suspending, which will result of unexpected errors. Signed-off-by: Xiaoguang Wu Reviewed-by: Liang Yang Acked-by: Yu Wang --- devicemodel/hw/pci/xhci.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/devicemodel/hw/pci/xhci.c b/devicemodel/hw/pci/xhci.c index e11728cf4..92f7c52fa 100644 --- a/devicemodel/hw/pci/xhci.c +++ b/devicemodel/hw/pci/xhci.c @@ -2732,9 +2732,6 @@ pci_xhci_rtsregs_write(struct pci_xhci_vdev *xdev, rts->erst_p = XHCI_GADDR(xdev, xdev->rtsregs.erstba_p->qwEvrsTablePtr & ~0x3FUL); - rts->er_enq_idx = 0; - rts->er_events_cnt = 0; - UPRINTF(LDBG, "wr erstba erst (%p) ptr 0x%lx, sz %u\r\n", rts->erstba_p, rts->erstba_p->qwEvrsTablePtr,