PCI: dwc: designware: test PCIE_ATU_ENABLE bit to check enabled or not
PATCH v2 1/1 PCI: dwc: designware: test PCIE_ATU_ENABLE bit to check enabled or not
The ATU CTRL2 register is 32 bit, besides the enable bit, other bits may also be set. To check whether the ATU is enabled or not, we should test the enable bit.
---
Since v1:
- Add Joao's Ack
- Fix typo in commit msg, thank Jingoo
drivers/pci/dwc/pcie-designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/dwc/pcie-designware.c +1 -1
@@ -177,7 +177,7 @@ void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type,*/ for (retries =0 ; retries <LINK_WAIT_MAX_IATU_RETRIES ; retries++) { val =dw_pcie_readl_dbi (pci,PCIE_ATU_CR2 ); -if (val ==PCIE_ATU_ENABLE ) +if (val &PCIE_ATU_ENABLE )return ;usleep_range (LINK_WAIT_IATU_MIN ,LINK_WAIT_IATU_MAX );
Signature · 1 line
2.13.2
Quoted 7 lines · Jisheng Zhang
The ATU CTRL2 register is 32 bit, besides the enable bit, other bits may also be set. To check whether the ATU is enabled or not, we should test the enable bit.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Joao Pinto <[email protected]>
Best regards,
Jingoo Han
Quoted 26 lines
---
Since v1:
- Add Joao's Ack
- Fix typo in commit msg, thank Jingoodrivers/pci/dwc/pcie-designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/dwc/pcie- renamed from drivers/pci/dwc/pcie-designware.c +0
-0
designware.c
index0e03af279259..6bf0b409050a100644drivers/pci/dwc/pcie-designware.c +1
-1@@ -177,7 +177,7 @@ void dw_pcie_prog_outbound_atu(struct dw_pcie *pci,int index, int type, */ for (retries =0 ; retries <LINK_WAIT_MAX_IATU_RETRIES ; retries++) { val =dw_pcie_readl_dbi (pci,PCIE_ATU_CR2 ); -if (val ==PCIE_ATU_ENABLE ) +if (val &PCIE_ATU_ENABLE )return ;
usleep_range(LINK_WAIT_IATU_MIN, LINK_WAIT_IATU_MAX);
--
2.13.2
Quoted 6 lines · Jisheng Zhang
The ATU CTRL2 register is 32 bit, besides the enable bit, other bits may also be set. To check whether the ATU is enabled or not, we should test the enable bit.
Signed-off-by Jisheng Zhang <[email protected]>Acked-by Joao Pinto <[email protected]>
Applied with Jingoo's ack to pci/host-designware for v4.14, thanks!
Quoted 29 lines
---
Since v1:
- Add Joao's Ack
- Fix typo in commit msg, thank Jingoodrivers/pci/dwc/pcie-designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/dwc/pcie-designware.c +1
-1@@ -177,7 +177,7 @@ void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type,*/ for (retries =0 ; retries <LINK_WAIT_MAX_IATU_RETRIES ; retries++) { val =dw_pcie_readl_dbi (pci,PCIE_ATU_CR2 ); -if (val ==PCIE_ATU_ENABLE ) +if (val &PCIE_ATU_ENABLE )return ;usleep_range (LINK_WAIT_IATU_MIN ,LINK_WAIT_IATU_MAX );Signature · 7 lines
2.13.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel