• James Puthukattukaran's avatar
    PCI: Workaround IDT switch ACS Source Validation erratum · aa667c64
    James Puthukattukaran authored
    Some IDT switches incorrectly flag an ACS Source Validation error on
    completions for config read requests even though PCIe r4.0, sec 6.12.1.1,
    says that completions are never affected by ACS Source Validation.  Here's
    the text of IDT 89H32H8G3-YC, erratum #36:
    
      Item #36 - Downstream port applies ACS Source Validation to Completions
      Section 6.12.1.1 of the PCI Express Base Specification 3.1 states that
      completions are never affected by ACS Source Validation.  However,
      completions received by a downstream port of the PCIe switch from a
      device that has not yet captured a PCIe bus number are incorrectly
      dropped by ACS Source Validation by the switch downstream port.
    
      Workaround: Issue a CfgWr1 to the downstream device before issuing the
      first CfgRd1 to the device.  This allows the downstream device to capture
      its bus number; ACS Source Validation no longer stops completions from
      being forwarded by the downstream port.  It has been observed that
      Microsoft Windows implements this workaround already; however, some
      versions of Linux and other operating systems may not.
    
    When doing the first config read to probe for a device, if the device is
    behind an IDT switch with this erratum:
    
      1. Disable ACS Source Validation if enabled
      2. Wait for device to become ready to accept config accesses (by using
         the Config Request Retry Status mechanism)
      3. Do a config write to the endpoint
      4. Enable ACS Source Validation (if it was enabled to begin with)
    
    The workaround suggested by IDT is basically only step 3, but we don't know
    when the device is ready to accept config requests.  That means we need to
    do config reads until we receive a non-Config Request Retry Status, which
    means we need to disable ACS SV temporarily.
    Signed-off-by: default avatarJames Puthukattukaran <james.puthukattukaran@oracle.com>
    [bhelgaas: changelog, clean up whitespace, fold in unused variable fix
    from Anders Roxell <anders.roxell@linaro.org>]
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    aa667c64
quirks.c 171 KB