The existing XHCI code reads the Event Ring Segment Table Base Address
Register (ERSTBA) every time when it is changed. However zero is its
default state so one would think that zero there means it is not in use.
This adds a check for ERSTBA in addition to the existing check for
the Event Ring Segment Table Size Register (ERSTSZ).
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Message-id:
20170911065606.40600-1-aik@ozlabs.ru
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
{
XHCIInterrupter *intr = &xhci->intr[v];
XHCIEvRingSeg seg;
+ dma_addr_t erstba = xhci_addr64(intr->erstba_low, intr->erstba_high);
- if (intr->erstsz == 0) {
+ if (intr->erstsz == 0 || erstba == 0) {
/* disabled */
intr->er_start = 0;
intr->er_size = 0;
xhci_die(xhci);
return;
}
- dma_addr_t erstba = xhci_addr64(intr->erstba_low, intr->erstba_high);
pci_dma_read(PCI_DEVICE(xhci), erstba, &seg, sizeof(seg));
le32_to_cpus(&seg.addr_low);
le32_to_cpus(&seg.addr_high);