• Mingchuang Qiao's avatar
    PCI: Re-enable Downstream Port LTR after reset or hotplug · e1b0d0bb
    Mingchuang Qiao authored
    Per PCIe r5.0, sec 7.5.3.16, Downstream Ports must disable LTR if the link
    goes down (the Port goes DL_Down status).  This is a problem because the
    Downstream Port's dev->ltr_path is still set, so we think LTR is still
    enabled, and we enable LTR in the Endpoint.  When it sends LTR messages,
    they cause Unsupported Request errors at the Downstream Port.
    
    This happens in the reset path, where we may enable LTR in
    pci_restore_pcie_state() even though the Downstream Port disabled LTR
    because the reset caused a link down event.
    
    It also happens in the hot-remove and hot-add path, where we may enable LTR
    in pci_configure_ltr() even though the Downstream Port disabled LTR when
    the hot-remove took the link down.
    
    In these two scenarios, check the upstream bridge and restore its LTR
    enable if appropriate.
    
    The Unsupported Request may be logged by AER as follows:
    
      pcieport 0000:00:1d.0: AER: Uncorrected (Non-Fatal) error received: id=00e8
      pcieport 0000:00:1d.0: PCIe Bus Error: severity=Uncorrected (Non-Fatal), type=Transaction Layer, id=00e8(Requester ID)
      pcieport 0000:00:1d.0:   device [8086:9d18] error status/mask=00100000/00010000
      pcieport 0000:00:1d.0:    [20] Unsupported Request    (First)
    
    In addition, if LTR is not configured correctly, the link cannot enter the
    L1.2 state, which prevents some machines from entering the S0ix low power
    state.
    
    [bhelgaas: commit log]
    Link: https://lore.kernel.org/r/20211012075614.54576-1-mingchuang.qiao@mediatek.comReported-by: default avatarUtkarsh H Patel <utkarsh.h.patel@intel.com>
    Signed-off-by: default avatarMingchuang Qiao <mingchuang.qiao@mediatek.com>
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
    e1b0d0bb
probe.c 85.4 KB