linux-stable/drivers/pci/endpoint
Zijun Hu 688d2eb4c6
PCI: endpoint: Clear secondary (not primary) EPC in pci_epc_remove_epf()
In addition to a primary endpoint controller, an endpoint function may be
associated with a secondary endpoint controller, epf->sec_epc, to provide
NTB (non-transparent bridge) functionality.

Previously, pci_epc_remove_epf() incorrectly cleared epf->epc instead of
epf->sec_epc when removing from the secondary endpoint controller.

Extend the epc->list_lock coverage and clear either epf->epc or
epf->sec_epc as indicated.

Link: https://lore.kernel.org/r/20241107-epc_rfc-v2-2-da5b6a99a66f@quicinc.com
Fixes: 63840ff532 ("PCI: endpoint: Add support to associate secondary EPC with EPF")
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
[mani: reworded subject and description]
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Cc: stable@vger.kernel.org
2024-11-18 17:18:19 +00:00
..
functions PCI: endpoint: epf-mhi: Avoid NULL dereference if DT lacks 'mmio' 2024-11-16 18:20:11 +00:00
Kconfig PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
Makefile PCI: Add SPDX GPL-2.0 when no license was specified 2018-01-26 11:45:16 -06:00
pci-ep-cfs.c PCI: endpoint: Remove unused field in struct pci_epf_group 2024-05-28 11:13:48 -05:00
pci-epc-core.c PCI: endpoint: Clear secondary (not primary) EPC in pci_epc_remove_epf() 2024-11-18 17:18:19 +00:00
pci-epc-mem.c PCI: endpoint: Improve pci_epc_mem_alloc_addr() 2024-10-12 17:25:54 +05:30
pci-epf-core.c driver core: have match() callback in struct bus_type take a const * 2024-07-03 15:16:54 +02:00