PCI: armada8k: Disable LTSSM on link down interrupts
PATCH 1/1 PCI: armada8k: Disable LTSSM on link down interrupts
When a PCI link down condition is detected, the link training state machine must be disabled immediately.
--- drivers/pci/controller/dwc/pcie-armada8k.c | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+)
drivers/pci/controller/dwc/pcie-armada8k.c +38 -0
@@ -53,6 +53,10 @@ struct armada8k_pcie {#define PCIE_INT_C_ASSERT_MASK BIT(11)#define PCIE_INT_D_ASSERT_MASK BIT(12) +#define PCIE_GLOBAL_INT_CAUSE2_REG (PCIE_VENDOR_REGS_OFFSET + 0x24) +#define PCIE_GLOBAL_INT_MASK2_REG (PCIE_VENDOR_REGS_OFFSET + 0x28) +#define PCIE_INT2_PHY_RST_LINK_DOWN BIT(1) +#define PCIE_ARCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET + 0x50)#define PCIE_AWCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET + 0x54)#define PCIE_ARUSER_REG (PCIE_VENDOR_REGS_OFFSET + 0x5C)
@@ -204,6 +208,11 @@ static int armada8k_pcie_host_init(struct dw_pcie_rp *pp)PCIE_INT_C_ASSERT_MASK |PCIE_INT_D_ASSERT_MASK ;dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK1_REG , reg); +/* Also enable link down interrupts */ + reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG ); + reg |=PCIE_INT2_PHY_RST_LINK_DOWN ; +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG , reg); +return 0 ; }
@@ -221,6 +230,35 @@ static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG );dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG , val); + val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE2_REG ); + +if (PCIE_INT2_PHY_RST_LINK_DOWN & val) { +u32 ctrl_reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_CONTROL_REG ); +/* +* The link went down. Disable LTSSM immediately. This +* unlocks the root complex config registers. Downstream +* device accesses will return all-Fs +*/ + ctrl_reg &= ~(PCIE_APP_LTSSM_EN ); +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_CONTROL_REG , ctrl_reg); +/* +* Mask link down interrupts. They can be re-enabled once +* the link is retrained. +*/ + ctrl_reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG ); + ctrl_reg &= ~PCIE_INT2_PHY_RST_LINK_DOWN ; +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG , ctrl_reg); +/* +* At this point a worker thread can be triggered to +* initiate a link retrain. If link retrains were +* possible, that is. +*/ +dev_dbg (pci->dev,"%s: link went down\n" , __func__); + } + +/* Now clear the second interrupt cause. */ +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_CAUSE2_REG , val); +return IRQ_HANDLED ; }
Signature · 1 line
2.25.1
Quoted 2 lines · Jenishkumar Maheshbhai Patel
When a PCI link down condition is detected, the link training state machine must be disabled immediately.
Why?
"Immediately" has no meaning here. Arbitrary delays are possible and must not break anything.
Quoted 33 lines
Signed-off-by Jenishkumar Maheshbhai Patel <[email protected]>--- drivers/pci/controller/dwc/pcie-armada8k.c | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+)drivers/pci/controller/dwc/pcie-armada8k.c +9
-0@@ -53,6 +53,10 @@ struct armada8k_pcie {#define PCIE_INT_C_ASSERT_MASK BIT(11)#define PCIE_INT_D_ASSERT_MASK BIT(12) +#define PCIE_GLOBAL_INT_CAUSE2_REG (PCIE_VENDOR_REGS_OFFSET + 0x24) +#define PCIE_GLOBAL_INT_MASK2_REG (PCIE_VENDOR_REGS_OFFSET + 0x28) +#define PCIE_INT2_PHY_RST_LINK_DOWN BIT(1) +#define PCIE_ARCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET + 0x50)#define PCIE_AWCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET + 0x54)#define PCIE_ARUSER_REG (PCIE_VENDOR_REGS_OFFSET + 0x5C)@@ -204,6 +208,11 @@ static int armada8k_pcie_host_init(struct dw_pcie_rp *pp)PCIE_INT_C_ASSERT_MASK |PCIE_INT_D_ASSERT_MASK ;dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK1_REG , reg); +/* Also enable link down interrupts */ + reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG ); + reg |=PCIE_INT2_PHY_RST_LINK_DOWN ; +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG , reg); +return 0 ; }
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) · line 236
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +4
-0@@ -221,6 +230,35 @@ static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG );dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG , val); + val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE2_REG ); + +if (PCIE_INT2_PHY_RST_LINK_DOWN & val) { +u32 ctrl_reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_CONTROL_REG );
Add blank line.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) · line 243
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +7
-0+/* +* The link went down. Disable LTSSM immediately. This +* unlocks the root complex config registers. Downstream +* device accesses will return all-Fs +*/ + ctrl_reg &= ~(PCIE_APP_LTSSM_EN ); +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_CONTROL_REG , ctrl_reg);
And here.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) · line 250
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +7
-0+/* +* Mask link down interrupts. They can be re-enabled once +* the link is retrained. +*/ + ctrl_reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG ); + ctrl_reg &= ~PCIE_INT2_PHY_RST_LINK_DOWN ; +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG , ctrl_reg);
And here. Follow existing coding style in this file.
Quoted 17 lines
drivers/pci/controller/dwc/pcie-armada8k.c +11
-0+/* +* At this point a worker thread can be triggered to +* initiate a link retrain. If link retrains were +* possible, that is. +*/ +dev_dbg (pci->dev,"%s: link went down\n" , __func__); + } + +/* Now clear the second interrupt cause. */ +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_CAUSE2_REG , val); +return IRQ_HANDLED ; }Signature · 1 line
2.25.1
A message that is not in the archive (sent off-list or not yet received): BY3PR18MB4673E2698A6F465FEB56B5A2A7EB2@BY3PR18MB4673.namprd18.prod.outlook.com
I am writing to follow up on this serious of PCIe patches submitted by Jenish. Unfortunately, he has since left the company, and some comments on these
patches were not addressed in a timely manner. I apologize for the delay
and any inconvenience this may have caused. I have reviewed the feedback provided and am now taking over this work. I appreciate the time and effort you have put into reviewing the patch and providing valuable comments. I will ensure that the necessary changes are made and resubmit the patch in the proper manner, as it was not initially submitted as a series.
Quoted 7 lines
Quoted 2 lines
When a PCI link down condition is detected, the link training state machine must be disabled immediately.
Why?
"Immediately" has no meaning here. Arbitrary delays are possible and must not break anything.
Yes, I agree. A delay cannot be avoided. The issue we encountered is that the RC may not be aware of the link down when it happens. In this case, any access to the PCI config space may hang up PCI bus. The only thing we can do is to rely on this link down interrupt. By disabling APP_LTSSM_EN, RC will bypass all device accesses with returning all ones (for read).
Quoted 94 lines
Quoted 13 lines
Signed-off-by: Jenishkumar Maheshbhai Patel
<mailto:[email protected]>--- drivers/pci/controller/dwc/pcie-armada8k.c | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+)drivers/pci/controller/dwc/pcie-armada8k.c +0
-0drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 56
Quoted 4 lines
drivers/pci/controller/dwc/pcie-armada8k.c +1
-0@@ -53,6 +53,10 @@ struct armada8k_pcie {#define PCIE_INT_C_ASSERT_MASK BIT(11)#define PCIE_INT_D_ASSERT_MASK BIT(12) +#define PCIE_GLOBAL_INT_CAUSE2_REG (PCIE_VENDOR_REGS_OFFSET+
0x24)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 57
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +1
-0+#define PCIE_GLOBAL_INT_MASK2_REG (PCIE_VENDOR_REGS_OFFSET+
0x28)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie {
Quoted 3 lines
drivers/pci/controller/dwc/pcie-armada8k.c +2
-0+#define PCIE_INT2_PHY_RST_LINK_DOWN BIT(1) +#define PCIE_ARCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET+
0x50)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 61
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0#define PCIE_AWCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET+
0x54)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 62
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0#define PCIE_ARUSER_REG (PCIE_VENDOR_REGS_OFFSET+
0x5C)drivers/pci/controller/dwc/pcie-armada8k.c static int armada8k_pcie_host_init(struct
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0@@ -204,6 +208,11 @@ static int armada8k_pcie_host_init(struct
dw_pcie_rp*pp)drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int
Quoted 12 lines
drivers/pci/controller/dwc/pcie-armada8k.c +5
-0PCIE_INT_C_ASSERT_MASK |PCIE_INT_D_ASSERT_MASK ;dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK1_REG , reg); +/* Also enable link down interrupts */ + reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG ); + reg |=PCIE_INT2_PHY_RST_LINK_DOWN ; +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG , reg); +return 0 ; }@@ -221,6 +230,35 @@ static irqreturn_t armada8k_pcie_irq_handler(intirq, void *arg)
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +4
-0val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG );dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG , val); + val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE2_REG ); + +if (PCIE_INT2_PHY_RST_LINK_DOWN & val) { + u32 ctrl_reg = dw_pcie_readl_dbi(pci,
PCIE_GLOBAL_CONTROL_REG);Add blank line.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +7
-0+/* +* The link went down. Disable LTSSM immediately. This +* unlocks the root complex config registers. Downstream +* device accesses will return all-Fs +*/ + ctrl_reg &= ~(PCIE_APP_LTSSM_EN ); + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG,
ctrl_reg);And here.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 5 lines
drivers/pci/controller/dwc/pcie-armada8k.c +5
-0+/* +* Mask link down interrupts. They can be re-enabled once +* the link is retrained. +*/ + ctrl_reg = dw_pcie_readl_dbi(pci,
PCIE_GLOBAL_INT_MASK2_REG);drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int · line 250
Quoted 2 lines
drivers/pci/controller/dwc/pcie-armada8k.c +2
-0+ ctrl_reg &= ~PCIE_INT2_PHY_RST_LINK_DOWN ; + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK2_REG,
ctrl_reg);And here. Follow existing coding style in this file.
Quoted 17 lines
drivers/pci/controller/dwc/pcie-armada8k.c +11
-1+/* +* At this point a worker thread can be triggered to +* initiate a link retrain. If link retrains were +* possible, that is. +*/ +dev_dbg (pci->dev,"%s: link went down\n" , __func__); + } + +/* Now clear the second interrupt cause. */ +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_CAUSE2_REG , val); +return IRQ_HANDLED ; } --2.25.1
Quoted 14 lines · Wilson Ding
I am writing to follow up on this serious of PCIe patches submitted by Jenish. Unfortunately, he has since left the company, and some comments on these
patches were not addressed in a timely manner. I apologize for the delay
and any inconvenience this may have caused. I have reviewed the feedback provided and am now taking over this work. I appreciate the time and effort you have put into reviewing the patch and providing valuable comments. I will ensure that the necessary changes are made and resubmit the patch in the proper manner, as it was not initially submitted as a series.Quoted 5 lines
Quoted 2 lines
When a PCI link down condition is detected, the link training state machine must be disabled immediately.
Why?
Quoted 9 lines
Quoted 2 lines
"Immediately" has no meaning here. Arbitrary delays are possible and must not break anything.
Yes, I agree. A delay cannot be avoided. The issue we encountered is that the RC may not be aware of the link down when it happens. In this case, any access to the PCI config space may hang up PCI bus. The only thing we can do is to rely on this link down interrupt. By disabling
APP_LTSSM_EN, RC will bypass all device accesses with returning all ones (for read).
Ok. One comment below.
Quoted 75 lines
Quoted 75 lines
Quoted 13 lines
Signed-off-by: Jenishkumar Maheshbhai Patel
<mailto:[email protected]>--- drivers/pci/controller/dwc/pcie-armada8k.c | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+)drivers/pci/controller/dwc/pcie-armada8k.c +0
-0drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 56
Quoted 4 lines
drivers/pci/controller/dwc/pcie-armada8k.c +1
-0@@ -53,6 +53,10 @@ struct armada8k_pcie {#define PCIE_INT_C_ASSERT_MASK BIT(11)#define PCIE_INT_D_ASSERT_MASK BIT(12) +#define PCIE_GLOBAL_INT_CAUSE2_REG (PCIE_VENDOR_REGS_OFFSET+
0x24)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 57
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +1
-0+#define PCIE_GLOBAL_INT_MASK2_REG (PCIE_VENDOR_REGS_OFFSET+
0x28)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie {
Quoted 3 lines
drivers/pci/controller/dwc/pcie-armada8k.c +2
-0+#define PCIE_INT2_PHY_RST_LINK_DOWN BIT(1) +#define PCIE_ARCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET+
0x50)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 61
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0#define PCIE_AWCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET+
0x54)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 62
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0#define PCIE_ARUSER_REG (PCIE_VENDOR_REGS_OFFSET+
0x5C)drivers/pci/controller/dwc/pcie-armada8k.c static int armada8k_pcie_host_init(struct
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0@@ -204,6 +208,11 @@ static int armada8k_pcie_host_init(struct
dw_pcie_rp*pp)drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int
Quoted 12 lines
drivers/pci/controller/dwc/pcie-armada8k.c +5
-0PCIE_INT_C_ASSERT_MASK |PCIE_INT_D_ASSERT_MASK ;dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK1_REG , reg); +/* Also enable link down interrupts */ + reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG ); + reg |=PCIE_INT2_PHY_RST_LINK_DOWN ; +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG , reg); +return 0 ; }@@ -221,6 +230,35 @@ static irqreturn_t armada8k_pcie_irq_handler(intirq, void *arg)
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +4
-0val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG );dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG , val); + val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE2_REG ); + +if (PCIE_INT2_PHY_RST_LINK_DOWN & val) { + u32 ctrl_reg = dw_pcie_readl_dbi(pci,
PCIE_GLOBAL_CONTROL_REG);Add blank line.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +7
-0+/* +* The link went down. Disable LTSSM immediately. This +* unlocks the root complex config registers. Downstream +* device accesses will return all-Fs +*/ + ctrl_reg &= ~(PCIE_APP_LTSSM_EN ); + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG,
ctrl_reg);And here.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 5 lines
drivers/pci/controller/dwc/pcie-armada8k.c +5
-0+/* +* Mask link down interrupts. They can be re-enabled once +* the link is retrained. +*/ + ctrl_reg = dw_pcie_readl_dbi(pci,
PCIE_GLOBAL_INT_MASK2_REG);drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int · line 250
Quoted 2 lines
drivers/pci/controller/dwc/pcie-armada8k.c +2
-0+ ctrl_reg &= ~PCIE_INT2_PHY_RST_LINK_DOWN ; + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK2_REG,
ctrl_reg);
Quoted 7 lines
Quoted 7 lines
And here. Follow existing coding style in this file.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) · line 255
Quoted 5 lines
drivers/pci/controller/dwc/pcie-armada8k.c +5
-0+/* +* At this point a worker thread can be triggered to +* initiate a link retrain. If link retrains were +* possible, that is. +*/
Who is supposed to retrain the link? Where is the worker thread?
- Mani
Signature · 1 line
மணிவண்ணன் சதாசிவம்
Quoted 135 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Friday, February 7, 2025 9:34 AM
To: Wilson Ding <[email protected]>
Cc: Bjorn Helgaas <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; Sanghoon Lee <[email protected]>
Subject: [EXTERNAL] Re: [PATCH 1/1] PCI: armada8k: Disable LTSSM on link down interruptsOn Sat, Feb 01, 2025 at 12: 57: 56AM +0000, Wilson Ding wrote: > I am writing to follow up on this serious of PCIe patches submitted by Jenish. > Unfortunately, he has since left the company, and some comments on these > patches were
Quoted 6 lines · Wilson Ding
I am writing to follow up on this serious of PCIe patches submitted by Jenish. Unfortunately, he has since left the company, and some comments on these patches were not addressed in a timely manner. I apologize for the delay and any inconvenience this may have caused. I have reviewed the feedback provided and am now taking over this work. I appreciate the time and effort you have put into reviewing the patch and providing
valuable comments.
Quoted 8 lines
I will ensure that the necessary changes are made and resubmit the patch in the proper manner, as it was not initially submitted as a series.
Quoted 5 lines
Quoted 2 lines
When a PCI link down condition is detected, the link training state machine must be disabled immediately.
Why?
Quoted 8 lines
Quoted 2 lines
"Immediately" has no meaning here. Arbitrary delays are possible and must not break anything.
Yes, I agree. A delay cannot be avoided. The issue we encountered is that the RC may not be aware of the link down when it happens. In this case, any access to the PCI config space may hang up PCI bus. The only thing we can do is to rely on this link down interrupt. By disabling
APP_LTSSM_EN, RC will bypass all device accesses with returning all ones (forread).
Quoted 1 line
Ok. One comment below.
Quoted 19 lines
Quoted 19 lines
Quoted 13 lines
Signed-off-by: Jenishkumar Maheshbhai Patel
<mailto:[email protected]>--- drivers/pci/controller/dwc/pcie-armada8k.c | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+)drivers/pci/controller/dwc/pcie-armada8k.c +0
-0drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 56
Quoted 4 lines
drivers/pci/controller/dwc/pcie-armada8k.c +1
-0@@ -53,6 +53,10 @@ struct armada8k_pcie {#define PCIE_INT_C_ASSERT_MASK BIT(11)#define PCIE_INT_D_ASSERT_MASK BIT(12) +#define PCIE_GLOBAL_INT_CAUSE2_REG (PCIE_VENDOR_REGS_OFFSET+
0x24)Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +1
-0+#define PCIE_GLOBAL_INT_MASK2_REG (PCIE_VENDOR_REGS_OFFSETQuoted 8 lines
Quoted 8 lines
+
0x28)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie {
Quoted 3 lines
drivers/pci/controller/dwc/pcie-armada8k.c +2
-0+#define PCIE_INT2_PHY_RST_LINK_DOWN BIT(1) +#define PCIE_ARCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET+
0x50)drivers/pci/controller/dwc/pcie-armada8k.c struct armada8k_pcie { · line 61
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0#define PCIE_AWCACHE_TRC_REG (PCIE_VENDOR_REGS_OFFSET+
0x54)Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0#define PCIE_ARUSER_REG (
PCIE_VENDOR_REGS_OFFSETQuoted 49 lines
Quoted 49 lines
+
0x5C)drivers/pci/controller/dwc/pcie-armada8k.c static int armada8k_pcie_host_init(struct
Quoted 1 line
drivers/pci/controller/dwc/pcie-armada8k.c +0
-0@@ -204,6 +208,11 @@ static int armada8k_pcie_host_init(struct
dw_pcie_rp*pp)Quoted 12 lines
drivers/pci/controller/dwc/pcie-armada8k.c +5
-0PCIE_INT_C_ASSERT_MASK |PCIE_INT_D_ASSERT_MASK ;dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK1_REG , reg); +/* Also enable link down interrupts */ + reg =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG ); + reg |=PCIE_INT2_PHY_RST_LINK_DOWN ; +dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_MASK2_REG , reg); +return 0 ; }@@ -221,6 +230,35 @@ static irqreturn_tQuoted 1 line
armada8k_pcie_irq_handler(int
irq, void *arg)
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +4
-0val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG );dw_pcie_writel_dbi (pci,PCIE_GLOBAL_INT_CAUSE1_REG , val); + val =dw_pcie_readl_dbi (pci,PCIE_GLOBAL_INT_CAUSE2_REG ); + +if (PCIE_INT2_PHY_RST_LINK_DOWN & val) { + u32 ctrl_reg = dw_pcie_readl_dbi(pci,
PCIE_GLOBAL_CONTROL_REG);Add blank line.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 7 lines
drivers/pci/controller/dwc/pcie-armada8k.c +7
-0+/* +* The link went down. Disable LTSSM immediately. This +* unlocks the root complex config registers. Downstream +* device accesses will return all-Fs +*/ + ctrl_reg &= ~(PCIE_APP_LTSSM_EN ); + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_CONTROL_REG,
ctrl_reg);And here.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg)
Quoted 5 lines
drivers/pci/controller/dwc/pcie-armada8k.c +5
-0+/* +* Mask link down interrupts. They can be re-enabled once +* the link is retrained. +*/ + ctrl_reg = dw_pcie_readl_dbi(pci,
PCIE_GLOBAL_INT_MASK2_REG);drivers/pci/controller/dwc/pcie-armada8k.c
Quoted 2 lines
drivers/pci/controller/dwc/pcie-armada8k.c +2
-0+ ctrl_reg &= ~PCIE_INT2_PHY_RST_LINK_DOWN ; + dw_pcie_writel_dbi(pci, PCIE_GLOBAL_INT_MASK2_REG,
ctrl_reg);Quoted 7 lines
Quoted 7 lines
And here. Follow existing coding style in this file.
drivers/pci/controller/dwc/pcie-armada8k.c static irqreturn_t armada8k_pcie_irq_handler(int irq, void *arg) · line 255
Quoted 5 lines
drivers/pci/controller/dwc/pcie-armada8k.c +5
-0+/* +* At this point a worker thread can be triggered to +* initiate a link retrain. If link retrains were +* possible, that is. +*/ Who is supposed to retrain the link? Where is the worker thread?
Quoted 1 line
- Mani
The worker thread is added by another patch posted separately. And you have some comments on that thread ([PATCH 1/1] PCI: armada8k: Add link- down handle) regarding removing and rescanning the root port. I am sorry for the mess and confusions. I am fixing the comments received previously and will push a new version of patches as a series next week.
Quoted 3 lines
--
மணிவண்ணன் சதாசிவம்