]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: dwc: Add generic MSG TLP support for sending PME_Turn_Off when system suspend
authorFrank Li <Frank.Li@nxp.com>
Thu, 18 Apr 2024 16:04:28 +0000 (12:04 -0400)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 9 Jul 2024 23:20:15 +0000 (18:20 -0500)
commite1a4ec1a9520bf048a7ee09f7f7a82b1d44750ac
tree1f42c9fae6d0f7c4785ce7576a5496eba8196acf
parent9972b17712e434f1284bc85d77a2fdbb33db6c51
PCI: dwc: Add generic MSG TLP support for sending PME_Turn_Off when system suspend

Instead of relying on the vendor specific implementations to send the
PME_Turn_Off message, introduce a generic way of sending the message using
the MSG TLP.

This is achieved by reserving a region for MSG TLP of size
'pci->region_align', at the end of the first IORESOURCE_MEM window of the
host bridge. And then sending the PME_Turn_Off message during system
suspend with the help of iATU.

The reason for reserving the MSG TLP region at the end of the
IORESOURCE_MEM is to avoid generating holes in between, because when the
region is allocated using allocate_resource(), memory will be allocated
from the start of the window. Later, if memory gets allocated for an
endpoint of size bigger than 'region_align', there will be a hole between
MSG TLP region and endpoint memory.

This generic implementation is optional for the glue drivers and can be
overridden by a custom 'pme_turn_off' callback.

Link: https://lore.kernel.org/linux-pci/20240418-pme_msg-v8-5-a54265c39742@nxp.com
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/controller/dwc/pcie-designware-host.c
drivers/pci/controller/dwc/pcie-designware.h