From patchwork Wed Jul 31 10:50:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam via B4 Relay X-Patchwork-Id: 815724 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F20E11AD3FD; Wed, 31 Jul 2024 10:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722423019; cv=none; b=gV5lpHcJzQs5ViKCm/JUEWsaeQGwJk1HRsfeeROxgLlmJ/1le0U7b6zlX/76yn/EaF2qtdPR2rUttdY0vGUu+0NXYh3GjRRaJo8xowhvHhoqkax6KEqG25fd94c/HfaByKXaCMacZjRFC9ZebXL2YgXze/gLeJB09hz9P7DI3/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722423019; c=relaxed/simple; bh=Q0K9d834m1CQs7L6nrAh8i7+sVcfqEywtcVG4UQJkH8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eoh5OG8aAaObQ3nV2Bv9lzDAGYjMN1M/fhSN7Y3yKrWVAPKZbqWs8+D2JyvWp9N1s61y6+11n85jFb7rM0QFEzJt5op4R/aEsPZEBYtsEq2S9hAelG1bwaRiGJ9FNOu7QHwX3LsMHzyfy74xeljGHugdNc4Czcn8GpS937ux/Sg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tADzGTzL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tADzGTzL" Received: by smtp.kernel.org (Postfix) with ESMTPS id 7E618C4AF55; Wed, 31 Jul 2024 10:50:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722423018; bh=Q0K9d834m1CQs7L6nrAh8i7+sVcfqEywtcVG4UQJkH8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=tADzGTzL2PY4PO3jGpgBwqKvvBdwToY/m496qAKPpASdKugGWKnPsmuMx/qEZbs8M zwCF4w9vUjYhdFtReNXpuwCqheBi1ufHeQMaIFn1R2TdTPsrfa9c/m/fWTW3Jr2wYQ GqqrPx7c77RglLXsY63t+ZLSLLfLOPL/AjpiG4gOrWmuBT/W/uhNNluibjXlhcEWah hkJlqw2JwUZgtRTnR4BGNY6WPzBrZKw6a3DRyBvXdIC28/SzCTaK+17fiVswOfEsZ0 YaGwbwWIhDcF6mp6vPU7S2T1uMaBYv6bBJF+VP0sJ6cX4G7olkNVQVMKt3EfuBrhxJ PZ52/zg+7v0Uw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72B07C52D6D; Wed, 31 Jul 2024 10:50:18 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Wed, 31 Jul 2024 16:20:09 +0530 Subject: [PATCH v3 06/13] PCI: qcom-ep: Modify 'global_irq' and 'perst_irq' IRQ device names Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240731-pci-qcom-hotplug-v3-6-a1426afdee3b@linaro.org> References: <20240731-pci-qcom-hotplug-v3-0-a1426afdee3b@linaro.org> In-Reply-To: <20240731-pci-qcom-hotplug-v3-0-a1426afdee3b@linaro.org> To: Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Kishon Vijay Abraham I , Bjorn Andersson , Konrad Dybcio Cc: linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Manivannan Sadhasivam , Konrad Dybcio X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=2506; i=manivannan.sadhasivam@linaro.org; h=from:subject:message-id; bh=XIcVOnjgniiauSeztC2lx8OOqKBgQWPfU4mlz79I8zw=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBmqhbjGGaJwKyTvqkljnvL/tqJQd7uQOxHG/eYT WrBEXYQUN2JATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCZqoW4wAKCRBVnxHm/pHO 9WXwB/9aBNdScpakeH3ElJt0m4uB42SoSv/w09HA2ygZJIMQokLZ/4NylCvJKLQZXESG8sTXEwy ITY1NFLtltXxVWFExWLPkHqS5fr9r3ImF5/s6M0mRF/+gQYDytgWia3UkiHsBAYPvinFYU9010r aTYBuGk40rxSFqQie513l6Oc/fwGtDg5lGLHoMM8CtnLyeLOxYZihW3gBWBgVvaBrUxMxDcS2+e Vxaga9S1XfQ+ZuWn6xJKICujexiTeNyN6w2Cq/YNvnDJgARFPWW0TNXUsF5si7ANp8I+ETlzqpW +T5r6DvqlEXJiIbsvW9L2TdEJyNFSb3MKJfQjFTdHDtkdIk+ X-Developer-Key: i=manivannan.sadhasivam@linaro.org; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@linaro.org/default with auth_id=185 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@linaro.org From: Manivannan Sadhasivam 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. Reviewed-by: Konrad Dybcio Signed-off-by: Manivannan Sadhasivam --- 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);