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: 63840ff53223 ("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
..
2024-09-19 11:12:49 +02:00
2024-09-27 11:42:03 -07:00
2024-09-27 09:05:18 -07:00
2024-09-27 08:48:37 -07:00
2024-09-27 10:27:22 -07:00
2024-09-27 08:48:37 -07:00
2024-09-26 12:00:25 -07:00
2024-09-17 15:27:01 +02:00
2024-09-18 10:49:45 +02:00
2024-09-27 11:42:03 -07:00
2024-09-26 12:00:25 -07:00
2024-09-19 10:18:15 +02:00
2024-09-28 08:47:46 -07:00
2024-09-19 10:18:15 +02:00
2024-09-29 09:47:33 -07:00
2024-09-09 08:36:23 +02:00
2024-09-27 09:12:51 -07:00
2024-09-29 09:22:34 -07:00
2024-09-26 08:43:17 -07:00
2024-09-25 14:56:40 -07:00
2024-09-24 13:02:06 -07:00
2024-09-23 14:05:10 -07:00
2024-09-26 12:00:25 -07:00
2024-09-26 12:00:25 -07:00
2024-09-26 12:00:25 -07:00
2024-09-29 09:22:34 -07:00
2024-09-26 12:00:25 -07:00
2024-09-23 14:00:46 -07:00
2024-09-09 12:22:06 +02:00
2024-09-29 09:22:34 -07:00
2024-09-11 16:02:54 +02:00
2024-09-26 08:43:17 -07:00
2024-09-26 08:43:17 -07:00
2024-09-26 08:43:17 -07:00
2024-09-27 09:55:30 -07:00
2024-09-04 17:24:58 -05:00