]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: endpoint: Introduce 'epc_deinit' event and notify the EPF drivers
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Thu, 6 Jun 2024 07:26:35 +0000 (12:56 +0530)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Thu, 4 Jul 2024 14:40:53 +0000 (14:40 +0000)
commit473b2cf9c4d1711146da1d8574c61e92c6672892
treec82a340884616f5a2fae522e44cd257125b1f2a5
parentcfc2d4c5151bb8449fd28b2591877a514214ad4a
PCI: endpoint: Introduce 'epc_deinit' event and notify the EPF drivers

As like the 'epc_init' event, that is used to signal the EPF drivers about
the EPC initialization, let's introduce 'epc_deinit' event that is used to
signal EPC deinitialization.

The EPC deinitialization applies only when any sort of fundamental reset
is supported by the endpoint controller as per the PCIe spec.

Reference: PCIe r6.0, sec 4.2.5.9.1 and 6.6.1.

Currently, some EPC drivers like pcie-qcom-ep and pcie-tegra194 support
PERST# as the fundamental reset. So the 'deinit' event will be notified to
the EPF drivers when PERST# assert happens in the above mentioned EPC
drivers.

The EPF drivers, on receiving the event through the epc_deinit() callback
should reset the EPF state machine and also cleanup any configuration that
got affected by the fundamental reset like BAR, DMA etc...

This change also warrants skipping the cleanups in unbind() if already done
in epc_deinit().

Link: https://lore.kernel.org/r/20240606-pci-deinit-v1-2-4395534520dc@linaro.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
drivers/pci/controller/dwc/pcie-designware-ep.c
drivers/pci/controller/dwc/pcie-qcom-ep.c
drivers/pci/controller/dwc/pcie-tegra194.c
drivers/pci/endpoint/functions/pci-epf-mhi.c
drivers/pci/endpoint/functions/pci-epf-test.c
drivers/pci/endpoint/pci-epc-core.c
include/linux/pci-epc.h
include/linux/pci-epf.h