Skip to contentSkip to conversation

PCI: dwc: Relatively simple fixes and cleanups

PATCH RESEND Superseded Serge Semin 4 participants 29 messages Apr 11, 2023 – Apr 14, 2023

Subsystems (5)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v3 cover PCI: dwc: Relatively simple fixes and cleanups

It turns out the recent DW PCIe-related patchset was merged in with several relatively trivial issues left unsettled (noted by Bjorn and Manivannan). All of these lefovers have been fixed in this patchset. Namely the series starts with two bug-fixes. The first one concerns the improper link-mode initialization in case if the CDM-check is enabled. The second unfortunate mistake I made in the IP-core version type helper. In particular instead of testing the IP-core version type the macro function referred to the just IP-core version which obviously wasn't what I intended.

Afterwards two @Mani-noted fixes follow. Firstly the dma-ranges related warning message is fixed to start with "DMA-ranges" word instead of "Dma-ranges". Secondly the Baikal-T1 PCIe Host driver is converted to perform the asynchronous probe type which saved us of about 15% of bootup time if no any PCIe peripheral device attached to the port.

Then the patchset contains the Baikal-T1 PCIe driver fix. The corresponding patch removes the false error message printed during the controller probe procedure. I accidentally added the unconditional dev_err_probe() method invocation. It was obviously wrong.

Then two trivial cleanups are introduced. The first one concerns the duplicated fast-link-mode flag unsetting. The second one implies dropping a redundant empty line from the dw_pcie_link_set_max_speed() function.

The series continues with a patch inspired by the last @Bjorn note regarding the generic resources request interface. As @Bjorn correctly said it would be nice to have the new interface used wider in the DW PCIe subsystem. Aside with the Baikal-T1 PCIe Host driver the Toshiba Visconti PCIe driver can be easily converted to using the generic clock names. That's what is done in the noted patch.

The patchset is closed with a series of MAINTAINERS-list related patches. Firstly after getting the DW PCIe RP/EP DT-schemas refactored I forgot to update the MAINTAINER-list with the new files added in the framework of that procedure. All the snps,dw-pcie* schemas shall be maintained by the DW PCIe core driver maintainers. Secondly seeing how long it took for my patchsets to review and not having any comments from the original driver maintainers I'd suggest to add myself as the reviewer to the DW PCIe and eDMA drivers. Thus hopefully the new updates review process will be performed with much less latencies. For the same reason I would also like to suggest to add @Manivannan as the DW PCIe/eDMA drivers maintainer if he isn't against that idea. What do you think about the last suggestion?

Changelog v2:
- Rebase onto the kernel 6.3-rc2.

Changelog v3:
- Drop the patch:
[PATCH v2 01/11] PCI: dwc: Fix port link CSR improper init if CDM check enabled and rebase onto the already submitted by @Yoshihiro fix:
commit cdce67099117 ("PCI: dwc: Fix PORT_LINK_CONTROL update when CDM check enabled")
- Just resend.

Serge Semin (10):
PCI: dwc: Fix erroneous version type test helper
PCI: dwc: Fix inbound iATU entries out-of-bounds warning message
PCI: bt1: Enable async probe type
PCI: bt1: Fix printing false error message
PCI: dwc: Drop duplicated fast-link-mode flag unsetting
PCI: dwc: Drop empty line from dw_pcie_link_set_max_speed()
PCI: visconti: Convert to using generic resources getter
MAINTAINERS: Add all generic DW PCIe RP/EP DT-schemas
MAINTAINERS: Add myself as the DW PCIe core reviewer
MAINTAINERS: Add myself as the DW eDMA driver reviewer

 MAINTAINERS                                   |  5 ++-
 drivers/pci/controller/dwc/pcie-bt1.c         |  5 ++-
 .../pci/controller/dwc/pcie-designware-host.c |  2 +-
 drivers/pci/controller/dwc/pcie-designware.c  |  2 -
 drivers/pci/controller/dwc/pcie-designware.h  |  7 +++-
 drivers/pci/controller/dwc/pcie-visconti.c    | 37 +++++++++----------
 6 files changed, 30 insertions(+), 28 deletions(-)
Signature · 1 line
2.40.0
#1 lore raw

PATCH RESEND v3 1/10 PCI: dwc: Fix erroneous version type test helper

Due to an unfortunate mistake the macro function actually checks the IP-core version instead of the IP-core version type which isn't what originally implied. Fix it by introducing a new helper __dw_pcie_ver_type_cmp() with the same semantic as the __dw_pcie_ver_cmp() counterpart except it refers to the dw_pcie.type field in order to perform the passed comparison operation.

Fixes 0b0a780d52ad ("PCI: dwc: Add macros to compare Synopsys IP core versions")
---
 drivers/pci/controller/dwc/pcie-designware.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-designware.h +5 -2
index 79713ce075cc..adad0ea61799 100644
@@ -37,17 +37,20 @@
 #define __dw_pcie_ver_cmp(_pci, _ver, _op) \
 	((_pci)->version _op DW_PCIE_VER_ ## _ver)
 
+#define __dw_pcie_ver_type_cmp(_pci, _type, _op) \
+	((_pci)->type _op DW_PCIE_VER_TYPE_ ## _type)
+
 #define dw_pcie_ver_is(_pci, _ver) __dw_pcie_ver_cmp(_pci, _ver, ==)
 
 #define dw_pcie_ver_is_ge(_pci, _ver) __dw_pcie_ver_cmp(_pci, _ver, >=)
 
 #define dw_pcie_ver_type_is(_pci, _ver, _type) \
 	(__dw_pcie_ver_cmp(_pci, _ver, ==) && \
-	 __dw_pcie_ver_cmp(_pci, TYPE_ ## _type, ==))
+	 __dw_pcie_ver_type_cmp(_pci, _type, ==))
 
 #define dw_pcie_ver_type_is_ge(_pci, _ver, _type) \
 	(__dw_pcie_ver_cmp(_pci, _ver, ==) && \
-	 __dw_pcie_ver_cmp(_pci, TYPE_ ## _type, >=))
+	 __dw_pcie_ver_type_cmp(_pci, _type, >=))
 
 /* DWC PCIe controller capabilities */
 #define DW_PCIE_CAP_REQ_RES		0
Signature · 1 line
2.40.0
Reviewed-by on v3 1/10
#2 lore raw

Re: [PATCH RESEND v3 01/10] PCI: dwc: Fix erroneous version type test helper

Quoted 9 lines · Serge Semin

Due to an unfortunate mistake the macro function actually checks the IP-core version instead of the IP-core version type which isn't what originally implied. Fix it by introducing a new helper __dw_pcie_ver_type_cmp() with the same semantic as the __dw_pcie_ver_cmp() counterpart except it refers to the dw_pcie.type field in order to perform the passed comparison operation.

Fixes 0b0a780d52ad ("PCI: dwc: Add macros to compare Synopsys IP core versions")

- Mani

Quoted 35 lines
---
 drivers/pci/controller/dwc/pcie-designware.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/pci/controller/dwc/pcie-designware.h +5 -2
index 79713ce075cc..adad0ea61799 100644
@@ -37,17 +37,20 @@
 #define __dw_pcie_ver_cmp(_pci, _ver, _op) \
 	((_pci)->version _op DW_PCIE_VER_ ## _ver)
 
+#define __dw_pcie_ver_type_cmp(_pci, _type, _op) \
+	((_pci)->type _op DW_PCIE_VER_TYPE_ ## _type)
+
 #define dw_pcie_ver_is(_pci, _ver) __dw_pcie_ver_cmp(_pci, _ver, ==)
 
 #define dw_pcie_ver_is_ge(_pci, _ver) __dw_pcie_ver_cmp(_pci, _ver, >=)
 
 #define dw_pcie_ver_type_is(_pci, _ver, _type) \
 	(__dw_pcie_ver_cmp(_pci, _ver, ==) && \
-	 __dw_pcie_ver_cmp(_pci, TYPE_ ## _type, ==))
+	 __dw_pcie_ver_type_cmp(_pci, _type, ==))
 
 #define dw_pcie_ver_type_is_ge(_pci, _ver, _type) \
 	(__dw_pcie_ver_cmp(_pci, _ver, ==) && \
-	 __dw_pcie_ver_cmp(_pci, TYPE_ ## _type, >=))
+	 __dw_pcie_ver_type_cmp(_pci, _type, >=))
 
 /* DWC PCIe controller capabilities */
 #define DW_PCIE_CAP_REQ_RES		0
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#3 lore raw

PATCH RESEND v3 2/10 PCI: dwc: Fix inbound iATU entries out-of-bounds warning message

In reply to Serge Semin

The message is printed if the number of requested inbound iATU windows exceed the device capability. In that case the message should either refer to the "dma-ranges" DT property or to the DMA-ranges mapping. We suggest to use the later version as a counterpart to the just CPU-ranges mapping. In any case the current "Dma-ranges" phrase seems incorrect.

---
 drivers/pci/controller/dwc/pcie-designware-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-designware-host.c +1 -1
index 9952057c8819..5718b4bb67f0 100644
@@ -723,7 +723,7 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp)
 	}
 
 	if (pci->num_ib_windows <= i)
-		dev_warn(pci->dev, "Dma-ranges exceed inbound iATU size (%u)\n",
+		dev_warn(pci->dev, "DMA-ranges exceed inbound iATU size (%u)\n",
 			 pci->num_ib_windows);
 
 	return 0;
Signature · 1 line
2.40.0
Reviewed-by on v3 2/10
#4 lore raw

Re: [PATCH RESEND v3 02/10] PCI: dwc: Fix inbound iATU entries out-of-bounds warning message

Quoted 8 lines · Serge Semin

The message is printed if the number of requested inbound iATU windows exceed the device capability. In that case the message should either refer to the "dma-ranges" DT property or to the DMA-ranges mapping. We suggest to use the later version as a counterpart to the just CPU-ranges mapping. In any case the current "Dma-ranges" phrase seems incorrect.

- Mani

Quoted 21 lines
---
 drivers/pci/controller/dwc/pcie-designware-host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-designware-host.c +1 -1
index 9952057c8819..5718b4bb67f0 100644
@@ -723,7 +723,7 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp)
 	}
 
 	if (pci->num_ib_windows <= i)
-		dev_warn(pci->dev, "Dma-ranges exceed inbound iATU size (%u)\n",
+		dev_warn(pci->dev, "DMA-ranges exceed inbound iATU size (%u)\n",
 			 pci->num_ib_windows);
 
 	return 0;
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#5 lore raw

PATCH RESEND v3 3/10 PCI: bt1: Enable async probe type

In reply to Serge Semin

It's safe to enable the asyncronous probe type since the PCIe peripheral devices probing order isn't essential for booting the system. Moreover enabling that feature saves 0.5 seconds of bootup time if no any device attached to the PCIe root port. It's a significant performance gain seeing the total bootup time takes about 3 seconds.

---
 drivers/pci/controller/dwc/pcie-bt1.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pcie-bt1.c +1 -0
index 95a723a6fd46..e36a20bf82cf 100644
@@ -638,6 +638,7 @@ static struct platform_driver bt1_pcie_driver = {
 	.driver = {
 		.name	= "bt1-pcie",
 		.of_match_table = bt1_pcie_of_match,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
 module_platform_driver(bt1_pcie_driver);
Signature · 1 line
2.40.0
Reviewed-by on v3 3/10
#6 lore raw

Re: [PATCH RESEND v3 03/10] PCI: bt1: Enable async probe type

Quoted 8 lines · Serge Semin

It's safe to enable the asyncronous probe type since the PCIe peripheral devices probing order isn't essential for booting the system. Moreover enabling that feature saves 0.5 seconds of bootup time if no any device attached to the PCIe root port. It's a significant performance gain seeing the total bootup time takes about 3 seconds.

- Mani

Quoted 20 lines
---
 drivers/pci/controller/dwc/pcie-bt1.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pci/controller/dwc/pcie-bt1.c +1 -0
index 95a723a6fd46..e36a20bf82cf 100644
@@ -638,6 +638,7 @@ static struct platform_driver bt1_pcie_driver = {
 	.driver = {
 		.name	= "bt1-pcie",
 		.of_match_table = bt1_pcie_of_match,
+		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 };
 module_platform_driver(bt1_pcie_driver);
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#7 lore raw

PATCH RESEND v3 4/10 PCI: bt1: Fix printing false error message

In reply to Serge Semin

The dev_err_probe() method is supposed to be invoked only if any error is happened. It was definitely wrong to call it unconditionally. Due to that the DWC PCIe host initialization error-message is printed all the time the Baikal-T1 PCIe controller is probed even if no error actually happened.

Fixes ba6ed462dcf4 ("PCI: dwc: Add Baikal-T1 PCIe controller support")
---
 drivers/pci/controller/dwc/pcie-bt1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-bt1.c +3 -1
index e36a20bf82cf..6557141873ad 100644
@@ -597,8 +597,10 @@ static int bt1_pcie_add_port(struct bt1_pcie *btpci)
 	dw_pcie_cap_set(&btpci->dw, REQ_RES);
 
 	ret = dw_pcie_host_init(&btpci->dw.pp);
+	if (ret)
+		dev_err_probe(dev, ret, "Failed to initialize DWC PCIe host\n");
 
-	return dev_err_probe(dev, ret, "Failed to initialize DWC PCIe host\n");
+	return ret;
 }
 
 static void bt1_pcie_del_port(struct bt1_pcie *btpci)
Signature · 1 line
2.40.0
Reviewed-by on v3 4/10
#8 lore raw

Re: [PATCH RESEND v3 04/10] PCI: bt1: Fix printing false error message

Quoted 7 lines · Serge Semin

The dev_err_probe() method is supposed to be invoked only if any error is happened. It was definitely wrong to call it unconditionally. Due to that the DWC PCIe host initialization error-message is printed all the time the Baikal-T1 PCIe controller is probed even if no error actually happened.

Fixes ba6ed462dcf4 ("PCI: dwc: Add Baikal-T1 PCIe controller support")

- Mani

Quoted 24 lines
---
 drivers/pci/controller/dwc/pcie-bt1.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-bt1.c +3 -1
index e36a20bf82cf..6557141873ad 100644
@@ -597,8 +597,10 @@ static int bt1_pcie_add_port(struct bt1_pcie *btpci)
 	dw_pcie_cap_set(&btpci->dw, REQ_RES);
 
 	ret = dw_pcie_host_init(&btpci->dw.pp);
+	if (ret)
+		dev_err_probe(dev, ret, "Failed to initialize DWC PCIe host\n");
 
-	return dev_err_probe(dev, ret, "Failed to initialize DWC PCIe host\n");
+	return ret;
 }
 
 static void bt1_pcie_del_port(struct bt1_pcie *btpci)
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#9 lore raw

PATCH RESEND v3 5/10 PCI: dwc: Drop duplicated fast-link-mode flag unsetting

In reply to Serge Semin

Most likely by mistake the PORT_LINK_FAST_LINK_MODE flag unsetting was added twice in the commit cff9244432e8 ("PCI: dwc: Ensure FAST_LINK_MODE is cleared"): first it is cleared right after the content of the PCIE_PORT_LINK_CONTROL register is read, second it's cleared in the framework of the link-mode initialization procedure. The later action is redundant. Let's drop it.

---
 drivers/pci/controller/dwc/pcie-designware.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-designware.c +0 -1
index 8e33e6e59e68..e55b7b387eb6 100644
@@ -1019,7 +1019,6 @@ void dw_pcie_setup(struct dw_pcie *pci)
 	}
 
 	/* Set the number of lanes */
-	val &= ~PORT_LINK_FAST_LINK_MODE;
 	val &= ~PORT_LINK_MODE_MASK;
 	switch (pci->num_lanes) {
 	case 1:
Signature · 1 line
2.40.0
Reviewed-by on v3 5/10
#10 lore raw

Re: [PATCH RESEND v3 05/10] PCI: dwc: Drop duplicated fast-link-mode flag unsetting

Quoted 8 lines · Serge Semin

Most likely by mistake the PORT_LINK_FAST_LINK_MODE flag unsetting was added twice in the commit cff9244432e8 ("PCI: dwc: Ensure FAST_LINK_MODE is cleared"): first it is cleared right after the content of the PCIE_PORT_LINK_CONTROL register is read, second it's cleared in the framework of the link-mode initialization procedure. The later action is redundant. Let's drop it.

- Mani

Quoted 20 lines
---
 drivers/pci/controller/dwc/pcie-designware.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-designware.c +0 -1
index 8e33e6e59e68..e55b7b387eb6 100644
@@ -1019,7 +1019,6 @@ void dw_pcie_setup(struct dw_pcie *pci)
 	}
 
 	/* Set the number of lanes */
-	val &= ~PORT_LINK_FAST_LINK_MODE;
 	val &= ~PORT_LINK_MODE_MASK;
 	switch (pci->num_lanes) {
 	case 1:
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#11 lore raw

PATCH RESEND v3 6/10 PCI: dwc: Drop empty line from dw_pcie_link_set_max_speed()

In reply to Serge Semin

Well, just drop a redundant empty line from the tail of the denoted function which by mistake was added in commit 39bc5006501c ("PCI: dwc:
Centralize link gen setting").

---
 drivers/pci/controller/dwc/pcie-designware.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-designware.c +0 -1
index e55b7b387eb6..ede166645289 100644
@@ -729,7 +729,6 @@ static void dw_pcie_link_set_max_speed(struct dw_pcie *pci, u32 link_gen)
 
 	cap &= ~((u32)PCI_EXP_LNKCAP_SLS);
 	dw_pcie_writel_dbi(pci, offset + PCI_EXP_LNKCAP, cap | link_speed);
-
 }
 
 void dw_pcie_iatu_detect(struct dw_pcie *pci)
Signature · 1 line
2.40.0
Reviewed-by on v3 6/10
#12 lore raw

Re: [PATCH RESEND v3 06/10] PCI: dwc: Drop empty line from dw_pcie_link_set_max_speed()

Quoted 5 lines · Serge Semin

Well, just drop a redundant empty line from the tail of the denoted function which by mistake was added in commit 39bc5006501c ("PCI: dwc:
Centralize link gen setting").

- Mani

Quoted 20 lines
---
 drivers/pci/controller/dwc/pcie-designware.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/controller/dwc/pcie-designware.c +0 -1
index e55b7b387eb6..ede166645289 100644
@@ -729,7 +729,6 @@ static void dw_pcie_link_set_max_speed(struct dw_pcie *pci, u32 link_gen)
 
 	cap &= ~((u32)PCI_EXP_LNKCAP_SLS);
 	dw_pcie_writel_dbi(pci, offset + PCI_EXP_LNKCAP, cap | link_speed);
-
 }
 
 void dw_pcie_iatu_detect(struct dw_pcie *pci)
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#13 lore raw

PATCH RESEND v3 7/10 PCI: visconti: Convert to using generic resources getter

In reply to Serge Semin

The generic resources request infrastructure has been recently added to the DW PCIe core driver. Since the DT-bindings of the Toshibo Visconti PCIe Host controller is fully compatible with the generic names set let's convert the driver to using that infrastructure. It won't take much effort since the low-level device driver implies the resources request only with no additional manipulations involving them. So just drop the locally defined clocks request procedures, activate the generic resources request capability and make sure the mandatory resources have been requested by the DW PCIe core driver.

---
 drivers/pci/controller/dwc/pcie-visconti.c | 37 ++++++++++------------
 1 file changed, 17 insertions(+), 20 deletions(-)
drivers/pci/controller/dwc/pcie-visconti.c +17 -20
index 71026fefa366..ae1517b52c58 100644
@@ -29,9 +29,6 @@ struct visconti_pcie {
 	void __iomem *ulreg_base;
 	void __iomem *smu_base;
 	void __iomem *mpu_base;
-	struct clk *refclk;
-	struct clk *coreclk;
-	struct clk *auxclk;
 };
 
 #define PCIE_UL_REG_S_PCIE_MODE		0x00F4
@@ -198,6 +195,21 @@ static int visconti_pcie_host_init(struct dw_pcie_rp *pp)
 	int err;
 	u32 val;
 
+	if (!pcie->pci.core_clks[DW_PCIE_REF_CLK].clk) {
+		dev_err(pci->dev, "Missing ref clock source\n");
+		return -ENOENT;
+	}
+
+	if (!pcie->pci.core_clks[DW_PCIE_CORE_CLK].clk) {
+		dev_err(pci->dev, "Missing core clock source\n");
+		return -ENOENT;
+	}
+
+	if (!pcie->pci.core_clks[DW_PCIE_AUX_CLK].clk) {
+		dev_err(pci->dev, "Missing aux clock source\n");
+		return -ENOENT;
+	}
+
 	visconti_smu_writel(pcie,
 			    PISMU_CKON_PCIE_AUX_CLK | PISMU_CKON_PCIE_MSTR_ACLK,
 			    PISMU_CKON_PCIE);
@@ -242,8 +254,6 @@ static const struct dw_pcie_host_ops visconti_pcie_host_ops = {
 static int visconti_get_resources(struct platform_device *pdev,
 				  struct visconti_pcie *pcie)
 {
-	struct device *dev = &pdev->dev;
-
 	pcie->ulreg_base = devm_platform_ioremap_resource_byname(pdev, "ulreg");
 	if (IS_ERR(pcie->ulreg_base))
 		return PTR_ERR(pcie->ulreg_base);
@@ -256,21 +266,6 @@ static int visconti_get_resources(struct platform_device *pdev,
 	if (IS_ERR(pcie->mpu_base))
 		return PTR_ERR(pcie->mpu_base);
 
-	pcie->refclk = devm_clk_get(dev, "ref");
-	if (IS_ERR(pcie->refclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->refclk),
-				     "Failed to get ref clock\n");
-
-	pcie->coreclk = devm_clk_get(dev, "core");
-	if (IS_ERR(pcie->coreclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->coreclk),
-				     "Failed to get core clock\n");
-
-	pcie->auxclk = devm_clk_get(dev, "aux");
-	if (IS_ERR(pcie->auxclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->auxclk),
-				     "Failed to get aux clock\n");
-
 	return 0;
 }
 
@@ -304,6 +299,8 @@ static int visconti_pcie_probe(struct platform_device *pdev)
 	pci->dev = dev;
 	pci->ops = &dw_pcie_ops;
 
+	dw_pcie_cap_set(pci, REQ_RES);
+
 	ret = visconti_get_resources(pdev, pcie);
 	if (ret)
 		return ret;
Signature · 1 line
2.40.0
#14 lore raw

Re: [PATCH RESEND v3 07/10] PCI: visconti: Convert to using generic resources getter

Quoted 39 lines · Serge Semin

The generic resources request infrastructure has been recently added to the DW PCIe core driver. Since the DT-bindings of the Toshibo Visconti PCIe Host controller is fully compatible with the generic names set let's convert the driver to using that infrastructure. It won't take much effort since the low-level device driver implies the resources request only with no additional manipulations involving them. So just drop the locally defined clocks request procedures, activate the generic resources request capability and make sure the mandatory resources have been requested by the DW PCIe core driver.

---
 drivers/pci/controller/dwc/pcie-visconti.c | 37 ++++++++++------------
 1 file changed, 17 insertions(+), 20 deletions(-)
drivers/pci/controller/dwc/pcie-visconti.c +5 -3
index 71026fefa366..ae1517b52c58 100644
@@ -29,9 +29,6 @@ struct visconti_pcie {
 	void __iomem *ulreg_base;
 	void __iomem *smu_base;
 	void __iomem *mpu_base;
-	struct clk *refclk;
-	struct clk *coreclk;
-	struct clk *auxclk;
 };
 
 #define PCIE_UL_REG_S_PCIE_MODE		0x00F4
@@ -198,6 +195,21 @@ static int visconti_pcie_host_init(struct dw_pcie_rp *pp)
 	int err;
 	u32 val;
 
+	if (!pcie->pci.core_clks[DW_PCIE_REF_CLK].clk) {
+		dev_err(pci->dev, "Missing ref clock source\n");
+		return -ENOENT;
+	}
+

drivers/pci/controller/dwc/pcie-visconti.c static int visconti_pcie_host_init(struct dw_pcie_rp *pp) · line 212

Quoted 10 lines
drivers/pci/controller/dwc/pcie-visconti.c +10 -0
+	if (!pcie->pci.core_clks[DW_PCIE_CORE_CLK].clk) {
+		dev_err(pci->dev, "Missing core clock source\n");
+		return -ENOENT;
+	}
+
+	if (!pcie->pci.core_clks[DW_PCIE_AUX_CLK].clk) {
+		dev_err(pci->dev, "Missing aux clock source\n");
+		return -ENOENT;
+	}
+

Looking at the driver, I could see no call to clk_prepare_enable() for these clocks. So from kernel's PoV these are not used at all. So either these clocks are not required (unlikely) or enabled by the bootloader so kernel just uses it.

In that case, the driver should handle these clocks properly.

@Nobuhiro-San, can you please comment?

- Mani

Quoted 47 lines
drivers/pci/controller/dwc/pcie-visconti.c +2 -17
 	visconti_smu_writel(pcie,
 			    PISMU_CKON_PCIE_AUX_CLK | PISMU_CKON_PCIE_MSTR_ACLK,
 			    PISMU_CKON_PCIE);
@@ -242,8 +254,6 @@ static const struct dw_pcie_host_ops visconti_pcie_host_ops = {
 static int visconti_get_resources(struct platform_device *pdev,
 				  struct visconti_pcie *pcie)
 {
-	struct device *dev = &pdev->dev;
-
 	pcie->ulreg_base = devm_platform_ioremap_resource_byname(pdev, "ulreg");
 	if (IS_ERR(pcie->ulreg_base))
 		return PTR_ERR(pcie->ulreg_base);
@@ -256,21 +266,6 @@ static int visconti_get_resources(struct platform_device *pdev,
 	if (IS_ERR(pcie->mpu_base))
 		return PTR_ERR(pcie->mpu_base);
 
-	pcie->refclk = devm_clk_get(dev, "ref");
-	if (IS_ERR(pcie->refclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->refclk),
-				     "Failed to get ref clock\n");
-
-	pcie->coreclk = devm_clk_get(dev, "core");
-	if (IS_ERR(pcie->coreclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->coreclk),
-				     "Failed to get core clock\n");
-
-	pcie->auxclk = devm_clk_get(dev, "aux");
-	if (IS_ERR(pcie->auxclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->auxclk),
-				     "Failed to get aux clock\n");
-
 	return 0;
 }
 
@@ -304,6 +299,8 @@ static int visconti_pcie_probe(struct platform_device *pdev)
 	pci->dev = dev;
 	pci->ops = &dw_pcie_ops;
 
+	dw_pcie_cap_set(pci, REQ_RES);
+
 	ret = visconti_get_resources(pdev, pcie);
 	if (ret)
 		return ret;
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#15 lore raw

Re: [PATCH RESEND v3 07/10] PCI: visconti: Convert to using generic resources getter

Quoted 55 lines · Manivannan Sadhasivam
Quoted 39 lines · Serge Semin

The generic resources request infrastructure has been recently added to the DW PCIe core driver. Since the DT-bindings of the Toshibo Visconti PCIe Host controller is fully compatible with the generic names set let's convert the driver to using that infrastructure. It won't take much effort since the low-level device driver implies the resources request only with no additional manipulations involving them. So just drop the locally defined clocks request procedures, activate the generic resources request capability and make sure the mandatory resources have been requested by the DW PCIe core driver.

---
 drivers/pci/controller/dwc/pcie-visconti.c | 37 ++++++++++------------
 1 file changed, 17 insertions(+), 20 deletions(-)
drivers/pci/controller/dwc/pcie-visconti.c +5 -3
index 71026fefa366..ae1517b52c58 100644
@@ -29,9 +29,6 @@ struct visconti_pcie {
 	void __iomem *ulreg_base;
 	void __iomem *smu_base;
 	void __iomem *mpu_base;
-	struct clk *refclk;
-	struct clk *coreclk;
-	struct clk *auxclk;
 };
 
 #define PCIE_UL_REG_S_PCIE_MODE		0x00F4
@@ -198,6 +195,21 @@ static int visconti_pcie_host_init(struct dw_pcie_rp *pp)
 	int err;
 	u32 val;
 
+	if (!pcie->pci.core_clks[DW_PCIE_REF_CLK].clk) {
+		dev_err(pci->dev, "Missing ref clock source\n");
+		return -ENOENT;
+	}
+

drivers/pci/controller/dwc/pcie-visconti.c static int visconti_pcie_host_init(struct dw_pcie_rp *pp) · line 212

Quoted 10 lines
drivers/pci/controller/dwc/pcie-visconti.c +10 -0
+	if (!pcie->pci.core_clks[DW_PCIE_CORE_CLK].clk) {
+		dev_err(pci->dev, "Missing core clock source\n");
+		return -ENOENT;
+	}
+
+	if (!pcie->pci.core_clks[DW_PCIE_AUX_CLK].clk) {
+		dev_err(pci->dev, "Missing aux clock source\n");
+		return -ENOENT;
+	}
+

Looking at the driver, I could see no call to clk_prepare_enable() for these clocks. So from kernel's PoV these are not used at all. So either these clocks are not required (unlikely) or enabled by the bootloader so kernel just uses it.

Quoted 3 lines

In that case, the driver should handle these clocks properly.

@Nobuhiro-San, can you please comment?

I will easily update the patch with a code enabling these clocks in the visconti_pcie_host_init() method if @Nobuhiro-San are ok with that.

-Serge(y)

Quoted 53 lines

- Mani

Quoted 47 lines
drivers/pci/controller/dwc/pcie-visconti.c +2 -17
 	visconti_smu_writel(pcie,
 			    PISMU_CKON_PCIE_AUX_CLK | PISMU_CKON_PCIE_MSTR_ACLK,
 			    PISMU_CKON_PCIE);
@@ -242,8 +254,6 @@ static const struct dw_pcie_host_ops visconti_pcie_host_ops = {
 static int visconti_get_resources(struct platform_device *pdev,
 				  struct visconti_pcie *pcie)
 {
-	struct device *dev = &pdev->dev;
-
 	pcie->ulreg_base = devm_platform_ioremap_resource_byname(pdev, "ulreg");
 	if (IS_ERR(pcie->ulreg_base))
 		return PTR_ERR(pcie->ulreg_base);
@@ -256,21 +266,6 @@ static int visconti_get_resources(struct platform_device *pdev,
 	if (IS_ERR(pcie->mpu_base))
 		return PTR_ERR(pcie->mpu_base);
 
-	pcie->refclk = devm_clk_get(dev, "ref");
-	if (IS_ERR(pcie->refclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->refclk),
-				     "Failed to get ref clock\n");
-
-	pcie->coreclk = devm_clk_get(dev, "core");
-	if (IS_ERR(pcie->coreclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->coreclk),
-				     "Failed to get core clock\n");
-
-	pcie->auxclk = devm_clk_get(dev, "aux");
-	if (IS_ERR(pcie->auxclk))
-		return dev_err_probe(dev, PTR_ERR(pcie->auxclk),
-				     "Failed to get aux clock\n");
-
 	return 0;
 }
 
@@ -304,6 +299,8 @@ static int visconti_pcie_probe(struct platform_device *pdev)
 	pci->dev = dev;
 	pci->ops = &dw_pcie_ops;
 
+	dw_pcie_cap_set(pci, REQ_RES);
+
 	ret = visconti_get_resources(pdev, pcie);
 	if (ret)
 		return ret;
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#16 lore raw

PATCH RESEND v3 8/10 MAINTAINERS: Add all generic DW PCIe RP/EP DT-schemas

In reply to Serge Semin

Recently the DT-schema of the DW PCIe Root Port and End-point controllers has been refactored by detaching the common bindings into a separate schema. The provided modification must be reflected in the MAINTAINERS list so the patch submitters would be aware of the new files maintainers. Let's do that by adding the maintained files wildcard pattern like snps,dw-pcie*.yaml, which is applicable for all the old DW PCIe DT-schema files and the new one.

---
 MAINTAINERS | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
MAINTAINERS +1 -2
index ec57c42ed544..489fd4b4c7ae 100644
@@ -16063,8 +16063,7 @@ M:	Jingoo Han <[email protected]>
 M:	Gustavo Pimentel <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml
-F:	Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
+F:	Documentation/devicetree/bindings/pci/snps,dw-pcie*.yaml
 F:	drivers/pci/controller/dwc/*designware*
 
 PCI DRIVER FOR TI DRA7XX/J721E
Signature · 1 line
2.40.0
Acked-by on v3 8/10
#17 lore raw

Re: [PATCH RESEND v3 08/10] MAINTAINERS: Add all generic DW PCIe RP/EP DT-schemas

Quoted 9 lines · Serge Semin

Recently the DT-schema of the DW PCIe Root Port and End-point controllers has been refactored by detaching the common bindings into a separate schema. The provided modification must be reflected in the MAINTAINERS list so the patch submitters would be aware of the new files maintainers. Let's do that by adding the maintained files wildcard pattern like snps,dw-pcie*.yaml, which is applicable for all the old DW PCIe DT-schema files and the new one.

- Mani

Quoted 22 lines
---
 MAINTAINERS | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
MAINTAINERS +1 -2
index ec57c42ed544..489fd4b4c7ae 100644
@@ -16063,8 +16063,7 @@ M:	Jingoo Han <[email protected]>
 M:	Gustavo Pimentel <[email protected]>
 L:	[email protected]
 S:	Maintained
-F:	Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml
-F:	Documentation/devicetree/bindings/pci/snps,dw-pcie-ep.yaml
+F:	Documentation/devicetree/bindings/pci/snps,dw-pcie*.yaml
 F:	drivers/pci/controller/dwc/*designware*
 
 PCI DRIVER FOR TI DRA7XX/J721E
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#18 lore raw

PATCH RESEND v3 9/10 MAINTAINERS: Add myself as the DW PCIe core reviewer

In reply to Serge Semin

No actions have been spotted from the driver maintainers for almost two years now. It significantly delays the review process of the relatively often incoming updates. Since that IP-core has been used in several our SoCs adding myself to the list of reviewers will help in the evolving the driver faster and in catching any potential problem as early as possible.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 489fd4b4c7ae..51adcafa0f0c 100644
@@ -16061,6 +16061,7 @@ F:	drivers/pci/controller/dwc/pci-exynos.c
 PCI DRIVER FOR SYNOPSYS DESIGNWARE
 M:	Jingoo Han <[email protected]>
 M:	Gustavo Pimentel <[email protected]>
+R:	Serge Semin <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/devicetree/bindings/pci/snps,dw-pcie*.yaml
Signature · 1 line
2.40.0
Acked-by on v3 9/10
#19 lore raw

Re: [PATCH RESEND v3 09/10] MAINTAINERS: Add myself as the DW PCIe core reviewer

Quoted 7 lines · Serge Semin

No actions have been spotted from the driver maintainers for almost two years now. It significantly delays the review process of the relatively often incoming updates. Since that IP-core has been used in several our SoCs adding myself to the list of reviewers will help in the evolving the driver faster and in catching any potential problem as early as possible.

If the Maintainers were not responding for these long years, then it implies that they are not maintaining at all. So I'm inclined to remove their entries too but I'll defer that decision to Lorenzo.

For this patch,

- Mani

Quoted 20 lines
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 489fd4b4c7ae..51adcafa0f0c 100644
@@ -16061,6 +16061,7 @@ F:	drivers/pci/controller/dwc/pci-exynos.c
 PCI DRIVER FOR SYNOPSYS DESIGNWARE
 M:	Jingoo Han <[email protected]>
 M:	Gustavo Pimentel <[email protected]>
+R:	Serge Semin <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/devicetree/bindings/pci/snps,dw-pcie*.yaml
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#20 lore raw

Re: [PATCH RESEND v3 09/10] MAINTAINERS: Add myself as the DW PCIe core reviewer

Quoted 7 lines · Manivannan Sadhasivam
Quoted 6 lines · Serge Semin

No actions have been spotted from the driver maintainers for almost two years now. It significantly delays the review process of the relatively often incoming updates. Since that IP-core has been used in several our SoCs adding myself to the list of reviewers will help in the evolving the driver faster and in catching any potential problem as early as possible.

Quoted 5 lines
Quoted 1 line

If the Maintainers were not responding for these long years, then it implies that they are not maintaining at all. So I'm inclined to remove their entries too but I'll defer that decision to Lorenzo.

To be completely honest @Jingoo responded to a few patches with minor comments lately meanwhile @Gustavo has been completely silent for about two years now.

Quoted 4 lines

For this patch,

Thanks.

-Serge(y)

Quoted 26 lines

- Mani

Quoted 20 lines
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 489fd4b4c7ae..51adcafa0f0c 100644
@@ -16061,6 +16061,7 @@ F:	drivers/pci/controller/dwc/pci-exynos.c
 PCI DRIVER FOR SYNOPSYS DESIGNWARE
 M:	Jingoo Han <[email protected]>
 M:	Gustavo Pimentel <[email protected]>
+R:	Serge Semin <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	Documentation/devicetree/bindings/pci/snps,dw-pcie*.yaml
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#21 lore raw

PATCH RESEND v3 10/10 MAINTAINERS: Add myself as the DW eDMA driver reviewer

In reply to Serge Semin

The driver maintainer has been inactive for almost two years now. It doesn't positively affect the new patches tests and reviews process. Since the DW eDMA engine has been embedded into the PCIe controllers in several our SoCs we will be interested in helping with the updates review.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 51adcafa0f0c..fb7bada6cdd0 100644
@@ -5862,6 +5862,7 @@ F:	drivers/mtd/nand/raw/denali*
 
 DESIGNWARE EDMA CORE IP DRIVER
 M:	Gustavo Pimentel <[email protected]>
+R:	Serge Semin <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	drivers/dma/dw-edma/
Signature · 1 line
2.40.0
Acked-by on v3 10/10
#22 lore raw

Re: [PATCH RESEND v3 10/10] MAINTAINERS: Add myself as the DW eDMA driver reviewer

Quoted 6 lines · Serge Semin

The driver maintainer has been inactive for almost two years now. It doesn't positively affect the new patches tests and reviews process. Since the DW eDMA engine has been embedded into the PCIe controllers in several our SoCs we will be interested in helping with the updates review.

Same comment as 9/10. I'll defer the decision to Vinod.

- Mani

Quoted 20 lines
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 51adcafa0f0c..fb7bada6cdd0 100644
@@ -5862,6 +5862,7 @@ F:	drivers/mtd/nand/raw/denali*
 
 DESIGNWARE EDMA CORE IP DRIVER
 M:	Gustavo Pimentel <[email protected]>
+R:	Serge Semin <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	drivers/dma/dw-edma/
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#23 lore raw
In reply to Serge Semin
Quoted 33 lines · Serge Semin

It turns out the recent DW PCIe-related patchset was merged in with several relatively trivial issues left unsettled (noted by Bjorn and Manivannan). All of these lefovers have been fixed in this patchset. Namely the series starts with two bug-fixes. The first one concerns the improper link-mode initialization in case if the CDM-check is enabled. The second unfortunate mistake I made in the IP-core version type helper. In particular instead of testing the IP-core version type the macro function referred to the just IP-core version which obviously wasn't what I intended.

Afterwards two @Mani-noted fixes follow. Firstly the dma-ranges related warning message is fixed to start with "DMA-ranges" word instead of "Dma-ranges". Secondly the Baikal-T1 PCIe Host driver is converted to perform the asynchronous probe type which saved us of about 15% of bootup time if no any PCIe peripheral device attached to the port.

Then the patchset contains the Baikal-T1 PCIe driver fix. The corresponding patch removes the false error message printed during the controller probe procedure. I accidentally added the unconditional dev_err_probe() method invocation. It was obviously wrong.

Then two trivial cleanups are introduced. The first one concerns the duplicated fast-link-mode flag unsetting. The second one implies dropping a redundant empty line from the dw_pcie_link_set_max_speed() function.

The series continues with a patch inspired by the last @Bjorn note regarding the generic resources request interface. As @Bjorn correctly said it would be nice to have the new interface used wider in the DW PCIe subsystem. Aside with the Baikal-T1 PCIe Host driver the Toshiba Visconti PCIe driver can be easily converted to using the generic clock names. That's what is done in the noted patch.

Quoted 12 lines

The patchset is closed with a series of MAINTAINERS-list related patches. Firstly after getting the DW PCIe RP/EP DT-schemas refactored I forgot to update the MAINTAINER-list with the new files added in the framework of that procedure. All the snps,dw-pcie* schemas shall be maintained by the DW PCIe core driver maintainers. Secondly seeing how long it took for my patchsets to review and not having any comments from the original driver maintainers I'd suggest to add myself as the reviewer to the DW PCIe and eDMA drivers. Thus hopefully the new updates review process will be performed with much less latencies. For the same reason I would also like to suggest to add @Manivannan as the DW PCIe/eDMA drivers maintainer if he isn't against that idea. What do you think about the last suggestion?

I'm willing to co-maintain the drivers.

- Mani

Quoted 43 lines

Changelog v2:
- Rebase onto the kernel 6.3-rc2.

Changelog v3:
- Drop the patch:
[PATCH v2 01/11] PCI: dwc: Fix port link CSR improper init if CDM check enabled and rebase onto the already submitted by @Yoshihiro fix:
commit cdce67099117 ("PCI: dwc: Fix PORT_LINK_CONTROL update when CDM check enabled")
- Just resend.

Serge Semin (10):
PCI: dwc: Fix erroneous version type test helper
PCI: dwc: Fix inbound iATU entries out-of-bounds warning message
PCI: bt1: Enable async probe type
PCI: bt1: Fix printing false error message
PCI: dwc: Drop duplicated fast-link-mode flag unsetting
PCI: dwc: Drop empty line from dw_pcie_link_set_max_speed()
PCI: visconti: Convert to using generic resources getter
MAINTAINERS: Add all generic DW PCIe RP/EP DT-schemas
MAINTAINERS: Add myself as the DW PCIe core reviewer
MAINTAINERS: Add myself as the DW eDMA driver reviewer

 MAINTAINERS                                   |  5 ++-
 drivers/pci/controller/dwc/pcie-bt1.c         |  5 ++-
 .../pci/controller/dwc/pcie-designware-host.c |  2 +-
 drivers/pci/controller/dwc/pcie-designware.c  |  2 -
 drivers/pci/controller/dwc/pcie-designware.h  |  7 +++-
 drivers/pci/controller/dwc/pcie-visconti.c    | 37 +++++++++----------
 6 files changed, 30 insertions(+), 28 deletions(-)
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#24 lore raw
Quoted 47 lines · Manivannan Sadhasivam
Quoted 33 lines · Serge Semin

It turns out the recent DW PCIe-related patchset was merged in with several relatively trivial issues left unsettled (noted by Bjorn and Manivannan). All of these lefovers have been fixed in this patchset. Namely the series starts with two bug-fixes. The first one concerns the improper link-mode initialization in case if the CDM-check is enabled. The second unfortunate mistake I made in the IP-core version type helper. In particular instead of testing the IP-core version type the macro function referred to the just IP-core version which obviously wasn't what I intended.

Afterwards two @Mani-noted fixes follow. Firstly the dma-ranges related warning message is fixed to start with "DMA-ranges" word instead of "Dma-ranges". Secondly the Baikal-T1 PCIe Host driver is converted to perform the asynchronous probe type which saved us of about 15% of bootup time if no any PCIe peripheral device attached to the port.

Then the patchset contains the Baikal-T1 PCIe driver fix. The corresponding patch removes the false error message printed during the controller probe procedure. I accidentally added the unconditional dev_err_probe() method invocation. It was obviously wrong.

Then two trivial cleanups are introduced. The first one concerns the duplicated fast-link-mode flag unsetting. The second one implies dropping a redundant empty line from the dw_pcie_link_set_max_speed() function.

The series continues with a patch inspired by the last @Bjorn note regarding the generic resources request interface. As @Bjorn correctly said it would be nice to have the new interface used wider in the DW PCIe subsystem. Aside with the Baikal-T1 PCIe Host driver the Toshiba Visconti PCIe driver can be easily converted to using the generic clock names. That's what is done in the noted patch.

Quoted 12 lines

The patchset is closed with a series of MAINTAINERS-list related patches. Firstly after getting the DW PCIe RP/EP DT-schemas refactored I forgot to update the MAINTAINER-list with the new files added in the framework of that procedure. All the snps,dw-pcie* schemas shall be maintained by the DW PCIe core driver maintainers. Secondly seeing how long it took for my patchsets to review and not having any comments from the original driver maintainers I'd suggest to add myself as the reviewer to the DW PCIe and eDMA drivers. Thus hopefully the new updates review process will be performed with much less latencies. For the same reason I would also like to suggest to add @Manivannan as the DW PCIe/eDMA drivers maintainer if he isn't against that idea. What do you think about the last suggestion?

Quoted 1 line

I'm willing to co-maintain the drivers.

Awesome! @Bjorn, @Lorenzo, @Vinod what do you think about this? If you are ok with that shall I resubmit the series with @Mani added to the DW PCIe/eDMA maintainers list or will you create the respective patches yourself?

-Serge(y)

Quoted 49 lines

- Mani

Quoted 43 lines

Changelog v2:
- Rebase onto the kernel 6.3-rc2.

Changelog v3:
- Drop the patch:
[PATCH v2 01/11] PCI: dwc: Fix port link CSR improper init if CDM check enabled and rebase onto the already submitted by @Yoshihiro fix:
commit cdce67099117 ("PCI: dwc: Fix PORT_LINK_CONTROL update when CDM check enabled")
- Just resend.

Serge Semin (10):
PCI: dwc: Fix erroneous version type test helper
PCI: dwc: Fix inbound iATU entries out-of-bounds warning message
PCI: bt1: Enable async probe type
PCI: bt1: Fix printing false error message
PCI: dwc: Drop duplicated fast-link-mode flag unsetting
PCI: dwc: Drop empty line from dw_pcie_link_set_max_speed()
PCI: visconti: Convert to using generic resources getter
MAINTAINERS: Add all generic DW PCIe RP/EP DT-schemas
MAINTAINERS: Add myself as the DW PCIe core reviewer
MAINTAINERS: Add myself as the DW eDMA driver reviewer

 MAINTAINERS                                   |  5 ++-
 drivers/pci/controller/dwc/pcie-bt1.c         |  5 ++-
 .../pci/controller/dwc/pcie-designware-host.c |  2 +-
 drivers/pci/controller/dwc/pcie-designware.c  |  2 -
 drivers/pci/controller/dwc/pcie-designware.h  |  7 +++-
 drivers/pci/controller/dwc/pcie-visconti.c    | 37 +++++++++----------
 6 files changed, 30 insertions(+), 28 deletions(-)
Signature · 1 line
2.40.0
Signature · 1 line
மணிவண்ணன் சதாசிவம்
maintainer
#25 lore raw
Quoted 48 lines · Serge Semin
Quoted 47 lines · Manivannan Sadhasivam
Quoted 45 lines · Serge Semin

It turns out the recent DW PCIe-related patchset was merged in with several relatively trivial issues left unsettled (noted by Bjorn and Manivannan). All of these lefovers have been fixed in this patchset. Namely the series starts with two bug-fixes. The first one concerns the improper link-mode initialization in case if the CDM-check is enabled. The second unfortunate mistake I made in the IP-core version type helper. In particular instead of testing the IP-core version type the macro function referred to the just IP-core version which obviously wasn't what I intended.

Afterwards two @Mani-noted fixes follow. Firstly the dma-ranges related warning message is fixed to start with "DMA-ranges" word instead of "Dma-ranges". Secondly the Baikal-T1 PCIe Host driver is converted to perform the asynchronous probe type which saved us of about 15% of bootup time if no any PCIe peripheral device attached to the port.

Then the patchset contains the Baikal-T1 PCIe driver fix. The corresponding patch removes the false error message printed during the controller probe procedure. I accidentally added the unconditional dev_err_probe() method invocation. It was obviously wrong.

Then two trivial cleanups are introduced. The first one concerns the duplicated fast-link-mode flag unsetting. The second one implies dropping a redundant empty line from the dw_pcie_link_set_max_speed() function.

The series continues with a patch inspired by the last @Bjorn note regarding the generic resources request interface. As @Bjorn correctly said it would be nice to have the new interface used wider in the DW PCIe subsystem. Aside with the Baikal-T1 PCIe Host driver the Toshiba Visconti PCIe driver can be easily converted to using the generic clock names. That's what is done in the noted patch.

The patchset is closed with a series of MAINTAINERS-list related patches. Firstly after getting the DW PCIe RP/EP DT-schemas refactored I forgot to update the MAINTAINER-list with the new files added in the framework of that procedure. All the snps,dw-pcie* schemas shall be maintained by the DW PCIe core driver maintainers. Secondly seeing how long it took for my patchsets to review and not having any comments from the original driver maintainers I'd suggest to add myself as the reviewer to the DW PCIe and eDMA drivers. Thus hopefully the new updates review process will be performed with much less latencies. For the same reason I would also like to suggest to add @Manivannan as the DW PCIe/eDMA drivers maintainer if he isn't against that idea. What do you think about the last suggestion?

Quoted 6 lines
Quoted 1 line

I'm willing to co-maintain the drivers.

Awesome! @Bjorn, @Lorenzo, @Vinod what do you think about this? If you are ok with that shall I resubmit the series with @Mani added to the DW PCIe/eDMA maintainers list or will you create the respective patches yourself?

Pls send the patch, that is preferred.

Signature · 1 line
~Vinod
#26 lore raw
Quoted 51 lines · Vinod Koul
Quoted 50 lines · Serge Semin
Quoted 48 lines · Manivannan Sadhasivam
Quoted 33 lines · Serge Semin

It turns out the recent DW PCIe-related patchset was merged in with several relatively trivial issues left unsettled (noted by Bjorn and Manivannan). All of these lefovers have been fixed in this patchset. Namely the series starts with two bug-fixes. The first one concerns the improper link-mode initialization in case if the CDM-check is enabled. The second unfortunate mistake I made in the IP-core version type helper. In particular instead of testing the IP-core version type the macro function referred to the just IP-core version which obviously wasn't what I intended.

Afterwards two @Mani-noted fixes follow. Firstly the dma-ranges related warning message is fixed to start with "DMA-ranges" word instead of "Dma-ranges". Secondly the Baikal-T1 PCIe Host driver is converted to perform the asynchronous probe type which saved us of about 15% of bootup time if no any PCIe peripheral device attached to the port.

Then the patchset contains the Baikal-T1 PCIe driver fix. The corresponding patch removes the false error message printed during the controller probe procedure. I accidentally added the unconditional dev_err_probe() method invocation. It was obviously wrong.

Then two trivial cleanups are introduced. The first one concerns the duplicated fast-link-mode flag unsetting. The second one implies dropping a redundant empty line from the dw_pcie_link_set_max_speed() function.

The series continues with a patch inspired by the last @Bjorn note regarding the generic resources request interface. As @Bjorn correctly said it would be nice to have the new interface used wider in the DW PCIe subsystem. Aside with the Baikal-T1 PCIe Host driver the Toshiba Visconti PCIe driver can be easily converted to using the generic clock names. That's what is done in the noted patch.

Quoted 12 lines

The patchset is closed with a series of MAINTAINERS-list related patches. Firstly after getting the DW PCIe RP/EP DT-schemas refactored I forgot to update the MAINTAINER-list with the new files added in the framework of that procedure. All the snps,dw-pcie* schemas shall be maintained by the DW PCIe core driver maintainers. Secondly seeing how long it took for my patchsets to review and not having any comments from the original driver maintainers I'd suggest to add myself as the reviewer to the DW PCIe and eDMA drivers. Thus hopefully the new updates review process will be performed with much less latencies. For the same reason I would also like to suggest to add @Manivannan as the DW PCIe/eDMA drivers maintainer if he isn't against that idea. What do you think about the last suggestion?

I'm willing to co-maintain the drivers.

Quoted 7 lines
Quoted 4 lines

Awesome! @Bjorn, @Lorenzo, @Vinod what do you think about this? If you are ok with that shall I resubmit the series with @Mani added to the DW PCIe/eDMA maintainers list or will you create the respective patches yourself?

Pls send the patch, that is preferred.

Ok. I'll resubmit the series with the new patches replacing @Gustavo with @Mani as the DW PCIe/eDMA drivers maintainer.

-Serge(y)

Quoted 3 lines
Signature · 2 lines
-- 
~Vinod
#27 lore raw
Quoted 58 lines · Serge Semin
Quoted 56 lines · Vinod Koul
Quoted 54 lines · Serge Semin
Quoted 47 lines · Manivannan Sadhasivam
Quoted 33 lines · Serge Semin

It turns out the recent DW PCIe-related patchset was merged in with several relatively trivial issues left unsettled (noted by Bjorn and Manivannan). All of these lefovers have been fixed in this patchset. Namely the series starts with two bug-fixes. The first one concerns the improper link-mode initialization in case if the CDM-check is enabled. The second unfortunate mistake I made in the IP-core version type helper. In particular instead of testing the IP-core version type the macro function referred to the just IP-core version which obviously wasn't what I intended.

Afterwards two @Mani-noted fixes follow. Firstly the dma-ranges related warning message is fixed to start with "DMA-ranges" word instead of "Dma-ranges". Secondly the Baikal-T1 PCIe Host driver is converted to perform the asynchronous probe type which saved us of about 15% of bootup time if no any PCIe peripheral device attached to the port.

Then the patchset contains the Baikal-T1 PCIe driver fix. The corresponding patch removes the false error message printed during the controller probe procedure. I accidentally added the unconditional dev_err_probe() method invocation. It was obviously wrong.

Then two trivial cleanups are introduced. The first one concerns the duplicated fast-link-mode flag unsetting. The second one implies dropping a redundant empty line from the dw_pcie_link_set_max_speed() function.

The series continues with a patch inspired by the last @Bjorn note regarding the generic resources request interface. As @Bjorn correctly said it would be nice to have the new interface used wider in the DW PCIe subsystem. Aside with the Baikal-T1 PCIe Host driver the Toshiba Visconti PCIe driver can be easily converted to using the generic clock names. That's what is done in the noted patch.

Quoted 12 lines

The patchset is closed with a series of MAINTAINERS-list related patches. Firstly after getting the DW PCIe RP/EP DT-schemas refactored I forgot to update the MAINTAINER-list with the new files added in the framework of that procedure. All the snps,dw-pcie* schemas shall be maintained by the DW PCIe core driver maintainers. Secondly seeing how long it took for my patchsets to review and not having any comments from the original driver maintainers I'd suggest to add myself as the reviewer to the DW PCIe and eDMA drivers. Thus hopefully the new updates review process will be performed with much less latencies. For the same reason I would also like to suggest to add @Manivannan as the DW PCIe/eDMA drivers maintainer if he isn't against that idea. What do you think about the last suggestion?

Quoted 1 line

I'm willing to co-maintain the drivers.

Awesome! @Bjorn, @Lorenzo, @Vinod what do you think about this? If you are ok with that shall I resubmit the series with @Mani added to the DW PCIe/eDMA maintainers list or will you create the respective patches yourself?

Quoted 5 lines
Quoted 1 line

Pls send the patch, that is preferred.

Ok. I'll resubmit the series with the new patches replacing @Gustavo with @Mani as the DW PCIe/eDMA drivers maintainer.

I talked to Vinod about the non-responsive maintainers and he suggested first demoting them as Reviewers instead of dropping altogether. So you can move Gustavo as a Reviewer.

- Mani

Quoted 5 lines

-Serge(y)

Quoted 3 lines
Signature · 2 lines
-- 
~Vinod
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#28 lore raw
Quoted 61 lines · Manivannan Sadhasivam
Quoted 60 lines · Serge Semin
Quoted 58 lines · Vinod Koul
Quoted 48 lines · Serge Semin
Quoted 47 lines · Manivannan Sadhasivam
Quoted 45 lines · Serge Semin

It turns out the recent DW PCIe-related patchset was merged in with several relatively trivial issues left unsettled (noted by Bjorn and Manivannan). All of these lefovers have been fixed in this patchset. Namely the series starts with two bug-fixes. The first one concerns the improper link-mode initialization in case if the CDM-check is enabled. The second unfortunate mistake I made in the IP-core version type helper. In particular instead of testing the IP-core version type the macro function referred to the just IP-core version which obviously wasn't what I intended.

Afterwards two @Mani-noted fixes follow. Firstly the dma-ranges related warning message is fixed to start with "DMA-ranges" word instead of "Dma-ranges". Secondly the Baikal-T1 PCIe Host driver is converted to perform the asynchronous probe type which saved us of about 15% of bootup time if no any PCIe peripheral device attached to the port.

Then the patchset contains the Baikal-T1 PCIe driver fix. The corresponding patch removes the false error message printed during the controller probe procedure. I accidentally added the unconditional dev_err_probe() method invocation. It was obviously wrong.

Then two trivial cleanups are introduced. The first one concerns the duplicated fast-link-mode flag unsetting. The second one implies dropping a redundant empty line from the dw_pcie_link_set_max_speed() function.

The series continues with a patch inspired by the last @Bjorn note regarding the generic resources request interface. As @Bjorn correctly said it would be nice to have the new interface used wider in the DW PCIe subsystem. Aside with the Baikal-T1 PCIe Host driver the Toshiba Visconti PCIe driver can be easily converted to using the generic clock names. That's what is done in the noted patch.

The patchset is closed with a series of MAINTAINERS-list related patches. Firstly after getting the DW PCIe RP/EP DT-schemas refactored I forgot to update the MAINTAINER-list with the new files added in the framework of that procedure. All the snps,dw-pcie* schemas shall be maintained by the DW PCIe core driver maintainers. Secondly seeing how long it took for my patchsets to review and not having any comments from the original driver maintainers I'd suggest to add myself as the reviewer to the DW PCIe and eDMA drivers. Thus hopefully the new updates review process will be performed with much less latencies. For the same reason I would also like to suggest to add @Manivannan as the DW PCIe/eDMA drivers maintainer if he isn't against that idea. What do you think about the last suggestion?

Quoted 6 lines
Quoted 1 line

I'm willing to co-maintain the drivers.

Awesome! @Bjorn, @Lorenzo, @Vinod what do you think about this? If you are ok with that shall I resubmit the series with @Mani added to the DW PCIe/eDMA maintainers list or will you create the respective patches yourself?

Pls send the patch, that is preferred.

Quoted 7 lines
Quoted 3 lines

Ok. I'll resubmit the series with the new patches replacing @Gustavo with @Mani as the DW PCIe/eDMA drivers maintainer.

I talked to Vinod about the non-responsive maintainers and he suggested first demoting them as Reviewers instead of dropping altogether. So you can move Gustavo as a Reviewer.

Got it. Thanks for the note.

-Serge(y)

Quoted 11 lines

- Mani

Quoted 5 lines

-Serge(y)

Quoted 3 lines
Signature · 2 lines
-- 
~Vinod
Signature · 1 line
மணிவண்ணன் சதாசிவம்