Unverified Commit 688d2eb4 authored by Zijun Hu's avatar Zijun Hu Committed by Krzysztof Wilczyński
Browse files

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: 63840ff5 ("PCI: endpoint: Add support to associate secondary EPC with EPF")
Signed-off-by: default avatarZijun Hu <quic_zijuhu@quicinc.com>
Reviewed-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
[mani: reworded subject and description]
Signed-off-by: default avatarManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
[bhelgaas: commit log]
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
Cc: stable@vger.kernel.org
parent 4acc902e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment