Skip to contentSkip to conversation

PCI: tegra194: Remove unnecessary MSI enable reg save and restore

PATCH Applied Jisheng Zhang 3 participants 4 messages Dec 26, 2021 – Apr 11, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: tegra194: Remove unnecessary MSI enable reg save and restore

The integrated MSI Receiver enable register is always initialized in dw_pcie_setup_rc() which is also called in resume code path, so we don't need to save/restore the enable register during suspend/resume.

---
 drivers/pci/controller/dwc/pcie-tegra194.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/pci/controller/dwc/pcie-tegra194.c +0 -9
index 904976913081..678898985319 100644
@@ -186,8 +186,6 @@
 #define N_FTS_VAL					52
 #define FTS_VAL						52
 
-#define PORT_LOGIC_MSI_CTRL_INT_0_EN		0x828
-
 #define GEN3_EQ_CONTROL_OFF			0x8a8
 #define GEN3_EQ_CONTROL_OFF_PSET_REQ_VEC_SHIFT	8
 #define GEN3_EQ_CONTROL_OFF_PSET_REQ_VEC_MASK	GENMASK(23, 8)
@@ -2189,9 +2187,6 @@ static int tegra_pcie_dw_suspend_noirq(struct device *dev)
 	if (!pcie->link_state)
 		return 0;
 
-	/* Save MSI interrupt vector */
-	pcie->msi_ctrl_int = dw_pcie_readl_dbi(&pcie->pci,
-					       PORT_LOGIC_MSI_CTRL_INT_0_EN);
 	tegra_pcie_downstream_dev_to_D0(pcie);
 	tegra_pcie_dw_pme_turnoff(pcie);
 	tegra_pcie_unconfig_controller(pcie);
@@ -2223,10 +2218,6 @@ static int tegra_pcie_dw_resume_noirq(struct device *dev)
 	if (ret < 0)
 		goto fail_host_init;
 
-	/* Restore MSI interrupt vector */
-	dw_pcie_writel_dbi(&pcie->pci, PORT_LOGIC_MSI_CTRL_INT_0_EN,
-			   pcie->msi_ctrl_int);
-
 	return 0;
 
 fail_host_init:
Signature · 1 line
2.34.1
#1 lore raw

[+cc Vidya]

Quoted 8 lines · Jisheng Zhang

The integrated MSI Receiver enable register is always initialized in dw_pcie_setup_rc() which is also called in resume code path, so we don't need to save/restore the enable register during suspend/resume.

---
 drivers/pci/controller/dwc/pcie-tegra194.c | 9 ---------
 1 file changed, 9 deletions(-)

Need an ACK from Nvidia folks.

Lorenzo

Quoted 37 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0 -9
index 904976913081..678898985319 100644
@@ -186,8 +186,6 @@
 #define N_FTS_VAL					52
 #define FTS_VAL						52
 
-#define PORT_LOGIC_MSI_CTRL_INT_0_EN		0x828
-
 #define GEN3_EQ_CONTROL_OFF			0x8a8
 #define GEN3_EQ_CONTROL_OFF_PSET_REQ_VEC_SHIFT	8
 #define GEN3_EQ_CONTROL_OFF_PSET_REQ_VEC_MASK	GENMASK(23, 8)
@@ -2189,9 +2187,6 @@ static int tegra_pcie_dw_suspend_noirq(struct device *dev)
 	if (!pcie->link_state)
 		return 0;
 
-	/* Save MSI interrupt vector */
-	pcie->msi_ctrl_int = dw_pcie_readl_dbi(&pcie->pci,
-					       PORT_LOGIC_MSI_CTRL_INT_0_EN);
 	tegra_pcie_downstream_dev_to_D0(pcie);
 	tegra_pcie_dw_pme_turnoff(pcie);
 	tegra_pcie_unconfig_controller(pcie);
@@ -2223,10 +2218,6 @@ static int tegra_pcie_dw_resume_noirq(struct device *dev)
 	if (ret < 0)
 		goto fail_host_init;
 
-	/* Restore MSI interrupt vector */
-	dw_pcie_writel_dbi(&pcie->pci, PORT_LOGIC_MSI_CTRL_INT_0_EN,
-			   pcie->msi_ctrl_int);
-
 	return 0;
 
 fail_host_init:
Signature · 1 line
2.34.1
Acked-by
#2 lore raw
Quoted 10 lines · Lorenzo Pieralisi

External email: Use caution opening links or attachments

[+cc Vidya]

Quoted 4 lines · Jisheng Zhang

The integrated MSI Receiver enable register is always initialized in dw_pcie_setup_rc() which is also called in resume code path, so we don't need to save/restore the enable register during suspend/resume.

Quoted 6 lines
Quoted 4 lines
---
  drivers/pci/controller/dwc/pcie-tegra194.c | 9 ---------
  1 file changed, 9 deletions(-)

Need an ACK from Nvidia folks.

Looks good to me.
I couldn't verify it on Nvidia platform as we are facing some issue with suspend/resume sequence. I'll verify and update as soon as I could get suspend/resume working.

- Vidya Sagar

Quoted 40 lines

Lorenzo

Quoted 37 lines
drivers/pci/controller/dwc/pcie-tegra194.c +0 -10
index 904976913081..678898985319 100644
@@ -186,8 +186,6 @@
  #define N_FTS_VAL                                    52
  #define FTS_VAL                                              52
 
-#define PORT_LOGIC_MSI_CTRL_INT_0_EN         0x828
-
  #define GEN3_EQ_CONTROL_OFF                  0x8a8
  #define GEN3_EQ_CONTROL_OFF_PSET_REQ_VEC_SHIFT       8
  #define GEN3_EQ_CONTROL_OFF_PSET_REQ_VEC_MASK        GENMASK(23, 8)
@@ -2189,9 +2187,6 @@ static int tegra_pcie_dw_suspend_noirq(struct device *dev)
       if (!pcie->link_state)
               return 0;
 
-     /* Save MSI interrupt vector */
-     pcie->msi_ctrl_int = dw_pcie_readl_dbi(&pcie->pci,
-                                            PORT_LOGIC_MSI_CTRL_INT_0_EN);
       tegra_pcie_downstream_dev_to_D0(pcie);
       tegra_pcie_dw_pme_turnoff(pcie);
       tegra_pcie_unconfig_controller(pcie);
@@ -2223,10 +2218,6 @@ static int tegra_pcie_dw_resume_noirq(struct device *dev)
       if (ret < 0)
               goto fail_host_init;
 
-     /* Restore MSI interrupt vector */
-     dw_pcie_writel_dbi(&pcie->pci, PORT_LOGIC_MSI_CTRL_INT_0_EN,
-                        pcie->msi_ctrl_int);
-
       return 0;
 
  fail_host_init:
--

2.34.1