drivers/pci/controller/dwc/pcie-stm32-ep.c | 20 -------------------- 1 file changed, 20 deletions(-)
Guarding enable_irq/disable_irq against successive link start
link does not seem necessary, since it is not possible to start
the link twice. Similarly for stop.
Signed-off-by: Christian Bruel <christian.bruel@foss.st.com>
Message-ID: <20250828192054.GA957771@bhelgaas>
---
drivers/pci/controller/dwc/pcie-stm32-ep.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-stm32-ep.c b/drivers/pci/controller/dwc/pcie-stm32-ep.c
index 1f46bcf0c79f..a00edb6067f1 100644
--- a/drivers/pci/controller/dwc/pcie-stm32-ep.c
+++ b/drivers/pci/controller/dwc/pcie-stm32-ep.c
@@ -18,11 +18,6 @@
#include "pcie-designware.h"
#include "pcie-stm32.h"
-enum stm32_pcie_ep_link_status {
- STM32_PCIE_EP_LINK_DISABLED,
- STM32_PCIE_EP_LINK_ENABLED,
-};
-
struct stm32_pcie {
struct dw_pcie pci;
struct regmap *regmap;
@@ -30,7 +25,6 @@ struct stm32_pcie {
struct phy *phy;
struct clk *clk;
struct gpio_desc *perst_gpio;
- enum stm32_pcie_ep_link_status link_status;
unsigned int perst_irq;
};
@@ -66,11 +60,6 @@ static int stm32_pcie_start_link(struct dw_pcie *pci)
struct stm32_pcie *stm32_pcie = to_stm32_pcie(pci);
int ret;
- if (stm32_pcie->link_status == STM32_PCIE_EP_LINK_ENABLED) {
- dev_dbg(pci->dev, "Link is already enabled\n");
- return 0;
- }
-
dev_dbg(pci->dev, "Enable link\n");
ret = stm32_pcie_enable_link(pci);
@@ -81,8 +70,6 @@ static int stm32_pcie_start_link(struct dw_pcie *pci)
enable_irq(stm32_pcie->perst_irq);
- stm32_pcie->link_status = STM32_PCIE_EP_LINK_ENABLED;
-
return 0;
}
@@ -90,18 +77,11 @@ static void stm32_pcie_stop_link(struct dw_pcie *pci)
{
struct stm32_pcie *stm32_pcie = to_stm32_pcie(pci);
- if (stm32_pcie->link_status == STM32_PCIE_EP_LINK_DISABLED) {
- dev_dbg(pci->dev, "Link is already disabled\n");
- return;
- }
-
dev_dbg(pci->dev, "Disable link\n");
disable_irq(stm32_pcie->perst_irq);
stm32_pcie_disable_link(pci);
-
- stm32_pcie->link_status = STM32_PCIE_EP_LINK_DISABLED;
}
static int stm32_pcie_raise_irq(struct dw_pcie_ep *ep, u8 func_no,
--
2.34.1
On Tue, 02 Sep 2025 14:26:41 +0200, Christian Bruel wrote: > Guarding enable_irq/disable_irq against successive link start > link does not seem necessary, since it is not possible to start > the link twice. Similarly for stop. > > Applied, thanks! [1/1] PCI: stm32: Remove link_status in PCIe EP. commit: 7d1c807cd2ddf8ef771f214ae4dab9bebbc61522 Best regards, -- Manivannan Sadhasivam <mani@kernel.org>
On Mon, Sep 29, 2025 at 08:08:19PM +0530, Manivannan Sadhasivam wrote: > > On Tue, 02 Sep 2025 14:26:41 +0200, Christian Bruel wrote: > > Guarding enable_irq/disable_irq against successive link start > > link does not seem necessary, since it is not possible to start > > the link twice. Similarly for stop. > > Applied, thanks! > > [1/1] PCI: stm32: Remove link_status in PCIe EP. > commit: 7d1c807cd2ddf8ef771f214ae4dab9bebbc61522 Since this is essentially a fix to "PCI: stm32-ep: Add PCIe Endpoint support for STM32MP25", which hasn't been merged upstream yet, I squashed it into that patch: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?id=013d82bb62c0
© 2016 - 2025 Red Hat, Inc.