* [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
@ 2024-07-17 17:03 Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 01/13] PCI: qcom-ep: Drop the redundant masking of global IRQ events Manivannan Sadhasivam via B4 Relay
` (12 more replies)
0 siblings, 13 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
Hi,
This series adds support to simulate PCIe hotplug using the Qcom specific
'global' IRQ. Historically, Qcom PCIe RC controllers lack standard hotplug
support. So when an endpoint is attached to the SoC, users have to rescan the
bus manually to enumerate the device. But this can be avoided by simulating the
PCIe hotplug using Qcom specific way.
Qcom PCIe RC controllers are capable of generating the 'global' SPI interrupt
to the host CPUs. The device driver can use this event to identify events such
as PCIe link specific events, safety events etc...
One such event is the PCIe Link up event generated when an endpoint is detected
on the bus and the Link is 'up'. This event can be used to simulate the PCIe
hotplug in the Qcom SoCs.
So add support for capturing the PCIe Link up event using the 'global' interrupt
in the driver. Once the Link up event is received, the bus underneath the host
bridge is scanned to enumerate PCIe endpoint devices, thus simulating hotplug.
This series also has some cleanups to the Qcom PCIe EP controller driver for
interrupt handling.
Testing
=======
This series is tested on Qcom SM8450 based development board that has 2 SoCs
connected over PCIe.
- Mani
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
Changes in v2:
- Added CONFIG_PCI_DOMAINS_GENERIC guard for domain_nr
- Switched to dev_WARN_ONCE() for unhandled interrupts
- Squashed the 'linux,pci-domain' bindings patches into one
- Link to v1: https://lore.kernel.org/r/20240715-pci-qcom-hotplug-v1-0-5f3765cc873a@linaro.org
---
Manivannan Sadhasivam (13):
PCI: qcom-ep: Drop the redundant masking of global IRQ events
PCI: qcom-ep: Reword the error message for receiving unknown global IRQ event
dt-bindings: PCI: pci-ep: Update Maintainers
dt-bindings: PCI: pci-ep: Document 'linux,pci-domain' property
PCI: endpoint: Assign PCI domain number for endpoint controllers
PCI: qcom-ep: Modify 'global_irq' and 'perst_irq' IRQ device names
ARM: dts: qcom: sdx55: Add 'linux,pci-domain' to PCIe EP controller node
ARM: dts: qcom: sdx65: Add 'linux,pci-domain' to PCIe EP controller node
arm64: dts: qcom: sa8775p: Add 'linux,pci-domain' to PCIe EP controller nodes
dt-bindings: PCI: qcom: Add 'global' interrupt
dt-bindings: PCI: qcom,pcie-sm8450: Add 'global' interrupt
PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
arm64: dts: qcom: sm8450: Add 'global' interrupt to the PCIe RC node
Documentation/devicetree/bindings/pci/pci-ep.yaml | 14 +++++-
.../devicetree/bindings/pci/qcom,pcie-common.yaml | 4 +-
.../devicetree/bindings/pci/qcom,pcie-ep.yaml | 1 +
.../devicetree/bindings/pci/qcom,pcie-sm8450.yaml | 10 ++--
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 1 +
arch/arm/boot/dts/qcom/qcom-sdx65.dtsi | 1 +
arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 +
arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 +++--
drivers/pci/controller/dwc/pcie-qcom-ep.c | 21 +++++++--
drivers/pci/controller/dwc/pcie-qcom.c | 55 +++++++++++++++++++++-
drivers/pci/endpoint/pci-epc-core.c | 10 ++++
include/linux/pci-epc.h | 2 +
12 files changed, 116 insertions(+), 17 deletions(-)
---
base-commit: 91e3b24eb7d297d9d99030800ed96944b8652eaf
change-id: 20240715-pci-qcom-hotplug-bcde1c13d91f
Best regards,
--
Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v2 01/13] PCI: qcom-ep: Drop the redundant masking of global IRQ events
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 02/13] PCI: qcom-ep: Reword the error message for receiving unknown global IRQ event Manivannan Sadhasivam via B4 Relay
` (11 subsequent siblings)
12 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Once the events are disabled in PARF_INT_ALL_MASK register, only the
enabled events will generate global IRQ. So there is no need to do the
masking again in the IRQ handler, drop it.
If there are any spurious IRQs getting generated, they will be reported
using the existing dev_err() in the handler.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/controller/dwc/pcie-qcom-ep.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index 236229f66c80..972a90eba494 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -647,11 +647,9 @@ static irqreturn_t qcom_pcie_ep_global_irq_thread(int irq, void *data)
struct dw_pcie *pci = &pcie_ep->pci;
struct device *dev = pci->dev;
u32 status = readl_relaxed(pcie_ep->parf + PARF_INT_ALL_STATUS);
- u32 mask = readl_relaxed(pcie_ep->parf + PARF_INT_ALL_MASK);
u32 dstate, val;
writel_relaxed(status, pcie_ep->parf + PARF_INT_ALL_CLEAR);
- status &= mask;
if (FIELD_GET(PARF_INT_ALL_LINK_DOWN, status)) {
dev_dbg(dev, "Received Linkdown event\n");
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 02/13] PCI: qcom-ep: Reword the error message for receiving unknown global IRQ event
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 01/13] PCI: qcom-ep: Drop the redundant masking of global IRQ events Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 03/13] dt-bindings: PCI: pci-ep: Update Maintainers Manivannan Sadhasivam via B4 Relay
` (10 subsequent siblings)
12 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Current error message just prints the contents of PARF_INT_ALL_STATUS
register as if like the IRQ event number. It could mislead the users.
Reword it to make it clear that the error message is actually showing the
interrupt status register to help debug spurious IRQ events.
While at it, let's also switch over to dev_WARN_ONCE() so that any IRQ
storm won't flood the kernel log buffer.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/controller/dwc/pcie-qcom-ep.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index 972a90eba494..0bb0a056dd8f 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -679,7 +679,8 @@ static irqreturn_t qcom_pcie_ep_global_irq_thread(int irq, void *data)
dw_pcie_ep_linkup(&pci->ep);
pcie_ep->link_status = QCOM_PCIE_EP_LINK_UP;
} else {
- dev_err(dev, "Received unknown event: %d\n", status);
+ dev_WARN_ONCE(dev, 1, "Received unknown event. INT_STATUS: 0x%08x\n",
+ status);
}
return IRQ_HANDLED;
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 03/13] dt-bindings: PCI: pci-ep: Update Maintainers
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 01/13] PCI: qcom-ep: Drop the redundant masking of global IRQ events Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 02/13] PCI: qcom-ep: Reword the error message for receiving unknown global IRQ event Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-23 2:32 ` Rob Herring (Arm)
2024-07-17 17:03 ` [PATCH v2 04/13] dt-bindings: PCI: pci-ep: Document 'linux,pci-domain' property Manivannan Sadhasivam via B4 Relay
` (9 subsequent siblings)
12 siblings, 1 reply; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Kishon's TI email ID is not active anymore, so use his korg ID. Also, since
I've been maintaining the PCI endpoint framework, I'm willing to maintain
the DT binding as well. So add myself as the Co-maintainer.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
Documentation/devicetree/bindings/pci/pci-ep.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/pci/pci-ep.yaml b/Documentation/devicetree/bindings/pci/pci-ep.yaml
index d1eef4825207..0b5456ee21eb 100644
--- a/Documentation/devicetree/bindings/pci/pci-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/pci-ep.yaml
@@ -10,7 +10,8 @@ description: |
Common properties for PCI Endpoint Controller Nodes.
maintainers:
- - Kishon Vijay Abraham I <kishon@ti.com>
+ - Kishon Vijay Abraham I <kishon@kernel.org>
+ - Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
properties:
$nodename:
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 04/13] dt-bindings: PCI: pci-ep: Document 'linux,pci-domain' property
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (2 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 03/13] dt-bindings: PCI: pci-ep: Update Maintainers Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-23 2:33 ` Rob Herring (Arm)
2024-07-17 17:03 ` [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers Manivannan Sadhasivam via B4 Relay
` (8 subsequent siblings)
12 siblings, 1 reply; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
'linux,pci-domain' property provides the PCI domain number for the PCI
endpoint controllers in a SoC. If this property is not present, then an
unstable (across boots) unique number will be assigned.
Devicetrees can specify the domain number based on the actual hardware
instance of the PCI endpoint controllers in the SoC.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
Documentation/devicetree/bindings/pci/pci-ep.yaml | 11 +++++++++++
Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml | 1 +
2 files changed, 12 insertions(+)
diff --git a/Documentation/devicetree/bindings/pci/pci-ep.yaml b/Documentation/devicetree/bindings/pci/pci-ep.yaml
index 0b5456ee21eb..f75000e3093d 100644
--- a/Documentation/devicetree/bindings/pci/pci-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/pci-ep.yaml
@@ -42,6 +42,17 @@ properties:
default: 1
maximum: 16
+ linux,pci-domain:
+ description:
+ If present this property assigns a fixed PCI domain number to a PCI
+ Endpoint Controller, otherwise an unstable (across boots) unique number
+ will be assigned. It is required to either not set this property at all
+ or set it for all PCI endpoint controllers in the system, otherwise
+ potentially conflicting domain numbers may be assigned to endpoint
+ controllers. The domain number for each endpoint controller in the system
+ must be unique.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
required:
- compatible
diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml
index 46802f7d9482..1226ee5d08d1 100644
--- a/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml
+++ b/Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml
@@ -280,4 +280,5 @@ examples:
phy-names = "pciephy";
max-link-speed = <3>;
num-lanes = <2>;
+ linux,pci-domain = <0>;
};
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (3 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 04/13] dt-bindings: PCI: pci-ep: Document 'linux,pci-domain' property Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-18 12:11 ` Konrad Dybcio
` (2 more replies)
2024-07-17 17:03 ` [PATCH v2 06/13] PCI: qcom-ep: Modify 'global_irq' and 'perst_irq' IRQ device names Manivannan Sadhasivam via B4 Relay
` (7 subsequent siblings)
12 siblings, 3 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Right now, PCI endpoint subsystem doesn't assign PCI domain number for the
PCI endpoint controllers. But this domain number could be useful to the EPC
drivers to uniquely identify each controller based on the hardware instance
when there are multiple ones present in an SoC (even multiple RC/EP).
So let's make use of the existing pci_bus_find_domain_nr() API to allocate
domain numbers based on either Devicetree (linux,pci-domain) property or
dynamic domain number allocation scheme.
It should be noted that the domain number allocated by this API will be
based on both RC and EP controllers in a SoC. If the 'linux,pci-domain' DT
property is present, then the domain number represents the actual hardware
instance of the PCI endpoint controller. If not, then the domain number
will be allocated based on the PCI EP/RC controller probe order.
If the architecture doesn't support CONFIG_PCI_DOMAINS_GENERIC (rare), then
currently a warning is thrown to indicate that the architecture specific
implementation is needed.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/endpoint/pci-epc-core.c | 10 ++++++++++
include/linux/pci-epc.h | 2 ++
2 files changed, 12 insertions(+)
diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
index 84309dfe0c68..7fa81b91e762 100644
--- a/drivers/pci/endpoint/pci-epc-core.c
+++ b/drivers/pci/endpoint/pci-epc-core.c
@@ -838,6 +838,9 @@ void pci_epc_destroy(struct pci_epc *epc)
{
pci_ep_cfs_remove_epc_group(epc->group);
device_unregister(&epc->dev);
+
+ if (IS_ENABLED(CONFIG_PCI_DOMAINS_GENERIC))
+ pci_bus_release_domain_nr(NULL, &epc->dev);
}
EXPORT_SYMBOL_GPL(pci_epc_destroy);
@@ -900,6 +903,13 @@ __pci_epc_create(struct device *dev, const struct pci_epc_ops *ops,
epc->dev.release = pci_epc_release;
epc->ops = ops;
+ /*
+ * TODO: If the architecture doesn't support generic PCI domains, then
+ * a custom implementation has to be used.
+ */
+ if (!WARN_ON_ONCE(!IS_ENABLED(CONFIG_PCI_DOMAINS_GENERIC)))
+ epc->domain_nr = pci_bus_find_domain_nr(NULL, dev);
+
ret = dev_set_name(&epc->dev, "%s", dev_name(dev));
if (ret)
goto put_dev;
diff --git a/include/linux/pci-epc.h b/include/linux/pci-epc.h
index 85bdf2adb760..8e3dcac55dcd 100644
--- a/include/linux/pci-epc.h
+++ b/include/linux/pci-epc.h
@@ -128,6 +128,7 @@ struct pci_epc_mem {
* @group: configfs group representing the PCI EPC device
* @lock: mutex to protect pci_epc ops
* @function_num_map: bitmap to manage physical function number
+ * @domain_nr: PCI domain number of the endpoint controller
* @init_complete: flag to indicate whether the EPC initialization is complete
* or not
*/
@@ -145,6 +146,7 @@ struct pci_epc {
/* mutex to protect against concurrent access of EP controller */
struct mutex lock;
unsigned long function_num_map;
+ int domain_nr;
bool init_complete;
};
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 06/13] PCI: qcom-ep: Modify 'global_irq' and 'perst_irq' IRQ device names
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (4 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-18 12:12 ` Konrad Dybcio
2024-07-17 17:03 ` [PATCH v2 07/13] ARM: dts: qcom: sdx55: Add 'linux,pci-domain' to PCIe EP controller node Manivannan Sadhasivam via B4 Relay
` (6 subsequent siblings)
12 siblings, 1 reply; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Currently, the IRQ device name for both of these IRQs doesn't have Qcom
specific prefix and PCIe domain number. This causes 2 issues:
1. Pollutes the global IRQ namespace since 'global' is a common name.
2. When more than one EP controller instance is present in the SoC, naming
conflict will occur.
Hence, add 'qcom_pcie_ep_' prefix and PCIe domain number suffix to the IRQ
names to uniquely identify the IRQs and also to fix the above mentioned
issues.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/controller/dwc/pcie-qcom-ep.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c
index 0bb0a056dd8f..d0a27fa6fdc8 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -711,8 +711,15 @@ static irqreturn_t qcom_pcie_ep_perst_irq_thread(int irq, void *data)
static int qcom_pcie_ep_enable_irq_resources(struct platform_device *pdev,
struct qcom_pcie_ep *pcie_ep)
{
+ struct device *dev = pcie_ep->pci.dev;
+ char *name;
int ret;
+ name = devm_kasprintf(dev, GFP_KERNEL, "qcom_pcie_ep_global_irq%d",
+ pcie_ep->pci.ep.epc->domain_nr);
+ if (!name)
+ return -ENOMEM;
+
pcie_ep->global_irq = platform_get_irq_byname(pdev, "global");
if (pcie_ep->global_irq < 0)
return pcie_ep->global_irq;
@@ -720,18 +727,23 @@ static int qcom_pcie_ep_enable_irq_resources(struct platform_device *pdev,
ret = devm_request_threaded_irq(&pdev->dev, pcie_ep->global_irq, NULL,
qcom_pcie_ep_global_irq_thread,
IRQF_ONESHOT,
- "global_irq", pcie_ep);
+ name, pcie_ep);
if (ret) {
dev_err(&pdev->dev, "Failed to request Global IRQ\n");
return ret;
}
+ name = devm_kasprintf(dev, GFP_KERNEL, "qcom_pcie_ep_perst_irq%d",
+ pcie_ep->pci.ep.epc->domain_nr);
+ if (!name)
+ return -ENOMEM;
+
pcie_ep->perst_irq = gpiod_to_irq(pcie_ep->reset);
irq_set_status_flags(pcie_ep->perst_irq, IRQ_NOAUTOEN);
ret = devm_request_threaded_irq(&pdev->dev, pcie_ep->perst_irq, NULL,
qcom_pcie_ep_perst_irq_thread,
IRQF_TRIGGER_HIGH | IRQF_ONESHOT,
- "perst_irq", pcie_ep);
+ name, pcie_ep);
if (ret) {
dev_err(&pdev->dev, "Failed to request PERST IRQ\n");
disable_irq(pcie_ep->global_irq);
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 07/13] ARM: dts: qcom: sdx55: Add 'linux,pci-domain' to PCIe EP controller node
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (5 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 06/13] PCI: qcom-ep: Modify 'global_irq' and 'perst_irq' IRQ device names Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 08/13] ARM: dts: qcom: sdx65: " Manivannan Sadhasivam via B4 Relay
` (5 subsequent siblings)
12 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
'linux,pci-domain' property provides the PCI domain number for the PCI
endpoint controllers in a SoC. If this property is not present, then an
unstable (across boots) unique number will be assigned.
Use this property to specify the domain number based on the actual hardware
instance of the PCI endpoint controllers in SDX55 SoC.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
arch/arm/boot/dts/qcom/qcom-sdx55.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-sdx55.dtsi b/arch/arm/boot/dts/qcom/qcom-sdx55.dtsi
index 68fa5859d263..d0f6120b665d 100644
--- a/arch/arm/boot/dts/qcom/qcom-sdx55.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-sdx55.dtsi
@@ -437,6 +437,7 @@ pcie_ep: pcie-ep@1c00000 {
phy-names = "pciephy";
max-link-speed = <3>;
num-lanes = <2>;
+ linux,pci-domain = <0>;
status = "disabled";
};
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 08/13] ARM: dts: qcom: sdx65: Add 'linux,pci-domain' to PCIe EP controller node
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (6 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 07/13] ARM: dts: qcom: sdx55: Add 'linux,pci-domain' to PCIe EP controller node Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 09/13] arm64: dts: qcom: sa8775p: Add 'linux,pci-domain' to PCIe EP controller nodes Manivannan Sadhasivam via B4 Relay
` (4 subsequent siblings)
12 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
'linux,pci-domain' property provides the PCI domain number for the PCI
endpoint controllers in a SoC. If this property is not present, then an
unstable (across boots) unique number will be assigned.
Use this property to specify the domain number based on the actual hardware
instance of the PCI endpoint controllers in SDX65 SoC.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
arch/arm/boot/dts/qcom/qcom-sdx65.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi b/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
index a949454212e9..fcfec4228670 100644
--- a/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
+++ b/arch/arm/boot/dts/qcom/qcom-sdx65.dtsi
@@ -345,6 +345,7 @@ pcie_ep: pcie-ep@1c00000 {
max-link-speed = <3>;
num-lanes = <2>;
+ linux,pci-domain = <0>;
status = "disabled";
};
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 09/13] arm64: dts: qcom: sa8775p: Add 'linux,pci-domain' to PCIe EP controller nodes
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (7 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 08/13] ARM: dts: qcom: sdx65: " Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 10/13] dt-bindings: PCI: qcom: Add 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (3 subsequent siblings)
12 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
'linux,pci-domain' property provides the PCI domain number for the PCI
endpoint controllers in a SoC. If this property is not present, then an
unstable (across boots) unique number will be assigned.
Use this property to specify the domain number based on the actual hardware
instance of the PCI endpoint controllers in SA8775P SoC.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sa8775p.dtsi b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
index 23f1b2e5e624..198b39abde97 100644
--- a/arch/arm64/boot/dts/qcom/sa8775p.dtsi
+++ b/arch/arm64/boot/dts/qcom/sa8775p.dtsi
@@ -4618,6 +4618,7 @@ pcie0_ep: pcie-ep@1c00000 {
phy-names = "pciephy";
max-link-speed = <3>; /* FIXME: Limiting the Gen speed due to stability issues */
num-lanes = <2>;
+ linux,pci-domain = <0>;
status = "disabled";
};
@@ -4775,6 +4776,7 @@ pcie1_ep: pcie-ep@1c10000 {
phy-names = "pciephy";
max-link-speed = <3>; /* FIXME: Limiting the Gen speed due to stability issues */
num-lanes = <4>;
+ linux,pci-domain = <1>;
status = "disabled";
};
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 10/13] dt-bindings: PCI: qcom: Add 'global' interrupt
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (8 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 09/13] arm64: dts: qcom: sa8775p: Add 'linux,pci-domain' to PCIe EP controller nodes Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 11/13] dt-bindings: PCI: qcom,pcie-sm8450: " Manivannan Sadhasivam via B4 Relay
` (2 subsequent siblings)
12 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Qcom PCIe RC controllers are capable of generating 'global' SPI interrupt
to the host CPU. This interrupt can be used by the device driver to
identify events such as PCIe link specific events, safety events, etc...
Hence, document it in the binding along with the existing MSI interrupts.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml
index 0a39bbfcb28b..704c0f58eea5 100644
--- a/Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml
+++ b/Documentation/devicetree/bindings/pci/qcom,pcie-common.yaml
@@ -21,11 +21,11 @@ properties:
interrupts:
minItems: 1
- maxItems: 8
+ maxItems: 9
interrupt-names:
minItems: 1
- maxItems: 8
+ maxItems: 9
iommu-map:
minItems: 1
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 11/13] dt-bindings: PCI: qcom,pcie-sm8450: Add 'global' interrupt
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (9 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 10/13] dt-bindings: PCI: qcom: Add 'global' interrupt Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-23 2:35 ` Rob Herring
2024-07-17 17:03 ` [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using " Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 13/13] arm64: dts: qcom: sm8450: Add 'global' interrupt to the PCIe RC node Manivannan Sadhasivam via B4 Relay
12 siblings, 1 reply; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Qcom PCIe RC controllers are capable of generating 'global' SPI interrupt
to the host CPU. This interrupt can be used by the device driver to
identify events such as PCIe link specific events, safety events, etc...
Hence, document it in the binding along with the existing MSI interrupts.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml
index d8c0afaa4b19..0d68ce073383 100644
--- a/Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml
+++ b/Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml
@@ -55,11 +55,12 @@ properties:
- const: aggre1 # Aggre NoC PCIe1 AXI clock
interrupts:
- minItems: 8
- maxItems: 8
+ minItems: 9
+ maxItems: 9
interrupt-names:
items:
+ - const: global
- const: msi0
- const: msi1
- const: msi2
@@ -142,7 +143,8 @@ examples:
"aggre0",
"aggre1";
- interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>,
@@ -150,7 +152,7 @@ examples:
<GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "msi0", "msi1", "msi2", "msi3",
+ interrupt-names = "global", "msi0", "msi1", "msi2", "msi3",
"msi4", "msi5", "msi6", "msi7";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0x7>;
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (10 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 11/13] dt-bindings: PCI: qcom,pcie-sm8450: " Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
2024-07-17 22:57 ` Mayank Rana
2024-07-19 23:32 ` Frank Li
2024-07-17 17:03 ` [PATCH v2 13/13] arm64: dts: qcom: sm8450: Add 'global' interrupt to the PCIe RC node Manivannan Sadhasivam via B4 Relay
12 siblings, 2 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Historically, Qcom PCIe RC controllers lack standard hotplug support. So
when an endpoint is attached to the SoC, users have to rescan the bus
manually to enumerate the device. But this can be avoided by simulating the
PCIe hotplug using Qcom specific way.
Qcom PCIe RC controllers are capable of generating the 'global' SPI
interrupt to the host CPUs. The device driver can use this event to
identify events such as PCIe link specific events, safety events etc...
One such event is the PCIe Link up event generated when an endpoint is
detected on the bus and the Link is 'up'. This event can be used to
simulate the PCIe hotplug in the Qcom SoCs.
So add support for capturing the PCIe Link up event using the 'global'
interrupt in the driver. Once the Link up event is received, the bus
underneath the host bridge is scanned to enumerate PCIe endpoint devices,
thus simulating hotplug.
All of the Qcom SoCs have only one rootport per controller instance. So
only a single 'Link up' event is generated for the PCIe controller.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
drivers/pci/controller/dwc/pcie-qcom.c | 55 +++++++++++++++++++++++++++++++++-
1 file changed, 54 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 0180edf3310e..a1d678fe7fa5 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -50,6 +50,9 @@
#define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8
#define PARF_Q2A_FLUSH 0x1ac
#define PARF_LTSSM 0x1b0
+#define PARF_INT_ALL_STATUS 0x224
+#define PARF_INT_ALL_CLEAR 0x228
+#define PARF_INT_ALL_MASK 0x22c
#define PARF_SID_OFFSET 0x234
#define PARF_BDF_TRANSLATE_CFG 0x24c
#define PARF_SLV_ADDR_SPACE_SIZE 0x358
@@ -121,6 +124,9 @@
/* PARF_LTSSM register fields */
#define LTSSM_EN BIT(8)
+/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
+#define PARF_INT_ALL_LINK_UP BIT(13)
+
/* PARF_NO_SNOOP_OVERIDE register fields */
#define WR_NO_SNOOP_OVERIDE_EN BIT(1)
#define RD_NO_SNOOP_OVERIDE_EN BIT(3)
@@ -1488,6 +1494,29 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie)
qcom_pcie_link_transition_count);
}
+static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
+{
+ struct qcom_pcie *pcie = data;
+ struct dw_pcie_rp *pp = &pcie->pci->pp;
+ struct device *dev = pcie->pci->dev;
+ u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS);
+
+ writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
+
+ if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
+ dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
+ /* Rescan the bus to enumerate endpoint devices */
+ pci_lock_rescan_remove();
+ pci_rescan_bus(pp->bridge->bus);
+ pci_unlock_rescan_remove();
+ } else {
+ dev_WARN_ONCE(dev, 1, "Received unknown event. INT_STATUS: 0x%08x\n",
+ status);
+ }
+
+ return IRQ_HANDLED;
+}
+
static int qcom_pcie_probe(struct platform_device *pdev)
{
const struct qcom_pcie_cfg *pcie_cfg;
@@ -1498,7 +1527,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
struct dw_pcie_rp *pp;
struct resource *res;
struct dw_pcie *pci;
- int ret;
+ int ret, irq;
+ char *name;
pcie_cfg = of_device_get_match_data(dev);
if (!pcie_cfg || !pcie_cfg->ops) {
@@ -1617,6 +1647,27 @@ static int qcom_pcie_probe(struct platform_device *pdev)
goto err_phy_exit;
}
+ name = devm_kasprintf(dev, GFP_KERNEL, "qcom_pcie_global_irq%d",
+ pci_domain_nr(pp->bridge->bus));
+ if (!name) {
+ ret = -ENOMEM;
+ goto err_host_deinit;
+ }
+
+ irq = platform_get_irq_byname_optional(pdev, "global");
+ if (irq > 0) {
+ ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
+ qcom_pcie_global_irq_thread,
+ IRQF_ONESHOT, name, pcie);
+ if (ret) {
+ dev_err_probe(&pdev->dev, ret,
+ "Failed to request Global IRQ\n");
+ goto err_host_deinit;
+ }
+
+ writel_relaxed(PARF_INT_ALL_LINK_UP, pcie->parf + PARF_INT_ALL_MASK);
+ }
+
qcom_pcie_icc_opp_update(pcie);
if (pcie->mhi)
@@ -1624,6 +1675,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
return 0;
+err_host_deinit:
+ dw_pcie_host_deinit(pp);
err_phy_exit:
phy_exit(pcie->phy);
err_pm_runtime_put:
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 13/13] arm64: dts: qcom: sm8450: Add 'global' interrupt to the PCIe RC node
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
` (11 preceding siblings ...)
2024-07-17 17:03 ` [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using " Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 17:03 ` Manivannan Sadhasivam via B4 Relay
12 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam via B4 Relay @ 2024-07-17 17:03 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Qcom PCIe RC controllers are capable of generating 'global' SPI interrupt
to the host CPUs. This interrupt can be used by the device driver to
identify events such as PCIe link specific events, safety events, etc...
Hence, add it to the PCIe RC node along with the existing MSI interrupts.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
arch/arm64/boot/dts/qcom/sm8450.dtsi | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi
index 9bafb3b350ff..90d16cb83669 100644
--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
@@ -1780,7 +1780,8 @@ pcie0: pcie@1c00000 {
msi-map = <0x0 &gic_its 0x5980 0x1>,
<0x100 &gic_its 0x5981 0x1>;
msi-map-mask = <0xff00>;
- interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>,
@@ -1788,7 +1789,8 @@ pcie0: pcie@1c00000 {
<GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "msi0",
+ interrupt-names = "global",
+ "msi0",
"msi1",
"msi2",
"msi3",
@@ -1942,7 +1944,8 @@ pcie1: pcie@1c08000 {
msi-map = <0x0 &gic_its 0x5a00 0x1>,
<0x100 &gic_its 0x5a01 0x1>;
msi-map-mask = <0xff00>;
- interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>,
+ interrupts = <GIC_SPI 306 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 312 IRQ_TYPE_LEVEL_HIGH>,
@@ -1950,7 +1953,8 @@ pcie1: pcie@1c08000 {
<GIC_SPI 314 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 374 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 375 IRQ_TYPE_LEVEL_HIGH>;
- interrupt-names = "msi0",
+ interrupt-names = "global",
+ "msi0",
"msi1",
"msi2",
"msi3",
--
2.25.1
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
2024-07-17 17:03 ` [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using " Manivannan Sadhasivam via B4 Relay
@ 2024-07-17 22:57 ` Mayank Rana
2024-07-18 10:29 ` Manivannan Sadhasivam
2024-07-19 23:32 ` Frank Li
1 sibling, 1 reply; 29+ messages in thread
From: Mayank Rana @ 2024-07-17 22:57 UTC (permalink / raw)
To: manivannan.sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Kishon Vijay Abraham I,
Bjorn Andersson, Konrad Dybcio
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree
Hi Mani
I don't think we can suggest that usage of link up event with Global IRQ
as simulate PCIe hotplug. hotplug is referring to allow handling of both
add or remove of endpoint device whereas here you are using global IRQ
as last step to rescan bus if endpoint is power up later after link
training is initiated.
Will this work if you remove endpoint device and add it back again ?
Regards,
Mayank
On 7/17/2024 10:03 AM, Manivannan Sadhasivam via B4 Relay wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>
> Historically, Qcom PCIe RC controllers lack standard hotplug support. So
> when an endpoint is attached to the SoC, users have to rescan the bus
> manually to enumerate the device. But this can be avoided by simulating the
> PCIe hotplug using Qcom specific way.
>
> Qcom PCIe RC controllers are capable of generating the 'global' SPI
> interrupt to the host CPUs. The device driver can use this event to
> identify events such as PCIe link specific events, safety events etc...
>
> One such event is the PCIe Link up event generated when an endpoint is
> detected on the bus and the Link is 'up'. This event can be used to
> simulate the PCIe hotplug in the Qcom SoCs.
>
> So add support for capturing the PCIe Link up event using the 'global'
> interrupt in the driver. Once the Link up event is received, the bus
> underneath the host bridge is scanned to enumerate PCIe endpoint devices,
> thus simulating hotplug.
>
> All of the Qcom SoCs have only one rootport per controller instance. So
> only a single 'Link up' event is generated for the PCIe controller.
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 55 +++++++++++++++++++++++++++++++++-
> 1 file changed, 54 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 0180edf3310e..a1d678fe7fa5 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -50,6 +50,9 @@
> #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8
> #define PARF_Q2A_FLUSH 0x1ac
> #define PARF_LTSSM 0x1b0
> +#define PARF_INT_ALL_STATUS 0x224
> +#define PARF_INT_ALL_CLEAR 0x228
> +#define PARF_INT_ALL_MASK 0x22c
> #define PARF_SID_OFFSET 0x234
> #define PARF_BDF_TRANSLATE_CFG 0x24c
> #define PARF_SLV_ADDR_SPACE_SIZE 0x358
> @@ -121,6 +124,9 @@
> /* PARF_LTSSM register fields */
> #define LTSSM_EN BIT(8)
>
> +/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
> +#define PARF_INT_ALL_LINK_UP BIT(13)
> +
> /* PARF_NO_SNOOP_OVERIDE register fields */
> #define WR_NO_SNOOP_OVERIDE_EN BIT(1)
> #define RD_NO_SNOOP_OVERIDE_EN BIT(3)
> @@ -1488,6 +1494,29 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie)
> qcom_pcie_link_transition_count);
> }
>
> +static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
> +{
> + struct qcom_pcie *pcie = data;
> + struct dw_pcie_rp *pp = &pcie->pci->pp;
> + struct device *dev = pcie->pci->dev;
> + u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS);
> +
> + writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
> +
> + if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
> + dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
> + /* Rescan the bus to enumerate endpoint devices */
> + pci_lock_rescan_remove();
> + pci_rescan_bus(pp->bridge->bus);
> + pci_unlock_rescan_remove();
How do you handle case where endpoint is already enumerated, and seeing
link up event in parallel or later ? will it go ahead to rescan bus
again here ?
Also can you consider doing this outside hardirq context ?
> + } else {
> + dev_WARN_ONCE(dev, 1, "Received unknown event. INT_STATUS: 0x%08x\n",
> + status);
> + }
> +
> + return IRQ_HANDLED;
> +}
> +
> static int qcom_pcie_probe(struct platform_device *pdev)
> {
> const struct qcom_pcie_cfg *pcie_cfg;
> @@ -1498,7 +1527,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
> struct dw_pcie_rp *pp;
> struct resource *res;
> struct dw_pcie *pci;
> - int ret;
> + int ret, irq;
> + char *name;
>
> pcie_cfg = of_device_get_match_data(dev);
> if (!pcie_cfg || !pcie_cfg->ops) {
> @@ -1617,6 +1647,27 @@ static int qcom_pcie_probe(struct platform_device *pdev)
> goto err_phy_exit;
> }
>
> + name = devm_kasprintf(dev, GFP_KERNEL, "qcom_pcie_global_irq%d",
> + pci_domain_nr(pp->bridge->bus));
> + if (!name) {
> + ret = -ENOMEM;
> + goto err_host_deinit;
> + }
> +
> + irq = platform_get_irq_byname_optional(pdev, "global");
> + if (irq > 0) {
> + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> + qcom_pcie_global_irq_thread,
> + IRQF_ONESHOT, name, pcie);
> + if (ret) {
> + dev_err_probe(&pdev->dev, ret,
> + "Failed to request Global IRQ\n");
> + goto err_host_deinit;
> + }
> +
> + writel_relaxed(PARF_INT_ALL_LINK_UP, pcie->parf + PARF_INT_ALL_MASK);
> + }
> +
> qcom_pcie_icc_opp_update(pcie);
>
> if (pcie->mhi)
> @@ -1624,6 +1675,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
>
> return 0;
>
> +err_host_deinit:
> + dw_pcie_host_deinit(pp);
> err_phy_exit:
> phy_exit(pcie->phy);
> err_pm_runtime_put:
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
2024-07-17 22:57 ` Mayank Rana
@ 2024-07-18 10:29 ` Manivannan Sadhasivam
2024-07-18 17:15 ` Mayank Rana
0 siblings, 1 reply; 29+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-18 10:29 UTC (permalink / raw)
To: Mayank Rana
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio, linux-pci,
linux-arm-msm, linux-kernel, devicetree
On Wed, Jul 17, 2024 at 03:57:11PM -0700, Mayank Rana wrote:
> Hi Mani
>
> I don't think we can suggest that usage of link up event with Global IRQ as
> simulate PCIe hotplug. hotplug is referring to allow handling of both
> add or remove of endpoint device whereas here you are using global IRQ as
> last step to rescan bus if endpoint is power up later after link training is
> initiated.
>
Why not? Well it is not entirely the standard 'hotplug' and that's why I
referred it as 'simulating hotplug'.
The point of having this feature is to avoid the hassle of rescanning the bus
manually when the devices are connected to this bus post boot.
> Will this work if you remove endpoint device and add it back again ?
>
No, not currently. But we could add that logic using LINK_DOWN event. Though,
when the device comes back again, it will not get enumerated successfully due to
a bug in the link training part (which I plan to address later). But this
issue is irrespective of this hotplug simulation.
> Regards,
> Mayank
> On 7/17/2024 10:03 AM, Manivannan Sadhasivam via B4 Relay wrote:
> > From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> >
> > Historically, Qcom PCIe RC controllers lack standard hotplug support. So
> > when an endpoint is attached to the SoC, users have to rescan the bus
> > manually to enumerate the device. But this can be avoided by simulating the
> > PCIe hotplug using Qcom specific way.
> >
> > Qcom PCIe RC controllers are capable of generating the 'global' SPI
> > interrupt to the host CPUs. The device driver can use this event to
> > identify events such as PCIe link specific events, safety events etc...
> >
> > One such event is the PCIe Link up event generated when an endpoint is
> > detected on the bus and the Link is 'up'. This event can be used to
> > simulate the PCIe hotplug in the Qcom SoCs.
> >
> > So add support for capturing the PCIe Link up event using the 'global'
> > interrupt in the driver. Once the Link up event is received, the bus
> > underneath the host bridge is scanned to enumerate PCIe endpoint devices,
> > thus simulating hotplug.
> >
> > All of the Qcom SoCs have only one rootport per controller instance. So
> > only a single 'Link up' event is generated for the PCIe controller.
> >
> > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> > drivers/pci/controller/dwc/pcie-qcom.c | 55 +++++++++++++++++++++++++++++++++-
> > 1 file changed, 54 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> > index 0180edf3310e..a1d678fe7fa5 100644
> > --- a/drivers/pci/controller/dwc/pcie-qcom.c
> > +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> > @@ -50,6 +50,9 @@
> > #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8
> > #define PARF_Q2A_FLUSH 0x1ac
> > #define PARF_LTSSM 0x1b0
> > +#define PARF_INT_ALL_STATUS 0x224
> > +#define PARF_INT_ALL_CLEAR 0x228
> > +#define PARF_INT_ALL_MASK 0x22c
> > #define PARF_SID_OFFSET 0x234
> > #define PARF_BDF_TRANSLATE_CFG 0x24c
> > #define PARF_SLV_ADDR_SPACE_SIZE 0x358
> > @@ -121,6 +124,9 @@
> > /* PARF_LTSSM register fields */
> > #define LTSSM_EN BIT(8)
> > +/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
> > +#define PARF_INT_ALL_LINK_UP BIT(13)
> > +
> > /* PARF_NO_SNOOP_OVERIDE register fields */
> > #define WR_NO_SNOOP_OVERIDE_EN BIT(1)
> > #define RD_NO_SNOOP_OVERIDE_EN BIT(3)
> > @@ -1488,6 +1494,29 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie)
> > qcom_pcie_link_transition_count);
> > }
> > +static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
> > +{
> > + struct qcom_pcie *pcie = data;
> > + struct dw_pcie_rp *pp = &pcie->pci->pp;
> > + struct device *dev = pcie->pci->dev;
> > + u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS);
> > +
> > + writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
> > +
> > + if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
> > + dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
> > + /* Rescan the bus to enumerate endpoint devices */
> > + pci_lock_rescan_remove();
> > + pci_rescan_bus(pp->bridge->bus);
> > + pci_unlock_rescan_remove();
> How do you handle case where endpoint is already enumerated, and seeing link
> up event in parallel or later ? will it go ahead to rescan bus again here ?
>
If the endpoint is already enumerated, there will be no Link up event. Unless
the controller reinitializes the bus (which is the current behavior).
If the endpoint is already powered on during controller probe, then it will be
enumerated during dw_pcie_host_init() and since we register the IRQ handler
afterwards, there will be no Link up in that case.
This feature is only applicable for endpoints that comes up post boot.
> Also can you consider doing this outside hardirq context ?
>
This is already running in threaded irq context (bottom half), wouldn't that
be enough?
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
2024-07-17 17:03 ` [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers Manivannan Sadhasivam via B4 Relay
@ 2024-07-18 12:11 ` Konrad Dybcio
2024-07-18 15:01 ` Manivannan Sadhasivam
2024-07-18 15:04 ` kernel test robot
2024-07-18 15:37 ` kernel test robot
2 siblings, 1 reply; 29+ messages in thread
From: Konrad Dybcio @ 2024-07-18 12:11 UTC (permalink / raw)
To: manivannan.sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Kishon Vijay Abraham I,
Bjorn Andersson
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree
On 17.07.2024 7:03 PM, Manivannan Sadhasivam via B4 Relay wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>
> Right now, PCI endpoint subsystem doesn't assign PCI domain number for the
> PCI endpoint controllers. But this domain number could be useful to the EPC
> drivers to uniquely identify each controller based on the hardware instance
> when there are multiple ones present in an SoC (even multiple RC/EP).
>
> So let's make use of the existing pci_bus_find_domain_nr() API to allocate
> domain numbers based on either Devicetree (linux,pci-domain) property or
> dynamic domain number allocation scheme.
>
> It should be noted that the domain number allocated by this API will be
> based on both RC and EP controllers in a SoC. If the 'linux,pci-domain' DT
> property is present, then the domain number represents the actual hardware
> instance of the PCI endpoint controller. If not, then the domain number
> will be allocated based on the PCI EP/RC controller probe order.
>
> If the architecture doesn't support CONFIG_PCI_DOMAINS_GENERIC (rare), then
> currently a warning is thrown to indicate that the architecture specific
> implementation is needed.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> drivers/pci/endpoint/pci-epc-core.c | 10 ++++++++++
> include/linux/pci-epc.h | 2 ++
> 2 files changed, 12 insertions(+)
>
> diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
> index 84309dfe0c68..7fa81b91e762 100644
> --- a/drivers/pci/endpoint/pci-epc-core.c
> +++ b/drivers/pci/endpoint/pci-epc-core.c
> @@ -838,6 +838,9 @@ void pci_epc_destroy(struct pci_epc *epc)
> {
> pci_ep_cfs_remove_epc_group(epc->group);
> device_unregister(&epc->dev);
> +
> + if (IS_ENABLED(CONFIG_PCI_DOMAINS_GENERIC))
> + pci_bus_release_domain_nr(NULL, &epc->dev);
Shouldn't this be called before device_unregister? pci/remove.c
does that (via pci_remove_bus() in pci_remove_root_bus())
Konrad
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 06/13] PCI: qcom-ep: Modify 'global_irq' and 'perst_irq' IRQ device names
2024-07-17 17:03 ` [PATCH v2 06/13] PCI: qcom-ep: Modify 'global_irq' and 'perst_irq' IRQ device names Manivannan Sadhasivam via B4 Relay
@ 2024-07-18 12:12 ` Konrad Dybcio
0 siblings, 0 replies; 29+ messages in thread
From: Konrad Dybcio @ 2024-07-18 12:12 UTC (permalink / raw)
To: manivannan.sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Kishon Vijay Abraham I,
Bjorn Andersson
Cc: linux-pci, linux-arm-msm, linux-kernel, devicetree
On 17.07.2024 7:03 PM, Manivannan Sadhasivam via B4 Relay wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>
> Currently, the IRQ device name for both of these IRQs doesn't have Qcom
> specific prefix and PCIe domain number. This causes 2 issues:
>
> 1. Pollutes the global IRQ namespace since 'global' is a common name.
> 2. When more than one EP controller instance is present in the SoC, naming
> conflict will occur.
>
> Hence, add 'qcom_pcie_ep_' prefix and PCIe domain number suffix to the IRQ
> names to uniquely identify the IRQs and also to fix the above mentioned
> issues.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
lgtm
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
2024-07-18 12:11 ` Konrad Dybcio
@ 2024-07-18 15:01 ` Manivannan Sadhasivam
0 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-18 15:01 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, linux-pci, linux-arm-msm,
linux-kernel, devicetree
On Thu, Jul 18, 2024 at 02:11:00PM +0200, Konrad Dybcio wrote:
> On 17.07.2024 7:03 PM, Manivannan Sadhasivam via B4 Relay wrote:
> > From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> >
> > Right now, PCI endpoint subsystem doesn't assign PCI domain number for the
> > PCI endpoint controllers. But this domain number could be useful to the EPC
> > drivers to uniquely identify each controller based on the hardware instance
> > when there are multiple ones present in an SoC (even multiple RC/EP).
> >
> > So let's make use of the existing pci_bus_find_domain_nr() API to allocate
> > domain numbers based on either Devicetree (linux,pci-domain) property or
> > dynamic domain number allocation scheme.
> >
> > It should be noted that the domain number allocated by this API will be
> > based on both RC and EP controllers in a SoC. If the 'linux,pci-domain' DT
> > property is present, then the domain number represents the actual hardware
> > instance of the PCI endpoint controller. If not, then the domain number
> > will be allocated based on the PCI EP/RC controller probe order.
> >
> > If the architecture doesn't support CONFIG_PCI_DOMAINS_GENERIC (rare), then
> > currently a warning is thrown to indicate that the architecture specific
> > implementation is needed.
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> > drivers/pci/endpoint/pci-epc-core.c | 10 ++++++++++
> > include/linux/pci-epc.h | 2 ++
> > 2 files changed, 12 insertions(+)
> >
> > diff --git a/drivers/pci/endpoint/pci-epc-core.c b/drivers/pci/endpoint/pci-epc-core.c
> > index 84309dfe0c68..7fa81b91e762 100644
> > --- a/drivers/pci/endpoint/pci-epc-core.c
> > +++ b/drivers/pci/endpoint/pci-epc-core.c
> > @@ -838,6 +838,9 @@ void pci_epc_destroy(struct pci_epc *epc)
> > {
> > pci_ep_cfs_remove_epc_group(epc->group);
> > device_unregister(&epc->dev);
> > +
> > + if (IS_ENABLED(CONFIG_PCI_DOMAINS_GENERIC))
> > + pci_bus_release_domain_nr(NULL, &epc->dev);
>
> Shouldn't this be called before device_unregister? pci/remove.c
> does that (via pci_remove_bus() in pci_remove_root_bus())
>
No, the release should follow the allocation order in __pci_epc_create. As per
that, pci_bus_release_domain_nr() should come last.
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
2024-07-17 17:03 ` [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers Manivannan Sadhasivam via B4 Relay
2024-07-18 12:11 ` Konrad Dybcio
@ 2024-07-18 15:04 ` kernel test robot
2024-07-18 15:32 ` Manivannan Sadhasivam
2024-07-18 15:37 ` kernel test robot
2 siblings, 1 reply; 29+ messages in thread
From: kernel test robot @ 2024-07-18 15:04 UTC (permalink / raw)
To: Manivannan Sadhasivam via B4 Relay, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Kishon Vijay Abraham I,
Bjorn Andersson, Konrad Dybcio
Cc: llvm, oe-kbuild-all, linux-pci, linux-arm-msm, linux-kernel,
devicetree, Manivannan Sadhasivam
Hi Manivannan,
kernel test robot noticed the following build errors:
[auto build test ERROR on 91e3b24eb7d297d9d99030800ed96944b8652eaf]
url: https://github.com/intel-lab-lkp/linux/commits/Manivannan-Sadhasivam-via-B4-Relay/PCI-qcom-ep-Drop-the-redundant-masking-of-global-IRQ-events/20240718-010848
base: 91e3b24eb7d297d9d99030800ed96944b8652eaf
patch link: https://lore.kernel.org/r/20240717-pci-qcom-hotplug-v2-5-71d304b817f8%40linaro.org
patch subject: [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
config: i386-buildonly-randconfig-004-20240718 (https://download.01.org/0day-ci/archive/20240718/202407182239.m0d1pKRB-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240718/202407182239.m0d1pKRB-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407182239.m0d1pKRB-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/pci/endpoint/pci-epc-core.c:843:3: error: call to undeclared function 'pci_bus_release_domain_nr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
843 | pci_bus_release_domain_nr(NULL, &epc->dev);
| ^
drivers/pci/endpoint/pci-epc-core.c:843:3: note: did you mean 'pci_bus_release_busn_res'?
include/linux/pci.h:1142:6: note: 'pci_bus_release_busn_res' declared here
1142 | void pci_bus_release_busn_res(struct pci_bus *b);
| ^
drivers/pci/endpoint/pci-epc-core.c:911:20: error: call to undeclared function 'pci_bus_find_domain_nr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
911 | epc->domain_nr = pci_bus_find_domain_nr(NULL, dev);
| ^
2 errors generated.
vim +/pci_bus_release_domain_nr +843 drivers/pci/endpoint/pci-epc-core.c
830
831 /**
832 * pci_epc_destroy() - destroy the EPC device
833 * @epc: the EPC device that has to be destroyed
834 *
835 * Invoke to destroy the PCI EPC device
836 */
837 void pci_epc_destroy(struct pci_epc *epc)
838 {
839 pci_ep_cfs_remove_epc_group(epc->group);
840 device_unregister(&epc->dev);
841
842 if (IS_ENABLED(CONFIG_PCI_DOMAINS_GENERIC))
> 843 pci_bus_release_domain_nr(NULL, &epc->dev);
844 }
845 EXPORT_SYMBOL_GPL(pci_epc_destroy);
846
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
2024-07-18 15:04 ` kernel test robot
@ 2024-07-18 15:32 ` Manivannan Sadhasivam
0 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-18 15:32 UTC (permalink / raw)
To: kernel test robot
Cc: Manivannan Sadhasivam via B4 Relay, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Kishon Vijay Abraham I,
Bjorn Andersson, Konrad Dybcio, llvm, oe-kbuild-all, linux-pci,
linux-arm-msm, linux-kernel, devicetree
On Thu, Jul 18, 2024 at 11:04:04PM +0800, kernel test robot wrote:
> Hi Manivannan,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on 91e3b24eb7d297d9d99030800ed96944b8652eaf]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Manivannan-Sadhasivam-via-B4-Relay/PCI-qcom-ep-Drop-the-redundant-masking-of-global-IRQ-events/20240718-010848
> base: 91e3b24eb7d297d9d99030800ed96944b8652eaf
> patch link: https://lore.kernel.org/r/20240717-pci-qcom-hotplug-v2-5-71d304b817f8%40linaro.org
> patch subject: [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
> config: i386-buildonly-randconfig-004-20240718 (https://download.01.org/0day-ci/archive/20240718/202407182239.m0d1pKRB-lkp@intel.com/config)
> compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240718/202407182239.m0d1pKRB-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202407182239.m0d1pKRB-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> >> drivers/pci/endpoint/pci-epc-core.c:843:3: error: call to undeclared function 'pci_bus_release_domain_nr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> 843 | pci_bus_release_domain_nr(NULL, &epc->dev);
> | ^
Hmm, should've used #ifdef as compiler can still access the statements under
'if(IS_ENABLED())' condition.
- Mani
> drivers/pci/endpoint/pci-epc-core.c:843:3: note: did you mean 'pci_bus_release_busn_res'?
> include/linux/pci.h:1142:6: note: 'pci_bus_release_busn_res' declared here
> 1142 | void pci_bus_release_busn_res(struct pci_bus *b);
> | ^
> drivers/pci/endpoint/pci-epc-core.c:911:20: error: call to undeclared function 'pci_bus_find_domain_nr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> 911 | epc->domain_nr = pci_bus_find_domain_nr(NULL, dev);
> | ^
> 2 errors generated.
>
>
> vim +/pci_bus_release_domain_nr +843 drivers/pci/endpoint/pci-epc-core.c
>
> 830
> 831 /**
> 832 * pci_epc_destroy() - destroy the EPC device
> 833 * @epc: the EPC device that has to be destroyed
> 834 *
> 835 * Invoke to destroy the PCI EPC device
> 836 */
> 837 void pci_epc_destroy(struct pci_epc *epc)
> 838 {
> 839 pci_ep_cfs_remove_epc_group(epc->group);
> 840 device_unregister(&epc->dev);
> 841
> 842 if (IS_ENABLED(CONFIG_PCI_DOMAINS_GENERIC))
> > 843 pci_bus_release_domain_nr(NULL, &epc->dev);
> 844 }
> 845 EXPORT_SYMBOL_GPL(pci_epc_destroy);
> 846
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
2024-07-17 17:03 ` [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers Manivannan Sadhasivam via B4 Relay
2024-07-18 12:11 ` Konrad Dybcio
2024-07-18 15:04 ` kernel test robot
@ 2024-07-18 15:37 ` kernel test robot
2 siblings, 0 replies; 29+ messages in thread
From: kernel test robot @ 2024-07-18 15:37 UTC (permalink / raw)
To: Manivannan Sadhasivam via B4 Relay, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Kishon Vijay Abraham I,
Bjorn Andersson, Konrad Dybcio
Cc: oe-kbuild-all, linux-pci, linux-arm-msm, linux-kernel, devicetree,
Manivannan Sadhasivam
Hi Manivannan,
kernel test robot noticed the following build errors:
[auto build test ERROR on 91e3b24eb7d297d9d99030800ed96944b8652eaf]
url: https://github.com/intel-lab-lkp/linux/commits/Manivannan-Sadhasivam-via-B4-Relay/PCI-qcom-ep-Drop-the-redundant-masking-of-global-IRQ-events/20240718-010848
base: 91e3b24eb7d297d9d99030800ed96944b8652eaf
patch link: https://lore.kernel.org/r/20240717-pci-qcom-hotplug-v2-5-71d304b817f8%40linaro.org
patch subject: [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers
config: i386-randconfig-002-20240718 (https://download.01.org/0day-ci/archive/20240718/202407182326.ZHNfCp4Z-lkp@intel.com/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240718/202407182326.ZHNfCp4Z-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202407182326.ZHNfCp4Z-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/pci/endpoint/pci-epc-core.c: In function 'pci_epc_destroy':
>> drivers/pci/endpoint/pci-epc-core.c:843:17: error: implicit declaration of function 'pci_bus_release_domain_nr'; did you mean 'pci_bus_release_busn_res'? [-Werror=implicit-function-declaration]
843 | pci_bus_release_domain_nr(NULL, &epc->dev);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| pci_bus_release_busn_res
drivers/pci/endpoint/pci-epc-core.c: In function '__pci_epc_create':
drivers/pci/endpoint/pci-epc-core.c:911:34: error: implicit declaration of function 'pci_bus_find_domain_nr' [-Werror=implicit-function-declaration]
911 | epc->domain_nr = pci_bus_find_domain_nr(NULL, dev);
| ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +843 drivers/pci/endpoint/pci-epc-core.c
830
831 /**
832 * pci_epc_destroy() - destroy the EPC device
833 * @epc: the EPC device that has to be destroyed
834 *
835 * Invoke to destroy the PCI EPC device
836 */
837 void pci_epc_destroy(struct pci_epc *epc)
838 {
839 pci_ep_cfs_remove_epc_group(epc->group);
840 device_unregister(&epc->dev);
841
842 if (IS_ENABLED(CONFIG_PCI_DOMAINS_GENERIC))
> 843 pci_bus_release_domain_nr(NULL, &epc->dev);
844 }
845 EXPORT_SYMBOL_GPL(pci_epc_destroy);
846
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
2024-07-18 10:29 ` Manivannan Sadhasivam
@ 2024-07-18 17:15 ` Mayank Rana
2024-07-18 17:23 ` Manivannan Sadhasivam
0 siblings, 1 reply; 29+ messages in thread
From: Mayank Rana @ 2024-07-18 17:15 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio, linux-pci,
linux-arm-msm, linux-kernel, devicetree
Hi Mani
On 7/18/2024 3:29 AM, Manivannan Sadhasivam wrote:
> On Wed, Jul 17, 2024 at 03:57:11PM -0700, Mayank Rana wrote:
>> Hi Mani
>>
>> I don't think we can suggest that usage of link up event with Global IRQ as
>> simulate PCIe hotplug. hotplug is referring to allow handling of both
>> add or remove of endpoint device whereas here you are using global IRQ as
>> last step to rescan bus if endpoint is power up later after link training is
>> initiated.
>>
>
> Why not? Well it is not entirely the standard 'hotplug' and that's why I
> referred it as 'simulating hotplug'.
Because it is misleading here by saying simulate hotplug. You can
mention as use link up event
to rescan bus instead of using simulate PCIe hotplug here.
> The point of having this feature is to avoid the hassle of rescanning the bus
> manually when the devices are connected to this bus post boot.
>
>> Will this work if you remove endpoint device and add it back again ?
>>
>
> No, not currently. But we could add that logic using LINK_DOWN event. Though,
> when the device comes back again, it will not get enumerated successfully due to
> a bug in the link training part (which I plan to address later). But this
> issue is irrespective of this hotplug simulation.
ok. Although LINK DOWN event not necessary suggests that endpoint has been
removed but it also suggests that link has gone into bad state, and it
is being detected and notified as link down event.
>> Regards,
>> Mayank
>> On 7/17/2024 10:03 AM, Manivannan Sadhasivam via B4 Relay wrote:
>>> From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>>>
>>> Historically, Qcom PCIe RC controllers lack standard hotplug support. So
>>> when an endpoint is attached to the SoC, users have to rescan the bus
>>> manually to enumerate the device. But this can be avoided by simulating the
>>> PCIe hotplug using Qcom specific way.
>>>
>>> Qcom PCIe RC controllers are capable of generating the 'global' SPI
>>> interrupt to the host CPUs. The device driver can use this event to
>>> identify events such as PCIe link specific events, safety events etc...
>>>
>>> One such event is the PCIe Link up event generated when an endpoint is
>>> detected on the bus and the Link is 'up'. This event can be used to
>>> simulate the PCIe hotplug in the Qcom SoCs.
>>>
>>> So add support for capturing the PCIe Link up event using the 'global'
>>> interrupt in the driver. Once the Link up event is received, the bus
>>> underneath the host bridge is scanned to enumerate PCIe endpoint devices,
>>> thus simulating hotplug.
>>>
>>> All of the Qcom SoCs have only one rootport per controller instance. So
>>> only a single 'Link up' event is generated for the PCIe controller.
>>>
>>> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>>> ---
>>> drivers/pci/controller/dwc/pcie-qcom.c | 55 +++++++++++++++++++++++++++++++++-
>>> 1 file changed, 54 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
>>> index 0180edf3310e..a1d678fe7fa5 100644
>>> --- a/drivers/pci/controller/dwc/pcie-qcom.c
>>> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
>>> @@ -50,6 +50,9 @@
>>> #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8
>>> #define PARF_Q2A_FLUSH 0x1ac
>>> #define PARF_LTSSM 0x1b0
>>> +#define PARF_INT_ALL_STATUS 0x224
>>> +#define PARF_INT_ALL_CLEAR 0x228
>>> +#define PARF_INT_ALL_MASK 0x22c
>>> #define PARF_SID_OFFSET 0x234
>>> #define PARF_BDF_TRANSLATE_CFG 0x24c
>>> #define PARF_SLV_ADDR_SPACE_SIZE 0x358
>>> @@ -121,6 +124,9 @@
>>> /* PARF_LTSSM register fields */
>>> #define LTSSM_EN BIT(8)
>>> +/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
>>> +#define PARF_INT_ALL_LINK_UP BIT(13)
>>> +
>>> /* PARF_NO_SNOOP_OVERIDE register fields */
>>> #define WR_NO_SNOOP_OVERIDE_EN BIT(1)
>>> #define RD_NO_SNOOP_OVERIDE_EN BIT(3)
>>> @@ -1488,6 +1494,29 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie)
>>> qcom_pcie_link_transition_count);
>>> }
>>> +static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
>>> +{
>>> + struct qcom_pcie *pcie = data;
>>> + struct dw_pcie_rp *pp = &pcie->pci->pp;
>>> + struct device *dev = pcie->pci->dev;
>>> + u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS);
>>> +
>>> + writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
>>> +
>>> + if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
>>> + dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
>>> + /* Rescan the bus to enumerate endpoint devices */
>>> + pci_lock_rescan_remove();
>>> + pci_rescan_bus(pp->bridge->bus);
>>> + pci_unlock_rescan_remove();
>> How do you handle case where endpoint is already enumerated, and seeing link
>> up event in parallel or later ? will it go ahead to rescan bus again here ?
>>
>
> If the endpoint is already enumerated, there will be no Link up event. Unless
> the controller reinitializes the bus (which is the current behavior).
>
> If the endpoint is already powered on during controller probe, then it will be
> enumerated during dw_pcie_host_init() and since we register the IRQ handler
> afterwards, there will be no Link up in that case.
>
> This feature is only applicable for endpoints that comes up post boot.
ok. thanks for above information. I feel capturing this information in
commit text
would be helpful.
>> Also can you consider doing this outside hardirq context ?
>>
>
> This is already running in threaded irq context (bottom half), wouldn't that
> be enough?
Done.
> - Mani
>
Regards,
Mayank
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
2024-07-18 17:15 ` Mayank Rana
@ 2024-07-18 17:23 ` Manivannan Sadhasivam
0 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-18 17:23 UTC (permalink / raw)
To: Mayank Rana
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio, linux-pci,
linux-arm-msm, linux-kernel, devicetree
On Thu, Jul 18, 2024 at 10:15:58AM -0700, Mayank Rana wrote:
> Hi Mani
>
> On 7/18/2024 3:29 AM, Manivannan Sadhasivam wrote:
> > On Wed, Jul 17, 2024 at 03:57:11PM -0700, Mayank Rana wrote:
> > > Hi Mani
> > >
> > > I don't think we can suggest that usage of link up event with Global IRQ as
> > > simulate PCIe hotplug. hotplug is referring to allow handling of both
> > > add or remove of endpoint device whereas here you are using global IRQ as
> > > last step to rescan bus if endpoint is power up later after link training is
> > > initiated.
> > >
> >
> > Why not? Well it is not entirely the standard 'hotplug' and that's why I
> > referred it as 'simulating hotplug'.
> Because it is misleading here by saying simulate hotplug. You can mention as
> use link up event
> to rescan bus instead of using simulate PCIe hotplug here.
>
Fair point. Will reword in v3.
> > The point of having this feature is to avoid the hassle of rescanning the bus
> > manually when the devices are connected to this bus post boot.
> >
> > > Will this work if you remove endpoint device and add it back again ?
> > >
> >
> > No, not currently. But we could add that logic using LINK_DOWN event. Though,
> > when the device comes back again, it will not get enumerated successfully due to
> > a bug in the link training part (which I plan to address later). But this
> > issue is irrespective of this hotplug simulation.
> ok. Although LINK DOWN event not necessary suggests that endpoint has been
> removed but it also suggests that link has gone into bad state, and it is
> being detected and notified as link down event.
Right, but what would be the recovery process if Link down event happens? You'd
remove the device and insert it back, right?
Doing link training again won't bring the link back I guess.
> > > Regards,
> > > Mayank
> > > On 7/17/2024 10:03 AM, Manivannan Sadhasivam via B4 Relay wrote:
> > > > From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > > >
> > > > Historically, Qcom PCIe RC controllers lack standard hotplug support. So
> > > > when an endpoint is attached to the SoC, users have to rescan the bus
> > > > manually to enumerate the device. But this can be avoided by simulating the
> > > > PCIe hotplug using Qcom specific way.
> > > >
> > > > Qcom PCIe RC controllers are capable of generating the 'global' SPI
> > > > interrupt to the host CPUs. The device driver can use this event to
> > > > identify events such as PCIe link specific events, safety events etc...
> > > >
> > > > One such event is the PCIe Link up event generated when an endpoint is
> > > > detected on the bus and the Link is 'up'. This event can be used to
> > > > simulate the PCIe hotplug in the Qcom SoCs.
> > > >
> > > > So add support for capturing the PCIe Link up event using the 'global'
> > > > interrupt in the driver. Once the Link up event is received, the bus
> > > > underneath the host bridge is scanned to enumerate PCIe endpoint devices,
> > > > thus simulating hotplug.
> > > >
> > > > All of the Qcom SoCs have only one rootport per controller instance. So
> > > > only a single 'Link up' event is generated for the PCIe controller.
> > > >
> > > > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> > > > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > > > ---
> > > > drivers/pci/controller/dwc/pcie-qcom.c | 55 +++++++++++++++++++++++++++++++++-
> > > > 1 file changed, 54 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> > > > index 0180edf3310e..a1d678fe7fa5 100644
> > > > --- a/drivers/pci/controller/dwc/pcie-qcom.c
> > > > +++ b/drivers/pci/controller/dwc/pcie-qcom.c
[...]
> > > > +static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
> > > > +{
> > > > + struct qcom_pcie *pcie = data;
> > > > + struct dw_pcie_rp *pp = &pcie->pci->pp;
> > > > + struct device *dev = pcie->pci->dev;
> > > > + u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS);
> > > > +
> > > > + writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
> > > > +
> > > > + if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
> > > > + dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
> > > > + /* Rescan the bus to enumerate endpoint devices */
> > > > + pci_lock_rescan_remove();
> > > > + pci_rescan_bus(pp->bridge->bus);
> > > > + pci_unlock_rescan_remove();
> > > How do you handle case where endpoint is already enumerated, and seeing link
> > > up event in parallel or later ? will it go ahead to rescan bus again here ?
> > >
> >
> > If the endpoint is already enumerated, there will be no Link up event. Unless
> > the controller reinitializes the bus (which is the current behavior).
> >
> > If the endpoint is already powered on during controller probe, then it will be
> > enumerated during dw_pcie_host_init() and since we register the IRQ handler
> > afterwards, there will be no Link up in that case.
> >
> > This feature is only applicable for endpoints that comes up post boot.
> ok. thanks for above information. I feel capturing this information in
> commit text
> would be helpful.
Sure.
- Mani
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
2024-07-17 17:03 ` [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using " Manivannan Sadhasivam via B4 Relay
2024-07-17 22:57 ` Mayank Rana
@ 2024-07-19 23:32 ` Frank Li
2024-07-21 7:34 ` Manivannan Sadhasivam
1 sibling, 1 reply; 29+ messages in thread
From: Frank Li @ 2024-07-19 23:32 UTC (permalink / raw)
To: manivannan.sadhasivam
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio, linux-pci,
linux-arm-msm, linux-kernel, devicetree
On Wed, Jul 17, 2024 at 10:33:17PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
>
> Historically, Qcom PCIe RC controllers lack standard hotplug support. So
> when an endpoint is attached to the SoC, users have to rescan the bus
> manually to enumerate the device. But this can be avoided by simulating the
> PCIe hotplug using Qcom specific way.
>
> Qcom PCIe RC controllers are capable of generating the 'global' SPI
> interrupt to the host CPUs. The device driver can use this event to
> identify events such as PCIe link specific events, safety events etc...
>
> One such event is the PCIe Link up event generated when an endpoint is
> detected on the bus and the Link is 'up'. This event can be used to
> simulate the PCIe hotplug in the Qcom SoCs.
Does hardware auto send out training pattern when EP boot after RC scan pci
bus? Who trigger start link trainning?
Frank
>
> So add support for capturing the PCIe Link up event using the 'global'
> interrupt in the driver. Once the Link up event is received, the bus
> underneath the host bridge is scanned to enumerate PCIe endpoint devices,
> thus simulating hotplug.
>
> All of the Qcom SoCs have only one rootport per controller instance. So
> only a single 'Link up' event is generated for the PCIe controller.
>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> drivers/pci/controller/dwc/pcie-qcom.c | 55 +++++++++++++++++++++++++++++++++-
> 1 file changed, 54 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> index 0180edf3310e..a1d678fe7fa5 100644
> --- a/drivers/pci/controller/dwc/pcie-qcom.c
> +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> @@ -50,6 +50,9 @@
> #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8
> #define PARF_Q2A_FLUSH 0x1ac
> #define PARF_LTSSM 0x1b0
> +#define PARF_INT_ALL_STATUS 0x224
> +#define PARF_INT_ALL_CLEAR 0x228
> +#define PARF_INT_ALL_MASK 0x22c
> #define PARF_SID_OFFSET 0x234
> #define PARF_BDF_TRANSLATE_CFG 0x24c
> #define PARF_SLV_ADDR_SPACE_SIZE 0x358
> @@ -121,6 +124,9 @@
> /* PARF_LTSSM register fields */
> #define LTSSM_EN BIT(8)
>
> +/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
> +#define PARF_INT_ALL_LINK_UP BIT(13)
> +
> /* PARF_NO_SNOOP_OVERIDE register fields */
> #define WR_NO_SNOOP_OVERIDE_EN BIT(1)
> #define RD_NO_SNOOP_OVERIDE_EN BIT(3)
> @@ -1488,6 +1494,29 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie)
> qcom_pcie_link_transition_count);
> }
>
> +static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
> +{
> + struct qcom_pcie *pcie = data;
> + struct dw_pcie_rp *pp = &pcie->pci->pp;
> + struct device *dev = pcie->pci->dev;
> + u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS);
> +
> + writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
> +
> + if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
> + dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
> + /* Rescan the bus to enumerate endpoint devices */
> + pci_lock_rescan_remove();
> + pci_rescan_bus(pp->bridge->bus);
> + pci_unlock_rescan_remove();
> + } else {
> + dev_WARN_ONCE(dev, 1, "Received unknown event. INT_STATUS: 0x%08x\n",
> + status);
> + }
> +
> + return IRQ_HANDLED;
> +}
> +
> static int qcom_pcie_probe(struct platform_device *pdev)
> {
> const struct qcom_pcie_cfg *pcie_cfg;
> @@ -1498,7 +1527,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
> struct dw_pcie_rp *pp;
> struct resource *res;
> struct dw_pcie *pci;
> - int ret;
> + int ret, irq;
> + char *name;
>
> pcie_cfg = of_device_get_match_data(dev);
> if (!pcie_cfg || !pcie_cfg->ops) {
> @@ -1617,6 +1647,27 @@ static int qcom_pcie_probe(struct platform_device *pdev)
> goto err_phy_exit;
> }
>
> + name = devm_kasprintf(dev, GFP_KERNEL, "qcom_pcie_global_irq%d",
> + pci_domain_nr(pp->bridge->bus));
> + if (!name) {
> + ret = -ENOMEM;
> + goto err_host_deinit;
> + }
> +
> + irq = platform_get_irq_byname_optional(pdev, "global");
> + if (irq > 0) {
> + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> + qcom_pcie_global_irq_thread,
> + IRQF_ONESHOT, name, pcie);
> + if (ret) {
> + dev_err_probe(&pdev->dev, ret,
> + "Failed to request Global IRQ\n");
> + goto err_host_deinit;
> + }
> +
> + writel_relaxed(PARF_INT_ALL_LINK_UP, pcie->parf + PARF_INT_ALL_MASK);
> + }
> +
> qcom_pcie_icc_opp_update(pcie);
>
> if (pcie->mhi)
> @@ -1624,6 +1675,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
>
> return 0;
>
> +err_host_deinit:
> + dw_pcie_host_deinit(pp);
> err_phy_exit:
> phy_exit(pcie->phy);
> err_pm_runtime_put:
>
> --
> 2.25.1
>
>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt
2024-07-19 23:32 ` Frank Li
@ 2024-07-21 7:34 ` Manivannan Sadhasivam
0 siblings, 0 replies; 29+ messages in thread
From: Manivannan Sadhasivam @ 2024-07-21 7:34 UTC (permalink / raw)
To: Frank Li
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Krzysztof Kozlowski, Conor Dooley,
Kishon Vijay Abraham I, Bjorn Andersson, Konrad Dybcio, linux-pci,
linux-arm-msm, linux-kernel, devicetree
On Fri, Jul 19, 2024 at 07:32:23PM -0400, Frank Li wrote:
> On Wed, Jul 17, 2024 at 10:33:17PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> > From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> >
> > Historically, Qcom PCIe RC controllers lack standard hotplug support. So
> > when an endpoint is attached to the SoC, users have to rescan the bus
> > manually to enumerate the device. But this can be avoided by simulating the
> > PCIe hotplug using Qcom specific way.
> >
> > Qcom PCIe RC controllers are capable of generating the 'global' SPI
> > interrupt to the host CPUs. The device driver can use this event to
> > identify events such as PCIe link specific events, safety events etc...
> >
> > One such event is the PCIe Link up event generated when an endpoint is
> > detected on the bus and the Link is 'up'. This event can be used to
> > simulate the PCIe hotplug in the Qcom SoCs.
>
> Does hardware auto send out training pattern when EP boot after RC scan pci
> bus? Who trigger start link trainning?
>
This is taken care by the DWC driver. It starts link training during
dw_pcie_host_init().
- Mani
> Frank
>
> >
> > So add support for capturing the PCIe Link up event using the 'global'
> > interrupt in the driver. Once the Link up event is received, the bus
> > underneath the host bridge is scanned to enumerate PCIe endpoint devices,
> > thus simulating hotplug.
> >
> > All of the Qcom SoCs have only one rootport per controller instance. So
> > only a single 'Link up' event is generated for the PCIe controller.
> >
> > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> > ---
> > drivers/pci/controller/dwc/pcie-qcom.c | 55 +++++++++++++++++++++++++++++++++-
> > 1 file changed, 54 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
> > index 0180edf3310e..a1d678fe7fa5 100644
> > --- a/drivers/pci/controller/dwc/pcie-qcom.c
> > +++ b/drivers/pci/controller/dwc/pcie-qcom.c
> > @@ -50,6 +50,9 @@
> > #define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8
> > #define PARF_Q2A_FLUSH 0x1ac
> > #define PARF_LTSSM 0x1b0
> > +#define PARF_INT_ALL_STATUS 0x224
> > +#define PARF_INT_ALL_CLEAR 0x228
> > +#define PARF_INT_ALL_MASK 0x22c
> > #define PARF_SID_OFFSET 0x234
> > #define PARF_BDF_TRANSLATE_CFG 0x24c
> > #define PARF_SLV_ADDR_SPACE_SIZE 0x358
> > @@ -121,6 +124,9 @@
> > /* PARF_LTSSM register fields */
> > #define LTSSM_EN BIT(8)
> >
> > +/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
> > +#define PARF_INT_ALL_LINK_UP BIT(13)
> > +
> > /* PARF_NO_SNOOP_OVERIDE register fields */
> > #define WR_NO_SNOOP_OVERIDE_EN BIT(1)
> > #define RD_NO_SNOOP_OVERIDE_EN BIT(3)
> > @@ -1488,6 +1494,29 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie)
> > qcom_pcie_link_transition_count);
> > }
> >
> > +static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
> > +{
> > + struct qcom_pcie *pcie = data;
> > + struct dw_pcie_rp *pp = &pcie->pci->pp;
> > + struct device *dev = pcie->pci->dev;
> > + u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS);
> > +
> > + writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
> > +
> > + if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
> > + dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
> > + /* Rescan the bus to enumerate endpoint devices */
> > + pci_lock_rescan_remove();
> > + pci_rescan_bus(pp->bridge->bus);
> > + pci_unlock_rescan_remove();
> > + } else {
> > + dev_WARN_ONCE(dev, 1, "Received unknown event. INT_STATUS: 0x%08x\n",
> > + status);
> > + }
> > +
> > + return IRQ_HANDLED;
> > +}
> > +
> > static int qcom_pcie_probe(struct platform_device *pdev)
> > {
> > const struct qcom_pcie_cfg *pcie_cfg;
> > @@ -1498,7 +1527,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
> > struct dw_pcie_rp *pp;
> > struct resource *res;
> > struct dw_pcie *pci;
> > - int ret;
> > + int ret, irq;
> > + char *name;
> >
> > pcie_cfg = of_device_get_match_data(dev);
> > if (!pcie_cfg || !pcie_cfg->ops) {
> > @@ -1617,6 +1647,27 @@ static int qcom_pcie_probe(struct platform_device *pdev)
> > goto err_phy_exit;
> > }
> >
> > + name = devm_kasprintf(dev, GFP_KERNEL, "qcom_pcie_global_irq%d",
> > + pci_domain_nr(pp->bridge->bus));
> > + if (!name) {
> > + ret = -ENOMEM;
> > + goto err_host_deinit;
> > + }
> > +
> > + irq = platform_get_irq_byname_optional(pdev, "global");
> > + if (irq > 0) {
> > + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> > + qcom_pcie_global_irq_thread,
> > + IRQF_ONESHOT, name, pcie);
> > + if (ret) {
> > + dev_err_probe(&pdev->dev, ret,
> > + "Failed to request Global IRQ\n");
> > + goto err_host_deinit;
> > + }
> > +
> > + writel_relaxed(PARF_INT_ALL_LINK_UP, pcie->parf + PARF_INT_ALL_MASK);
> > + }
> > +
> > qcom_pcie_icc_opp_update(pcie);
> >
> > if (pcie->mhi)
> > @@ -1624,6 +1675,8 @@ static int qcom_pcie_probe(struct platform_device *pdev)
> >
> > return 0;
> >
> > +err_host_deinit:
> > + dw_pcie_host_deinit(pp);
> > err_phy_exit:
> > phy_exit(pcie->phy);
> > err_pm_runtime_put:
> >
> > --
> > 2.25.1
> >
> >
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 03/13] dt-bindings: PCI: pci-ep: Update Maintainers
2024-07-17 17:03 ` [PATCH v2 03/13] dt-bindings: PCI: pci-ep: Update Maintainers Manivannan Sadhasivam via B4 Relay
@ 2024-07-23 2:32 ` Rob Herring (Arm)
0 siblings, 0 replies; 29+ messages in thread
From: Rob Herring (Arm) @ 2024-07-23 2:32 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Krzysztof Kozlowski,
linux-arm-msm, Kishon Vijay Abraham I, Conor Dooley,
Bjorn Andersson, linux-kernel, linux-pci, Bjorn Helgaas,
Konrad Dybcio, devicetree
On Wed, 17 Jul 2024 22:33:08 +0530, Manivannan Sadhasivam wrote:
> Kishon's TI email ID is not active anymore, so use his korg ID. Also, since
> I've been maintaining the PCI endpoint framework, I'm willing to maintain
> the DT binding as well. So add myself as the Co-maintainer.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> Documentation/devicetree/bindings/pci/pci-ep.yaml | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 04/13] dt-bindings: PCI: pci-ep: Document 'linux,pci-domain' property
2024-07-17 17:03 ` [PATCH v2 04/13] dt-bindings: PCI: pci-ep: Document 'linux,pci-domain' property Manivannan Sadhasivam via B4 Relay
@ 2024-07-23 2:33 ` Rob Herring (Arm)
0 siblings, 0 replies; 29+ messages in thread
From: Rob Herring (Arm) @ 2024-07-23 2:33 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Krzysztof Kozlowski, Conor Dooley, Bjorn Helgaas, linux-pci,
linux-arm-msm, Krzysztof Wilczyński, Kishon Vijay Abraham I,
Bjorn Andersson, Lorenzo Pieralisi, devicetree, Konrad Dybcio,
linux-kernel
On Wed, 17 Jul 2024 22:33:09 +0530, Manivannan Sadhasivam wrote:
> 'linux,pci-domain' property provides the PCI domain number for the PCI
> endpoint controllers in a SoC. If this property is not present, then an
> unstable (across boots) unique number will be assigned.
>
> Devicetrees can specify the domain number based on the actual hardware
> instance of the PCI endpoint controllers in the SoC.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> Documentation/devicetree/bindings/pci/pci-ep.yaml | 11 +++++++++++
> Documentation/devicetree/bindings/pci/qcom,pcie-ep.yaml | 1 +
> 2 files changed, 12 insertions(+)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 11/13] dt-bindings: PCI: qcom,pcie-sm8450: Add 'global' interrupt
2024-07-17 17:03 ` [PATCH v2 11/13] dt-bindings: PCI: qcom,pcie-sm8450: " Manivannan Sadhasivam via B4 Relay
@ 2024-07-23 2:35 ` Rob Herring
0 siblings, 0 replies; 29+ messages in thread
From: Rob Herring @ 2024-07-23 2:35 UTC (permalink / raw)
To: Manivannan Sadhasivam
Cc: Lorenzo Pieralisi, Krzysztof Wilczyński, Bjorn Helgaas,
Krzysztof Kozlowski, Conor Dooley, Kishon Vijay Abraham I,
Bjorn Andersson, Konrad Dybcio, linux-pci, linux-arm-msm,
linux-kernel, devicetree
On Wed, Jul 17, 2024 at 10:33:16PM +0530, Manivannan Sadhasivam wrote:
> Qcom PCIe RC controllers are capable of generating 'global' SPI interrupt
> to the host CPU. This interrupt can be used by the device driver to
> identify events such as PCIe link specific events, safety events, etc...
>
> Hence, document it in the binding along with the existing MSI interrupts.
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
> Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml b/Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml
> index d8c0afaa4b19..0d68ce073383 100644
> --- a/Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml
> +++ b/Documentation/devicetree/bindings/pci/qcom,pcie-sm8450.yaml
> @@ -55,11 +55,12 @@ properties:
> - const: aggre1 # Aggre NoC PCIe1 AXI clock
>
> interrupts:
> - minItems: 8
> - maxItems: 8
> + minItems: 9
ABI break
> + maxItems: 9
>
> interrupt-names:
> items:
> + - const: global
ABI break. You can't add a new entry at the beginning of the list.
> - const: msi0
> - const: msi1
> - const: msi2
> @@ -142,7 +143,8 @@ examples:
> "aggre0",
> "aggre1";
>
> - interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
> + interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
> + <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
> <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
> <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>,
> <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>,
> @@ -150,7 +152,7 @@ examples:
> <GIC_SPI 146 IRQ_TYPE_LEVEL_HIGH>,
> <GIC_SPI 147 IRQ_TYPE_LEVEL_HIGH>,
> <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>;
> - interrupt-names = "msi0", "msi1", "msi2", "msi3",
> + interrupt-names = "global", "msi0", "msi1", "msi2", "msi3",
> "msi4", "msi5", "msi6", "msi7";
> #interrupt-cells = <1>;
> interrupt-map-mask = <0 0 0 0x7>;
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2024-07-23 2:35 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-17 17:03 [PATCH v2 00/13] PCI: qcom: Simulate PCIe hotplug using 'global' interrupt Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 01/13] PCI: qcom-ep: Drop the redundant masking of global IRQ events Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 02/13] PCI: qcom-ep: Reword the error message for receiving unknown global IRQ event Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 03/13] dt-bindings: PCI: pci-ep: Update Maintainers Manivannan Sadhasivam via B4 Relay
2024-07-23 2:32 ` Rob Herring (Arm)
2024-07-17 17:03 ` [PATCH v2 04/13] dt-bindings: PCI: pci-ep: Document 'linux,pci-domain' property Manivannan Sadhasivam via B4 Relay
2024-07-23 2:33 ` Rob Herring (Arm)
2024-07-17 17:03 ` [PATCH v2 05/13] PCI: endpoint: Assign PCI domain number for endpoint controllers Manivannan Sadhasivam via B4 Relay
2024-07-18 12:11 ` Konrad Dybcio
2024-07-18 15:01 ` Manivannan Sadhasivam
2024-07-18 15:04 ` kernel test robot
2024-07-18 15:32 ` Manivannan Sadhasivam
2024-07-18 15:37 ` kernel test robot
2024-07-17 17:03 ` [PATCH v2 06/13] PCI: qcom-ep: Modify 'global_irq' and 'perst_irq' IRQ device names Manivannan Sadhasivam via B4 Relay
2024-07-18 12:12 ` Konrad Dybcio
2024-07-17 17:03 ` [PATCH v2 07/13] ARM: dts: qcom: sdx55: Add 'linux,pci-domain' to PCIe EP controller node Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 08/13] ARM: dts: qcom: sdx65: " Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 09/13] arm64: dts: qcom: sa8775p: Add 'linux,pci-domain' to PCIe EP controller nodes Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 10/13] dt-bindings: PCI: qcom: Add 'global' interrupt Manivannan Sadhasivam via B4 Relay
2024-07-17 17:03 ` [PATCH v2 11/13] dt-bindings: PCI: qcom,pcie-sm8450: " Manivannan Sadhasivam via B4 Relay
2024-07-23 2:35 ` Rob Herring
2024-07-17 17:03 ` [PATCH v2 12/13] PCI: qcom: Simulate PCIe hotplug using " Manivannan Sadhasivam via B4 Relay
2024-07-17 22:57 ` Mayank Rana
2024-07-18 10:29 ` Manivannan Sadhasivam
2024-07-18 17:15 ` Mayank Rana
2024-07-18 17:23 ` Manivannan Sadhasivam
2024-07-19 23:32 ` Frank Li
2024-07-21 7:34 ` Manivannan Sadhasivam
2024-07-17 17:03 ` [PATCH v2 13/13] arm64: dts: qcom: sm8450: Add 'global' interrupt to the PCIe RC node Manivannan Sadhasivam via B4 Relay
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).