qemu-patch-raspberry4/hw/pci
Alex Williamson 727b48661f pci: Sync PCIe downstream port LNKSTA on read
The PCIe link speed and width between a downstream device and its
upstream port is negotiated on real hardware and susceptible to
dynamic changes due to signal issues and power management.  In the
emulated device case there is no real hardware link, but we still
might wish to have some consistency between endpoint and downstream
port via a virtual negotiation.  There is of course a real link for
assigned devices and this same virtual negotiation allows the
downstream port to match the endpoint, synchronizing on every read
to support underlying physical hardware dynamically adjusting the
link.

This negotiation is intentionally unidirectional for compatibility.
If the endpoint exceeds the capabilities of the downstream port or
there is no endpoint device, the downstream port reports negotiation
to its maximum speed and width, matching the previous case where
negotiation was absent.  De-tuning the endpoint to match a virtual
link doesn't seem to benefit anyone and is a condition we've thus
far reported without functional issues.

Note that PCI_EXP_LNKSTA is already ignored for migration
compatibility via pcie_cap_v1_fill().

Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Tested-by: Geoffrey McRae <geoff@hostfission.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2018-12-19 16:48:16 -05:00
..
Makefile.objs pci-hotplug-old: Has been dead for five major releases, bury 2015-03-01 12:37:54 +01:00
msi.c pci: Replace pci_add_capability2() with pci_add_capability() 2017-07-03 22:29:49 +03:00
msix.c vmstate: constify VMStateField 2018-11-27 15:35:15 +01:00
pci-stub.c qapi: Empty out qapi-schema.json 2018-03-02 13:45:50 -06:00
pci.c pci: Sync PCIe downstream port LNKSTA on read 2018-12-19 16:48:16 -05:00
pci_bridge.c hw/pci-bridge: Fix invalid free() 2018-12-19 16:48:16 -05:00
pci_host.c pci: Clean up includes 2016-01-29 15:07:24 +00:00
pcie.c pci: Sync PCIe downstream port LNKSTA on read 2018-12-19 16:48:16 -05:00
pcie_aer.c Drop superfluous includes of qapi/qmp/qjson.h 2018-02-09 13:52:15 +01:00
pcie_host.c PCI: PCIe access should always be little endian 2017-10-15 05:54:42 +03:00
pcie_port.c pci: Clean up includes 2016-01-29 15:07:24 +00:00
shpc.c vmstate: constify VMStateField 2018-11-27 15:35:15 +01:00
slotid_cap.c pci: Convert shpc_init() to Error 2017-07-03 22:29:49 +03:00
trace-events trace-events: fix code style: %# -> 0x% 2017-08-01 12:13:07 +01:00