* [PATCH] PCI: dwc: endpoint: Clear outbound address on unmap
@ 2024-10-04 14:10 Damien Le Moal
2024-10-04 22:10 ` Bjorn Helgaas
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Damien Le Moal @ 2024-10-04 14:10 UTC (permalink / raw)
To: Bjorn Helgaas, Jingoo Han, Manivannan Sadhasivam,
Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
linux-pci
Cc: Niklas Cassel
In addition to clearing the atu index bit in ob_window_map, also clear
the address mapped (outbound_addr array) in dw_pcie_ep_unmap_addr(), to
make sure that dw_pcie_find_index() does not endup matching again an ATU
index that was already unmapped.
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
drivers/pci/controller/dwc/pcie-designware-ep.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 501e527c188e..7f4c082a2d90 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -294,6 +294,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);
}
--
2.46.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] PCI: dwc: endpoint: Clear outbound address on unmap
2024-10-04 14:10 [PATCH] PCI: dwc: endpoint: Clear outbound address on unmap Damien Le Moal
@ 2024-10-04 22:10 ` Bjorn Helgaas
2024-10-15 5:54 ` Manivannan Sadhasivam
2024-10-27 20:07 ` Krzysztof Wilczyński
2 siblings, 0 replies; 4+ messages in thread
From: Bjorn Helgaas @ 2024-10-04 22:10 UTC (permalink / raw)
To: Damien Le Moal
Cc: Bjorn Helgaas, Jingoo Han, Manivannan Sadhasivam,
Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
linux-pci, Niklas Cassel
On Fri, Oct 04, 2024 at 11:10:00PM +0900, Damien Le Moal wrote:
> In addition to clearing the atu index bit in ob_window_map, also clear
> the address mapped (outbound_addr array) in dw_pcie_ep_unmap_addr(), to
> make sure that dw_pcie_find_index() does not endup matching again an ATU
> index that was already unmapped.
s/atu/ATU/ to match other usage
s/endup matching again/match/
No need to repost for this, whoever applies it can tweak it.
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> ---
> drivers/pci/controller/dwc/pcie-designware-ep.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
> index 501e527c188e..7f4c082a2d90 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
> @@ -294,6 +294,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);
> }
> --
> 2.46.2
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: dwc: endpoint: Clear outbound address on unmap
2024-10-04 14:10 [PATCH] PCI: dwc: endpoint: Clear outbound address on unmap Damien Le Moal
2024-10-04 22:10 ` Bjorn Helgaas
@ 2024-10-15 5:54 ` Manivannan Sadhasivam
2024-10-27 20:07 ` Krzysztof Wilczyński
2 siblings, 0 replies; 4+ messages in thread
From: Manivannan Sadhasivam @ 2024-10-15 5:54 UTC (permalink / raw)
To: Damien Le Moal
Cc: Bjorn Helgaas, Jingoo Han, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, linux-pci, Niklas Cassel
On Fri, Oct 04, 2024 at 11:10:00PM +0900, Damien Le Moal wrote:
> In addition to clearing the atu index bit in ob_window_map, also clear
> the address mapped (outbound_addr array) in dw_pcie_ep_unmap_addr(), to
> make sure that dw_pcie_find_index() does not endup matching again an ATU
> index that was already unmapped.
>
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
- Mani
> ---
> drivers/pci/controller/dwc/pcie-designware-ep.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
> index 501e527c188e..7f4c082a2d90 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
> @@ -294,6 +294,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);
> }
> --
> 2.46.2
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] PCI: dwc: endpoint: Clear outbound address on unmap
2024-10-04 14:10 [PATCH] PCI: dwc: endpoint: Clear outbound address on unmap Damien Le Moal
2024-10-04 22:10 ` Bjorn Helgaas
2024-10-15 5:54 ` Manivannan Sadhasivam
@ 2024-10-27 20:07 ` Krzysztof Wilczyński
2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Wilczyński @ 2024-10-27 20:07 UTC (permalink / raw)
To: Damien Le Moal
Cc: Bjorn Helgaas, Jingoo Han, Manivannan Sadhasivam,
Lorenzo Pieralisi, Rob Herring, linux-pci, Niklas Cassel
Hello,
> In addition to clearing the atu index bit in ob_window_map, also clear
> the address mapped (outbound_addr array) in dw_pcie_ep_unmap_addr(), to
> make sure that dw_pcie_find_index() does not endup matching again an ATU
> index that was already unmapped.
Applied to controller/dwc, thank you!
[1/1] PCI: dwc: endpoint: Clear outbound address on unmap
https://git.kernel.org/pci/pci/c/12dd12821f1e
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-27 20:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-04 14:10 [PATCH] PCI: dwc: endpoint: Clear outbound address on unmap Damien Le Moal
2024-10-04 22:10 ` Bjorn Helgaas
2024-10-15 5:54 ` Manivannan Sadhasivam
2024-10-27 20:07 ` Krzysztof Wilczyński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).