Skip to contentSkip to conversation

PCI: dwc: designware: test PCIE_ATU_ENABLE bit to check enabled or not

PATCH Superseded Jisheng Zhang 3 participants 3 messages Jul 13, 2017 – Jul 17, 2017 PCI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 it.

---
 drivers/pci/dwc/pcie-designware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/dwc/pcie-designware.c +1 -1
index 0e03af279259..6bf0b409050a 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw

Hi,

?s 11:35 AM de 7/13/2017, Jisheng Zhang escreveu:

Quoted 15 lines

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 it.

---
 drivers/pci/dwc/pcie-designware.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/dwc/pcie-designware.c +0 -0
index 0e03af279259..6bf0b409050a 100644

drivers/pci/dwc/pcie-designware.c void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type, · line 183

Quoted 8 lines
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);

Make sense, turn it more accurate. Thanks!

#2 lore raw
Quoted 7 lines · Joao Pinto

Hi,

?s 11:35 AM de 7/13/2017, Jisheng Zhang escreveu:

Quoted 3 lines

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 it.

To Jisheng Zhang,

typo s/it/bit

"test the enable it." ---> "test the enable bit."

Please fix this typo, and send it again.
Type is confusing.

Best regards,
Jingoo Han

Quoted 26 lines

drivers/pci/dwc/pcie-

Quoted 7 lines
---
 drivers/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

drivers/pci/dwc/pcie-designware.c void dw_pcie_prog_outbound_atu(struct dw_pcie *pci,

Quoted 4 lines

index 0e03af279259..6bf0b409050a 100644

drivers/pci/dwc/pcie-designware.c +0 -0
@@ -177,7 +177,7 @@ void dw_pcie_prog_outbound_atu(struct dw_pcie *pci,

int index, int type,

drivers/pci/dwc/pcie-designware.c void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, · line 178

Quoted 2 lines
drivers/pci/dwc/pcie-designware.c +0 -0
 	 */
 	for (retries = 0; retries < LINK_WAIT_MAX_IATU_RETRIES; retries++)

{

drivers/pci/dwc/pcie-designware.c void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type, · line 183

Quoted 7 lines
drivers/pci/dwc/pcie-designware.c +1 -1
 		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);

Make sense, turn it more accurate. Thanks!