]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: dwc: endpoint: Clear outbound address on unmap
authorDamien Le Moal <dlemoal@kernel.org>
Fri, 4 Oct 2024 14:10:00 +0000 (23:10 +0900)
committerKrzysztof Wilczyński <kwilczynski@kernel.org>
Sun, 27 Oct 2024 19:43:44 +0000 (19:43 +0000)
Clear the address mapped (outbound_addr array) in dw_pcie_ep_unmap_addr(),
to ensure that dw_pcie_find_index() does not match an ATU index that was
already unmapped.

This is in addition to clearing the ATU index bit in ob_window_map.

Link: https://lore.kernel.org/linux-pci/20241004141000.5080-1-dlemoal@kernel.org
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
[kwilczynski: commit log]
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
drivers/pci/controller/dwc/pcie-designware-ep.c

index 43ba5c6738df1a534dc827ab0bf4cb52fd0e40d3..b07ace7dc92ede278e2b21af460fdae1f5691338 100644 (file)
@@ -280,6 +280,7 @@ static void dw_pcie_ep_unmap_addr(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
        if (ret < 0)
                return;
 
+       ep->outbound_addr[atu_index] = 0;
        dw_pcie_disable_atu(pci, PCIE_ATU_REGION_DIR_OB, atu_index);
        clear_bit(atu_index, ep->ob_window_map);
 }