linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: stm32: Remove link_status in PCIe EP.
@ 2025-09-02 12:26 Christian Bruel
  2025-09-29 14:38 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Bruel @ 2025-09-02 12:26 UTC (permalink / raw)
  To: christian.bruel, lpieralisi, kwilczynski, mani, robh, bhelgaas,
	mcoquelin.stm32, alexandre.torgue
  Cc: linux-pci, linux-stm32, linux-arm-kernel, linux-kernel

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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: stm32: Remove link_status in PCIe EP.
  2025-09-02 12:26 [PATCH] PCI: stm32: Remove link_status in PCIe EP Christian Bruel
@ 2025-09-29 14:38 ` Manivannan Sadhasivam
  2025-09-30 16:32   ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Manivannan Sadhasivam @ 2025-09-29 14:38 UTC (permalink / raw)
  To: lpieralisi, kwilczynski, robh, bhelgaas, mcoquelin.stm32,
	alexandre.torgue, Christian Bruel
  Cc: linux-pci, linux-stm32, linux-arm-kernel, linux-kernel


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>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PCI: stm32: Remove link_status in PCIe EP.
  2025-09-29 14:38 ` Manivannan Sadhasivam
@ 2025-09-30 16:32   ` Bjorn Helgaas
  0 siblings, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2025-09-30 16:32 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: lpieralisi, kwilczynski, robh, bhelgaas, mcoquelin.stm32,
	alexandre.torgue, Christian Bruel, linux-pci, linux-stm32,
	linux-arm-kernel, linux-kernel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-09-30 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-02 12:26 [PATCH] PCI: stm32: Remove link_status in PCIe EP Christian Bruel
2025-09-29 14:38 ` Manivannan Sadhasivam
2025-09-30 16:32   ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).