linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability
@ 2023-05-06  7:31 Manivannan Sadhasivam
  2023-05-06  7:31 ` [PATCH 1/8] PCI: qcom: Use DWC helpers for modifying the read-only DBI registers Manivannan Sadhasivam
                   ` (7 more replies)
  0 siblings, 8 replies; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

Hi,

The SoCs making use of Qualcomm PCIe controllers do not support the PCIe hotplug
functionality. But the hotplug capability bit is set by default in the hardware.
This causes the kernel PCI core to register hotplug service for the controller
and send hotplug commands to it. But those commands will timeout generating
messages as below during boot and suspend/resume.
    
[    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
[    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
[    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
[    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)
    
This not only spams the console output but also induces a delay of a couple of
seconds. To fix this issue, this series clears the HPC bit in PCI_EXP_SLTCAP
register as a part of the post init sequence for all IP versions to not
advertise the hotplug capability for the controller.

Testing
=======

This series has been tested on DB845c (SDM845 SoC) and Lenovo Thinkpad X13s
(SC8280XP SoC).

Thanks,
Mani

Manivannan Sadhasivam (8):
  PCI: qcom: Use DWC helpers for modifying the read-only DBI registers
  PCI: qcom: Disable write access to read only registers for IP v2.9.0
  PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and
    v1.9.0
  PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and
    v2.9.0
  PCI: qcom: Do not advertise hotplug capability for IP v2.3.2
  PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0
  PCI: qcom: Do not advertise hotplug capability for IP v1.0.0
  PCI: qcom: Do not advertise hotplug capability for IP v2.1.0

 drivers/pci/controller/dwc/pcie-qcom.c | 97 ++++++++++++++++----------
 1 file changed, 60 insertions(+), 37 deletions(-)

-- 
2.25.1


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

* [PATCH 1/8] PCI: qcom: Use DWC helpers for modifying the read-only DBI registers
  2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
@ 2023-05-06  7:31 ` Manivannan Sadhasivam
  2023-05-06 11:43   ` Dmitry Baryshkov
  2023-05-06  7:31 ` [PATCH 2/8] PCI: qcom: Disable write access to read only registers for IP v2.9.0 Manivannan Sadhasivam
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

DWC core already exposes dw_pcie_dbi_ro_wr_{en/dis} helper APIs for
enabling and disabling the write access to read only DBI registers. So
let's use them instead of doing it manually.

Also, the existing code doesn't disable the write access when it's done.
This is also fixed now.

Fixes: 5d76117f070d ("PCI: qcom: Add support for IPQ8074 PCIe controller")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 4ab30892f6ef..01795ee7ce45 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -61,7 +61,6 @@
 /* DBI registers */
 #define AXI_MSTR_RESP_COMP_CTRL0		0x818
 #define AXI_MSTR_RESP_COMP_CTRL1		0x81c
-#define MISC_CONTROL_1_REG			0x8bc
 
 /* MHI registers */
 #define PARF_DEBUG_CNT_PM_LINKST_IN_L2		0xc04
@@ -132,9 +131,6 @@
 /* AXI_MSTR_RESP_COMP_CTRL1 register fields */
 #define CFG_BRIDGE_SB_INIT			BIT(0)
 
-/* MISC_CONTROL_1_REG register fields */
-#define DBI_RO_WR_EN				1
-
 /* PCI_EXP_SLTCAP register fields */
 #define PCIE_CAP_SLOT_POWER_LIMIT_VAL		FIELD_PREP(PCI_EXP_SLTCAP_SPLV, 250)
 #define PCIE_CAP_SLOT_POWER_LIMIT_SCALE		FIELD_PREP(PCI_EXP_SLTCAP_SPLS, 1)
@@ -826,7 +822,9 @@ static int qcom_pcie_post_init_2_3_3(struct qcom_pcie *pcie)
 	writel(0, pcie->parf + PARF_Q2A_FLUSH);
 
 	writel(PCI_COMMAND_MASTER, pci->dbi_base + PCI_COMMAND);
-	writel(DBI_RO_WR_EN, pci->dbi_base + MISC_CONTROL_1_REG);
+
+	dw_pcie_dbi_ro_wr_en(pci);
+
 	writel(PCIE_CAP_SLOT_VAL, pci->dbi_base + offset + PCI_EXP_SLTCAP);
 
 	val = readl(pci->dbi_base + offset + PCI_EXP_LNKCAP);
@@ -836,6 +834,8 @@ static int qcom_pcie_post_init_2_3_3(struct qcom_pcie *pcie)
 	writel(PCI_EXP_DEVCTL2_COMP_TMOUT_DIS, pci->dbi_base + offset +
 		PCI_EXP_DEVCTL2);
 
+	dw_pcie_dbi_ro_wr_dis(pci);
+
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH 2/8] PCI: qcom: Disable write access to read only registers for IP v2.9.0
  2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
  2023-05-06  7:31 ` [PATCH 1/8] PCI: qcom: Use DWC helpers for modifying the read-only DBI registers Manivannan Sadhasivam
@ 2023-05-06  7:31 ` Manivannan Sadhasivam
  2023-05-06 11:44   ` Dmitry Baryshkov
  2023-05-06  7:31 ` [PATCH 3/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0 Manivannan Sadhasivam
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

In the post init sequence of v2.9.0, write access to read only registers
are not disabled after updating the registers. Fix it by disabling the
access after register update.

Fixes: 0cf7c2efe8ac ("PCI: qcom: Add IPQ60xx support")
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 01795ee7ce45..391a45d1e70a 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -1136,6 +1136,7 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie)
 	writel(0, pcie->parf + PARF_Q2A_FLUSH);
 
 	dw_pcie_dbi_ro_wr_en(pci);
+
 	writel(PCIE_CAP_SLOT_VAL, pci->dbi_base + offset + PCI_EXP_SLTCAP);
 
 	val = readl(pci->dbi_base + offset + PCI_EXP_LNKCAP);
@@ -1145,6 +1146,8 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie)
 	writel(PCI_EXP_DEVCTL2_COMP_TMOUT_DIS, pci->dbi_base + offset +
 			PCI_EXP_DEVCTL2);
 
+	dw_pcie_dbi_ro_wr_dis(pci);
+
 	for (i = 0; i < 256; i++)
 		writel(0, pcie->parf + PARF_BDF_TO_SID_TABLE_N + (4 * i));
 
-- 
2.25.1


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

* [PATCH 3/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0
  2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
  2023-05-06  7:31 ` [PATCH 1/8] PCI: qcom: Use DWC helpers for modifying the read-only DBI registers Manivannan Sadhasivam
  2023-05-06  7:31 ` [PATCH 2/8] PCI: qcom: Disable write access to read only registers for IP v2.9.0 Manivannan Sadhasivam
@ 2023-05-06  7:31 ` Manivannan Sadhasivam
  2023-05-06 12:01   ` Dmitry Baryshkov
  2023-05-06  7:31 ` [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0 Manivannan Sadhasivam
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

SoCs making use of Qcom PCIe controller IPs v2.7.0 and v1.9.0 do not
support hotplug functionality. But the hotplug capability bit is set by
default in the hardware. This causes the kernel PCI core to register
hotplug service for the controller and send hotplug commands to it. But
those commands will timeout generating messages as below during boot and
suspend/resume.

[    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
[    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
[    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
[    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)

This not only spams the console output but also induces a delay of a
couple of seconds. To fix this issue, let's clear the HPC bit in
PCI_EXP_SLTCAP register as a part of the post init sequence to not
advertise the hotplug capability for the controller.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 391a45d1e70a..00246726c21d 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -966,6 +966,23 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
 	return ret;
 }
 
+static int qcom_pcie_post_init_2_7_0(struct qcom_pcie *pcie)
+{
+	struct dw_pcie *pci = pcie->pci;
+	u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
+	u32 val;
+
+	dw_pcie_dbi_ro_wr_en(pci);
+
+	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
+	val &= ~PCI_EXP_SLTCAP_HPC;
+	writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
+
+	dw_pcie_dbi_ro_wr_dis(pci);
+
+	return 0;
+}
+
 static void qcom_pcie_deinit_2_7_0(struct qcom_pcie *pcie)
 {
 	struct qcom_pcie_resources_2_7_0 *res = &pcie->res.v2_7_0;
@@ -1272,6 +1289,7 @@ static const struct qcom_pcie_ops ops_2_3_3 = {
 static const struct qcom_pcie_ops ops_2_7_0 = {
 	.get_resources = qcom_pcie_get_resources_2_7_0,
 	.init = qcom_pcie_init_2_7_0,
+	.post_init = qcom_pcie_post_init_2_7_0,
 	.deinit = qcom_pcie_deinit_2_7_0,
 	.ltssm_enable = qcom_pcie_2_3_2_ltssm_enable,
 };
@@ -1280,6 +1298,7 @@ static const struct qcom_pcie_ops ops_2_7_0 = {
 static const struct qcom_pcie_ops ops_1_9_0 = {
 	.get_resources = qcom_pcie_get_resources_2_7_0,
 	.init = qcom_pcie_init_2_7_0,
+	.post_init = qcom_pcie_post_init_2_7_0,
 	.deinit = qcom_pcie_deinit_2_7_0,
 	.ltssm_enable = qcom_pcie_2_3_2_ltssm_enable,
 	.config_sid = qcom_pcie_config_sid_1_9_0,
-- 
2.25.1


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

* [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0
  2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
                   ` (2 preceding siblings ...)
  2023-05-06  7:31 ` [PATCH 3/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0 Manivannan Sadhasivam
@ 2023-05-06  7:31 ` Manivannan Sadhasivam
  2023-05-06 12:01   ` Dmitry Baryshkov
  2023-05-19 12:43   ` Sricharan Ramabadhran
  2023-05-06  7:31 ` [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2 Manivannan Sadhasivam
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

SoCs making use of Qcom PCIe controller IPs v2.3.3 and v2.9.0 do not
support hotplug functionality. But the hotplug capability bit is set by
default in the hardware. This causes the kernel PCI core to register
hotplug service for the controller and send hotplug commands to it. But
those commands will timeout generating messages as below during boot
and suspend/resume.

[    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
[    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
[    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
[    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)

This not only spams the console output but also induces a delay of a
couple of seconds. To fix this issue, let's not set the HPC bit in
PCI_EXP_SLTCAP register as a part of the post init sequence to not
advertise the hotplug capability for the controller.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 00246726c21d..3d5b3ce9e2da 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -140,7 +140,6 @@
 						PCI_EXP_SLTCAP_AIP | \
 						PCI_EXP_SLTCAP_PIP | \
 						PCI_EXP_SLTCAP_HPS | \
-						PCI_EXP_SLTCAP_HPC | \
 						PCI_EXP_SLTCAP_EIP | \
 						PCIE_CAP_SLOT_POWER_LIMIT_VAL | \
 						PCIE_CAP_SLOT_POWER_LIMIT_SCALE)
-- 
2.25.1


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

* [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2
  2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
                   ` (3 preceding siblings ...)
  2023-05-06  7:31 ` [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0 Manivannan Sadhasivam
@ 2023-05-06  7:31 ` Manivannan Sadhasivam
  2023-05-06 12:04   ` Dmitry Baryshkov
  2023-05-06  7:31 ` [PATCH 6/8] PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0 Manivannan Sadhasivam
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

SoCs making use of Qcom PCIe controller IP v2.3.2 do not support hotplug
functionality. But the hotplug capability bit is set by default in the
hardware. This causes the kernel PCI core to register hotplug service for
the controller and send hotplug commands to it. But those commands will
timeout generating messages as below during boot and suspend/resume.

[    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
[    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
[    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
[    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)

This not only spams the console output but also induces a delay of a
couple of seconds. To fix this issue, let's clear the HPC bit in
PCI_EXP_SLTCAP register as a part of the post init sequence to not
advertise the hotplug capability for the controller.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 3d5b3ce9e2da..33353be396ec 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -579,6 +579,8 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie)
 
 static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
 {
+	struct dw_pcie *pci = pcie->pci;
+	u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
 	u32 val;
 
 	/* enable PCIe clocks and resets */
@@ -602,6 +604,14 @@ static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
 	val |= EN;
 	writel(val, pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT_V2);
 
+	dw_pcie_dbi_ro_wr_en(pci);
+
+	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
+	val &= ~PCI_EXP_SLTCAP_HPC;
+	writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
+
+	dw_pcie_dbi_ro_wr_dis(pci);
+
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH 6/8] PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0
  2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
                   ` (4 preceding siblings ...)
  2023-05-06  7:31 ` [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2 Manivannan Sadhasivam
@ 2023-05-06  7:31 ` Manivannan Sadhasivam
  2023-05-06 12:08   ` Dmitry Baryshkov
  2023-05-06  7:31 ` [PATCH 7/8] PCI: qcom: Do not advertise hotplug capability for IP v1.0.0 Manivannan Sadhasivam
  2023-05-06  7:31 ` [PATCH 8/8] PCI: qcom: Do not advertise hotplug capability for IP v2.1.0 Manivannan Sadhasivam
  7 siblings, 1 reply; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

The post init sequence of IP v2.4.0 is same as v2.3.2. So let's reuse the
v2.3.2 sequence which now also disables hotplug capability of the
controller as it is not at all supported on any SoCs making use of this IP.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 30 +-------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 33353be396ec..0c5e825c6360 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -697,34 +697,6 @@ static int qcom_pcie_init_2_4_0(struct qcom_pcie *pcie)
 	return 0;
 }
 
-static int qcom_pcie_post_init_2_4_0(struct qcom_pcie *pcie)
-{
-	u32 val;
-
-	/* enable PCIe clocks and resets */
-	val = readl(pcie->parf + PARF_PHY_CTRL);
-	val &= ~PHY_TEST_PWR_DOWN;
-	writel(val, pcie->parf + PARF_PHY_CTRL);
-
-	/* change DBI base address */
-	writel(0, pcie->parf + PARF_DBI_BASE_ADDR);
-
-	/* MAC PHY_POWERDOWN MUX DISABLE  */
-	val = readl(pcie->parf + PARF_SYS_CTRL);
-	val &= ~MAC_PHY_POWERDOWN_IN_P2_D_MUX_EN;
-	writel(val, pcie->parf + PARF_SYS_CTRL);
-
-	val = readl(pcie->parf + PARF_MHI_CLOCK_RESET_CTRL);
-	val |= BYPASS;
-	writel(val, pcie->parf + PARF_MHI_CLOCK_RESET_CTRL);
-
-	val = readl(pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT_V2);
-	val |= EN;
-	writel(val, pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT_V2);
-
-	return 0;
-}
-
 static int qcom_pcie_get_resources_2_3_3(struct qcom_pcie *pcie)
 {
 	struct qcom_pcie_resources_2_3_3 *res = &pcie->res.v2_3_3;
@@ -1280,7 +1252,7 @@ static const struct qcom_pcie_ops ops_2_3_2 = {
 static const struct qcom_pcie_ops ops_2_4_0 = {
 	.get_resources = qcom_pcie_get_resources_2_4_0,
 	.init = qcom_pcie_init_2_4_0,
-	.post_init = qcom_pcie_post_init_2_4_0,
+	.post_init = qcom_pcie_post_init_2_3_2,
 	.deinit = qcom_pcie_deinit_2_4_0,
 	.ltssm_enable = qcom_pcie_2_3_2_ltssm_enable,
 };
-- 
2.25.1


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

* [PATCH 7/8] PCI: qcom: Do not advertise hotplug capability for IP v1.0.0
  2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
                   ` (5 preceding siblings ...)
  2023-05-06  7:31 ` [PATCH 6/8] PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0 Manivannan Sadhasivam
@ 2023-05-06  7:31 ` Manivannan Sadhasivam
  2023-05-06  7:31 ` [PATCH 8/8] PCI: qcom: Do not advertise hotplug capability for IP v2.1.0 Manivannan Sadhasivam
  7 siblings, 0 replies; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

SoCs making use of Qcom PCIe controller IP v1.0.0 do not support hotplug
functionality. But the hotplug capability bit is set by default in the
hardware. This causes the kernel PCI core to register hotplug service for
the controller and send hotplug commands to it. But those commands will
timeout generating messages as below during boot and suspend/resume.

[    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
[    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
[    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
[    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)

This not only spams the console output but also induces a delay of a
couple of seconds. To fix this issue, let's clear the HPC bit in
PCI_EXP_SLTCAP register as a part of the post init sequence to not
advertise the hotplug capability for the controller.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 0c5e825c6360..6fbaf7b419e6 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -497,16 +497,27 @@ static int qcom_pcie_init_1_0_0(struct qcom_pcie *pcie)
 
 static int qcom_pcie_post_init_1_0_0(struct qcom_pcie *pcie)
 {
+	struct dw_pcie *pci = pcie->pci;
+	u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
+	u32 val;
+
 	/* change DBI base address */
 	writel(0, pcie->parf + PARF_DBI_BASE_ADDR);
 
 	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-		u32 val = readl(pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT);
-
+		val = readl(pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT);
 		val |= EN;
 		writel(val, pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT);
 	}
 
+	dw_pcie_dbi_ro_wr_en(pci);
+
+	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
+	val &= ~PCI_EXP_SLTCAP_HPC;
+	writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
+
+	dw_pcie_dbi_ro_wr_dis(pci);
+
 	return 0;
 }
 
-- 
2.25.1


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

* [PATCH 8/8] PCI: qcom: Do not advertise hotplug capability for IP v2.1.0
  2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
                   ` (6 preceding siblings ...)
  2023-05-06  7:31 ` [PATCH 7/8] PCI: qcom: Do not advertise hotplug capability for IP v1.0.0 Manivannan Sadhasivam
@ 2023-05-06  7:31 ` Manivannan Sadhasivam
  7 siblings, 0 replies; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-06  7:31 UTC (permalink / raw)
  To: lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara, Manivannan Sadhasivam

SoCs making use of Qcom PCIe controller IP v2.1.0 do not support hotplug
functionality. But the hotplug capability bit is set by default in the
hardware. This causes the kernel PCI core to register hotplug service for
the controller and send hotplug commands to it. But those commands will
timeout generating messages as below during boot and suspend/resume.

[    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
[    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
[    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
[    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)

This not only spams the console output but also induces a delay of a
couple of seconds. To fix this issue, let's clear the HPC bit in
PCI_EXP_SLTCAP register as a part of the post init sequence to not
advertise the hotplug capability for the controller.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pci/controller/dwc/pcie-qcom.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 6fbaf7b419e6..68af95c836d2 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -373,6 +373,7 @@ static int qcom_pcie_post_init_2_1_0(struct qcom_pcie *pcie)
 {
 	struct qcom_pcie_resources_2_1_0 *res = &pcie->res.v2_1_0;
 	struct dw_pcie *pci = pcie->pci;
+	u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
 	struct device *dev = pci->dev;
 	struct device_node *node = dev->of_node;
 	u32 val;
@@ -424,6 +425,14 @@ static int qcom_pcie_post_init_2_1_0(struct qcom_pcie *pcie)
 	writel(CFG_BRIDGE_SB_INIT,
 	       pci->dbi_base + AXI_MSTR_RESP_COMP_CTRL1);
 
+	dw_pcie_dbi_ro_wr_en(pci);
+
+	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
+	val &= ~PCI_EXP_SLTCAP_HPC;
+	writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
+
+	dw_pcie_dbi_ro_wr_dis(pci);
+
 	return 0;
 }
 
-- 
2.25.1


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

* Re: [PATCH 1/8] PCI: qcom: Use DWC helpers for modifying the read-only DBI registers
  2023-05-06  7:31 ` [PATCH 1/8] PCI: qcom: Use DWC helpers for modifying the read-only DBI registers Manivannan Sadhasivam
@ 2023-05-06 11:43   ` Dmitry Baryshkov
  2023-05-06 12:03     ` Dmitry Baryshkov
  0 siblings, 1 reply; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 11:43 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
> DWC core already exposes dw_pcie_dbi_ro_wr_{en/dis} helper APIs for
> enabling and disabling the write access to read only DBI registers. So
> let's use them instead of doing it manually.
> 
> Also, the existing code doesn't disable the write access when it's done.
> This is also fixed now.
> 
> Fixes: 5d76117f070d ("PCI: qcom: Add support for IPQ8074 PCIe controller")
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/pci/controller/dwc/pcie-qcom.c | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@gmail.com>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 2/8] PCI: qcom: Disable write access to read only registers for IP v2.9.0
  2023-05-06  7:31 ` [PATCH 2/8] PCI: qcom: Disable write access to read only registers for IP v2.9.0 Manivannan Sadhasivam
@ 2023-05-06 11:44   ` Dmitry Baryshkov
  2023-05-06 12:03     ` Dmitry Baryshkov
  0 siblings, 1 reply; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 11:44 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
> In the post init sequence of v2.9.0, write access to read only registers
> are not disabled after updating the registers. Fix it by disabling the
> access after register update.
> 
> Fixes: 0cf7c2efe8ac ("PCI: qcom: Add IPQ60xx support")
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@gmail.com>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 3/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0
  2023-05-06  7:31 ` [PATCH 3/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0 Manivannan Sadhasivam
@ 2023-05-06 12:01   ` Dmitry Baryshkov
  2023-05-06 12:03     ` Dmitry Baryshkov
  0 siblings, 1 reply; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 12:01 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
> SoCs making use of Qcom PCIe controller IPs v2.7.0 and v1.9.0 do not
> support hotplug functionality. But the hotplug capability bit is set by
> default in the hardware. This causes the kernel PCI core to register
> hotplug service for the controller and send hotplug commands to it. But
> those commands will timeout generating messages as below during boot and
> suspend/resume.
> 
> [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
> [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
> [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
> [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)
> 
> This not only spams the console output but also induces a delay of a
> couple of seconds. To fix this issue, let's clear the HPC bit in
> PCI_EXP_SLTCAP register as a part of the post init sequence to not
> advertise the hotplug capability for the controller.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/pci/controller/dwc/pcie-qcom.c | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@gmail.com>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0
  2023-05-06  7:31 ` [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0 Manivannan Sadhasivam
@ 2023-05-06 12:01   ` Dmitry Baryshkov
  2023-05-06 12:07     ` Dmitry Baryshkov
  2023-05-19 12:43   ` Sricharan Ramabadhran
  1 sibling, 1 reply; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 12:01 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
> SoCs making use of Qcom PCIe controller IPs v2.3.3 and v2.9.0 do not
> support hotplug functionality. But the hotplug capability bit is set by
> default in the hardware. This causes the kernel PCI core to register
> hotplug service for the controller and send hotplug commands to it. But
> those commands will timeout generating messages as below during boot
> and suspend/resume.
> 
> [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
> [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
> [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
> [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)
> 
> This not only spams the console output but also induces a delay of a
> couple of seconds. To fix this issue, let's not set the HPC bit in
> PCI_EXP_SLTCAP register as a part of the post init sequence to not
> advertise the hotplug capability for the controller.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/pci/controller/dwc/pcie-qcom.c | 1 -
>   1 file changed, 1 deletion(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@gmail.com>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 2/8] PCI: qcom: Disable write access to read only registers for IP v2.9.0
  2023-05-06 11:44   ` Dmitry Baryshkov
@ 2023-05-06 12:03     ` Dmitry Baryshkov
  0 siblings, 0 replies; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 12:03 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 14:44, Dmitry Baryshkov wrote:
> On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
>> In the post init sequence of v2.9.0, write access to read only registers
>> are not disabled after updating the registers. Fix it by disabling the
>> access after register update.
>>
>> Fixes: 0cf7c2efe8ac ("PCI: qcom: Add IPQ60xx support")
>> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>> ---
>>   drivers/pci/controller/dwc/pcie-qcom.c | 3 +++
>>   1 file changed, 3 insertions(+)
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@gmail.com>
> 

Of course:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry


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

* Re: [PATCH 1/8] PCI: qcom: Use DWC helpers for modifying the read-only DBI registers
  2023-05-06 11:43   ` Dmitry Baryshkov
@ 2023-05-06 12:03     ` Dmitry Baryshkov
  0 siblings, 0 replies; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 12:03 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 14:43, Dmitry Baryshkov wrote:
> On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
>> DWC core already exposes dw_pcie_dbi_ro_wr_{en/dis} helper APIs for
>> enabling and disabling the write access to read only DBI registers. So
>> let's use them instead of doing it manually.
>>
>> Also, the existing code doesn't disable the write access when it's done.
>> This is also fixed now.
>>
>> Fixes: 5d76117f070d ("PCI: qcom: Add support for IPQ8074 PCIe 
>> controller")
>> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>> ---
>>   drivers/pci/controller/dwc/pcie-qcom.c | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@gmail.com>

Of course:
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry


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

* Re: [PATCH 3/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0
  2023-05-06 12:01   ` Dmitry Baryshkov
@ 2023-05-06 12:03     ` Dmitry Baryshkov
  0 siblings, 0 replies; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 12:03 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 15:01, Dmitry Baryshkov wrote:
> On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
>> SoCs making use of Qcom PCIe controller IPs v2.7.0 and v1.9.0 do not
>> support hotplug functionality. But the hotplug capability bit is set by
>> default in the hardware. This causes the kernel PCI core to register
>> hotplug service for the controller and send hotplug commands to it. But
>> those commands will timeout generating messages as below during boot and
>> suspend/resume.
>>
>> [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug 
>> command 0x03c0 (issued 2020 msec ago)
>> [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug 
>> command 0x03c0 (issued 2048 msec ago)
>> [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug 
>> command 0x07c0 (issued 2020 msec ago)
>> [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug 
>> command 0x07c0 (issued 2052 msec ago)
>>
>> This not only spams the console output but also induces a delay of a
>> couple of seconds. To fix this issue, let's clear the HPC bit in
>> PCI_EXP_SLTCAP register as a part of the post init sequence to not
>> advertise the hotplug capability for the controller.
>>
>> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>> ---
>>   drivers/pci/controller/dwc/pcie-qcom.c | 19 +++++++++++++++++++
>>   1 file changed, 19 insertions(+)
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@gmail.com>
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry


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

* Re: [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2
  2023-05-06  7:31 ` [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2 Manivannan Sadhasivam
@ 2023-05-06 12:04   ` Dmitry Baryshkov
  2023-05-06 14:01     ` Konrad Dybcio
  2023-05-08 10:25     ` Manivannan Sadhasivam
  0 siblings, 2 replies; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 12:04 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
> SoCs making use of Qcom PCIe controller IP v2.3.2 do not support hotplug
> functionality. But the hotplug capability bit is set by default in the
> hardware. This causes the kernel PCI core to register hotplug service for
> the controller and send hotplug commands to it. But those commands will
> timeout generating messages as below during boot and suspend/resume.
> 
> [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
> [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
> [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
> [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)
> 
> This not only spams the console output but also induces a delay of a
> couple of seconds. To fix this issue, let's clear the HPC bit in
> PCI_EXP_SLTCAP register as a part of the post init sequence to not
> advertise the hotplug capability for the controller.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/pci/controller/dwc/pcie-qcom.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 3d5b3ce9e2da..33353be396ec 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -579,6 +579,8 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie)
>   
>   static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
>   {
> +	struct dw_pcie *pci = pcie->pci;
> +	u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
>   	u32 val;
>   
>   	/* enable PCIe clocks and resets */
> @@ -602,6 +604,14 @@ static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
>   	val |= EN;
>   	writel(val, pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT_V2);
>   
> +	dw_pcie_dbi_ro_wr_en(pci);
> +
> +	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
> +	val &= ~PCI_EXP_SLTCAP_HPC;
> +	writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
> +
> +	dw_pcie_dbi_ro_wr_dis(pci);
> +

Seeing this code again and again makes me wonder if we should have a 
separate function for this.

-- 
With best wishes
Dmitry


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

* Re: [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0
  2023-05-06 12:01   ` Dmitry Baryshkov
@ 2023-05-06 12:07     ` Dmitry Baryshkov
  0 siblings, 0 replies; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 12:07 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 15:01, Dmitry Baryshkov wrote:
> On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
>> SoCs making use of Qcom PCIe controller IPs v2.3.3 and v2.9.0 do not
>> support hotplug functionality. But the hotplug capability bit is set by
>> default in the hardware. This causes the kernel PCI core to register
>> hotplug service for the controller and send hotplug commands to it. But
>> those commands will timeout generating messages as below during boot
>> and suspend/resume.
>>
>> [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug 
>> command 0x03c0 (issued 2020 msec ago)
>> [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug 
>> command 0x03c0 (issued 2048 msec ago)
>> [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug 
>> command 0x07c0 (issued 2020 msec ago)
>> [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug 
>> command 0x07c0 (issued 2052 msec ago)
>>
>> This not only spams the console output but also induces a delay of a
>> couple of seconds. To fix this issue, let's not set the HPC bit in
>> PCI_EXP_SLTCAP register as a part of the post init sequence to not
>> advertise the hotplug capability for the controller.
>>
>> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>> ---
>>   drivers/pci/controller/dwc/pcie-qcom.c | 1 -
>>   1 file changed, 1 deletion(-)
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@gmail.com>
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 6/8] PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0
  2023-05-06  7:31 ` [PATCH 6/8] PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0 Manivannan Sadhasivam
@ 2023-05-06 12:08   ` Dmitry Baryshkov
  0 siblings, 0 replies; 23+ messages in thread
From: Dmitry Baryshkov @ 2023-05-06 12:08 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev, quic_srichara

On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
> The post init sequence of IP v2.4.0 is same as v2.3.2. So let's reuse the
> v2.3.2 sequence which now also disables hotplug capability of the
> controller as it is not at all supported on any SoCs making use of this IP.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/pci/controller/dwc/pcie-qcom.c | 30 +-------------------------
>   1 file changed, 1 insertion(+), 29 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2
  2023-05-06 12:04   ` Dmitry Baryshkov
@ 2023-05-06 14:01     ` Konrad Dybcio
  2023-05-08 10:41       ` Manivannan Sadhasivam
  2023-05-08 10:25     ` Manivannan Sadhasivam
  1 sibling, 1 reply; 23+ messages in thread
From: Konrad Dybcio @ 2023-05-06 14:01 UTC (permalink / raw)
  To: Dmitry Baryshkov, Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, linux-pci, linux-arm-msm, linux-kernel, steev,
	quic_srichara



On 6.05.2023 14:04, Dmitry Baryshkov wrote:
> On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
>> SoCs making use of Qcom PCIe controller IP v2.3.2 do not support hotplug
>> functionality. But the hotplug capability bit is set by default in the
>> hardware. This causes the kernel PCI core to register hotplug service for
>> the controller and send hotplug commands to it. But those commands will
>> timeout generating messages as below during boot and suspend/resume.
>>
>> [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
>> [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
>> [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
>> [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)
>>
>> This not only spams the console output but also induces a delay of a
>> couple of seconds. To fix this issue, let's clear the HPC bit in
>> PCI_EXP_SLTCAP register as a part of the post init sequence to not
>> advertise the hotplug capability for the controller.
>>
>> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>> ---
>>   drivers/pci/controller/dwc/pcie-qcom.c | 10 ++++++++++
>>   1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
>> index 3d5b3ce9e2da..33353be396ec 100644
>> --- a/drivers/pci/controller/dwc/pcie-qcom.c
>> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
>> @@ -579,6 +579,8 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie)
>>     static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
>>   {
>> +    struct dw_pcie *pci = pcie->pci;
>> +    u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
>>       u32 val;
>>         /* enable PCIe clocks and resets */
>> @@ -602,6 +604,14 @@ static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
>>       val |= EN;
>>       writel(val, pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT_V2);
>>   +    dw_pcie_dbi_ro_wr_en(pci);
>> +
>> +    val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
>> +    val &= ~PCI_EXP_SLTCAP_HPC;
>> +    writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
>> +
>> +    dw_pcie_dbi_ro_wr_dis(pci);
>> +
> 
> Seeing this code again and again makes me wonder if we should have a separate function for this.
Moreover, is there no generic rmw type function for readl+writel?

Konrad
> 

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

* Re: [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2
  2023-05-06 12:04   ` Dmitry Baryshkov
  2023-05-06 14:01     ` Konrad Dybcio
@ 2023-05-08 10:25     ` Manivannan Sadhasivam
  1 sibling, 0 replies; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-08 10:25 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: lpieralisi, kw, bhelgaas, robh, andersson, konrad.dybcio,
	linux-pci, linux-arm-msm, linux-kernel, steev, quic_srichara

On Sat, May 06, 2023 at 03:04:42PM +0300, Dmitry Baryshkov wrote:
> On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
> > SoCs making use of Qcom PCIe controller IP v2.3.2 do not support hotplug
> > functionality. But the hotplug capability bit is set by default in the
> > hardware. This causes the kernel PCI core to register hotplug service for
> > the controller and send hotplug commands to it. But those commands will
> > timeout generating messages as below during boot and suspend/resume.
> > 
> > [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
> > [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
> > [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
> > [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)
> > 
> > This not only spams the console output but also induces a delay of a
> > couple of seconds. To fix this issue, let's clear the HPC bit in
> > PCI_EXP_SLTCAP register as a part of the post init sequence to not
> > advertise the hotplug capability for the controller.
> > 
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> >   drivers/pci/controller/dwc/pcie-qcom.c | 10 ++++++++++
> >   1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> > index 3d5b3ce9e2da..33353be396ec 100644
> > --- a/drivers/pci/controller/dwc/pcie-qcom.c
> > +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> > @@ -579,6 +579,8 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie)
> >   static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
> >   {
> > +	struct dw_pcie *pci = pcie->pci;
> > +	u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
> >   	u32 val;
> >   	/* enable PCIe clocks and resets */
> > @@ -602,6 +604,14 @@ static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
> >   	val |= EN;
> >   	writel(val, pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT_V2);
> > +	dw_pcie_dbi_ro_wr_en(pci);
> > +
> > +	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
> > +	val &= ~PCI_EXP_SLTCAP_HPC;
> > +	writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
> > +
> > +	dw_pcie_dbi_ro_wr_dis(pci);
> > +
> 
> Seeing this code again and again makes me wonder if we should have a
> separate function for this.
> 

Makes sense!

- Mani

> -- 
> With best wishes
> Dmitry
> 

-- 
மணிவண்ணன் சதாசிவம்

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

* Re: [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2
  2023-05-06 14:01     ` Konrad Dybcio
@ 2023-05-08 10:41       ` Manivannan Sadhasivam
  0 siblings, 0 replies; 23+ messages in thread
From: Manivannan Sadhasivam @ 2023-05-08 10:41 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Dmitry Baryshkov, lpieralisi, kw, bhelgaas, robh, andersson,
	linux-pci, linux-arm-msm, linux-kernel, steev, quic_srichara

On Sat, May 06, 2023 at 04:01:43PM +0200, Konrad Dybcio wrote:
> 
> 
> On 6.05.2023 14:04, Dmitry Baryshkov wrote:
> > On 06/05/2023 10:31, Manivannan Sadhasivam wrote:
> >> SoCs making use of Qcom PCIe controller IP v2.3.2 do not support hotplug
> >> functionality. But the hotplug capability bit is set by default in the
> >> hardware. This causes the kernel PCI core to register hotplug service for
> >> the controller and send hotplug commands to it. But those commands will
> >> timeout generating messages as below during boot and suspend/resume.
> >>
> >> [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
> >> [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
> >> [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
> >> [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)
> >>
> >> This not only spams the console output but also induces a delay of a
> >> couple of seconds. To fix this issue, let's clear the HPC bit in
> >> PCI_EXP_SLTCAP register as a part of the post init sequence to not
> >> advertise the hotplug capability for the controller.
> >>
> >> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> >> ---
> >>   drivers/pci/controller/dwc/pcie-qcom.c | 10 ++++++++++
> >>   1 file changed, 10 insertions(+)
> >>
> >> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> >> index 3d5b3ce9e2da..33353be396ec 100644
> >> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> >> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> >> @@ -579,6 +579,8 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie)
> >>     static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
> >>   {
> >> +    struct dw_pcie *pci = pcie->pci;
> >> +    u16 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_EXP);
> >>       u32 val;
> >>         /* enable PCIe clocks and resets */
> >> @@ -602,6 +604,14 @@ static int qcom_pcie_post_init_2_3_2(struct qcom_pcie *pcie)
> >>       val |= EN;
> >>       writel(val, pcie->parf + PARF_AXI_MSTR_WR_ADDR_HALT_V2);
> >>   +    dw_pcie_dbi_ro_wr_en(pci);
> >> +
> >> +    val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
> >> +    val &= ~PCI_EXP_SLTCAP_HPC;
> >> +    writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
> >> +
> >> +    dw_pcie_dbi_ro_wr_dis(pci);
> >> +
> > 
> > Seeing this code again and again makes me wonder if we should have a separate function for this.
> Moreover, is there no generic rmw type function for readl+writel?
> 

No rmw as of now. But it could be added to reduce boilerplate code. But it
should be part of separate cleanup series though.

- Mani

> Konrad
> > 

-- 
மணிவண்ணன் சதாசிவம்

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

* Re: [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0
  2023-05-06  7:31 ` [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0 Manivannan Sadhasivam
  2023-05-06 12:01   ` Dmitry Baryshkov
@ 2023-05-19 12:43   ` Sricharan Ramabadhran
  1 sibling, 0 replies; 23+ messages in thread
From: Sricharan Ramabadhran @ 2023-05-19 12:43 UTC (permalink / raw)
  To: Manivannan Sadhasivam, lpieralisi, kw, bhelgaas
  Cc: robh, andersson, konrad.dybcio, linux-pci, linux-arm-msm,
	linux-kernel, steev



On 5/6/2023 1:01 PM, Manivannan Sadhasivam wrote:
> SoCs making use of Qcom PCIe controller IPs v2.3.3 and v2.9.0 do not
> support hotplug functionality. But the hotplug capability bit is set by
> default in the hardware. This causes the kernel PCI core to register
> hotplug service for the controller and send hotplug commands to it. But
> those commands will timeout generating messages as below during boot
> and suspend/resume.
> 
> [    5.782159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2020 msec ago)
> [    5.810161] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x03c0 (issued 2048 msec ago)
> [    7.838162] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2020 msec ago)
> [    7.870159] pcieport 0001:00:00.0: pciehp: Timeout on hotplug command 0x07c0 (issued 2052 msec ago)
> 
> This not only spams the console output but also induces a delay of a
> couple of seconds. To fix this issue, let's not set the HPC bit in
> PCI_EXP_SLTCAP register as a part of the post init sequence to not
> advertise the hotplug capability for the controller.
> 
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>   drivers/pci/controller/dwc/pcie-qcom.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 00246726c21d..3d5b3ce9e2da 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -140,7 +140,6 @@
>   						PCI_EXP_SLTCAP_AIP | \
>   						PCI_EXP_SLTCAP_PIP | \
>   						PCI_EXP_SLTCAP_HPS | \
> -						PCI_EXP_SLTCAP_HPC | \
>   						PCI_EXP_SLTCAP_EIP | \
>   						PCIE_CAP_SLOT_POWER_LIMIT_VAL | \
>   						PCIE_CAP_SLOT_POWER_LIMIT_SCALE)

  Tested this in ipq9574 board and the 'timeout' messages go away with
  this.

   Tested-by: Sricharan Ramabadhran <quic_srichara@quicinc.com>

Regards,
  Sricharan

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

end of thread, other threads:[~2023-05-19 12:44 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-06  7:31 [PATCH 0/8] PCI: qcom: Do not advertise hotplug capability Manivannan Sadhasivam
2023-05-06  7:31 ` [PATCH 1/8] PCI: qcom: Use DWC helpers for modifying the read-only DBI registers Manivannan Sadhasivam
2023-05-06 11:43   ` Dmitry Baryshkov
2023-05-06 12:03     ` Dmitry Baryshkov
2023-05-06  7:31 ` [PATCH 2/8] PCI: qcom: Disable write access to read only registers for IP v2.9.0 Manivannan Sadhasivam
2023-05-06 11:44   ` Dmitry Baryshkov
2023-05-06 12:03     ` Dmitry Baryshkov
2023-05-06  7:31 ` [PATCH 3/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0 Manivannan Sadhasivam
2023-05-06 12:01   ` Dmitry Baryshkov
2023-05-06 12:03     ` Dmitry Baryshkov
2023-05-06  7:31 ` [PATCH 4/8] PCI: qcom: Do not advertise hotplug capability for IPs v2.3.3 and v2.9.0 Manivannan Sadhasivam
2023-05-06 12:01   ` Dmitry Baryshkov
2023-05-06 12:07     ` Dmitry Baryshkov
2023-05-19 12:43   ` Sricharan Ramabadhran
2023-05-06  7:31 ` [PATCH 5/8] PCI: qcom: Do not advertise hotplug capability for IP v2.3.2 Manivannan Sadhasivam
2023-05-06 12:04   ` Dmitry Baryshkov
2023-05-06 14:01     ` Konrad Dybcio
2023-05-08 10:41       ` Manivannan Sadhasivam
2023-05-08 10:25     ` Manivannan Sadhasivam
2023-05-06  7:31 ` [PATCH 6/8] PCI: qcom: Use post init sequence of IP v2.3.2 for v2.4.0 Manivannan Sadhasivam
2023-05-06 12:08   ` Dmitry Baryshkov
2023-05-06  7:31 ` [PATCH 7/8] PCI: qcom: Do not advertise hotplug capability for IP v1.0.0 Manivannan Sadhasivam
2023-05-06  7:31 ` [PATCH 8/8] PCI: qcom: Do not advertise hotplug capability for IP v2.1.0 Manivannan Sadhasivam

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).