• Gavin Shan's avatar
    powerpc/eeh: Avoid I/O access during PE reset · 78954700
    Gavin Shan authored
    We have suffered recrusive frozen PE a lot, which was caused
    by IO accesses during the PE reset. Ben came up with the good
    idea to keep frozen PE until recovery (BAR restore) gets done.
    With that, IO accesses during PE reset are dropped by hardware
    and wouldn't incur the recrusive frozen PE any more.
    
    The patch implements the idea. We don't clear the frozen state
    until PE reset is done completely. During the period, the EEH
    core expects unfrozen state from backend to keep going. So we
    have to reuse EEH_PE_RESET flag, which has been set during PE
    reset, to return normal state from backend. The side effect is
    we have to clear frozen state for towice (PE reset and clear it
    explicitly), but that's harmless.
    
    We have some limitations on pHyp. pHyp doesn't allow to enable
    IO or DMA for unfrozen PE. So we don't enable them on unfrozen PE
    in eeh_pci_enable(). We have to enable IO before grabbing logs on
    pHyp. Otherwise, 0xFF's is always returned from PCI config space.
    Also, we had wrong return value from eeh_pci_enable() for
    EEH_OPT_THAW_DMA case. The patch fixes it too.
    Signed-off-by: default avatarGavin Shan <gwshan@linux.vnet.ibm.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    78954700
eeh.c 31.4 KB