From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Mayank Rana <quic_mrana@quicinc.com>,
linux-pci@vger.kernel.org, lpieralisi@kernel.org, kw@linux.com,
robh@kernel.org, bhelgaas@google.com, andersson@kernel.org,
manivannan.sadhasivam@linaro.org,
krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
devicetree@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org, quic_ramkri@quicinc.com,
quic_nkela@quicinc.com, quic_shazhuss@quicinc.com,
quic_msarkar@quicinc.com, quic_nitegupt@quicinc.com
Subject: Re: [RFC PATCH 2/2] PCI: Add Qualcomm PCIe ECAM root complex driver
Date: Thu, 4 Apr 2024 21:33:00 +0200 [thread overview]
Message-ID: <bf7b3b80-764f-4d80-95cd-e547bf767200@linaro.org> (raw)
In-Reply-To: <1712257884-23841-3-git-send-email-quic_mrana@quicinc.com>
On 04/04/2024 21:11, Mayank Rana wrote:
> On some of Qualcomm platform, firmware configures PCIe controller into
> ECAM mode allowing static memory allocation for configuration space of
> supported bus range. Firmware also takes care of bringing up PCIe PHY
> and performing required operation to bring PCIe link into D0. Firmware
> also manages system resources (e.g. clocks/regulators/resets/ bus voting).
> Hence add Qualcomm PCIe ECAM root complex driver which enumerates PCIe
> root complex and connected PCIe devices. Firmware won't be enumerating
> or powering up PCIe root complex until this driver invokes power domain
> based notification to bring PCIe link into D0/D3cold mode.
...
> +
> +static int qcom_pcie_ecam_suspend_noirq(struct device *dev)
> +{
> + return pm_runtime_put_sync(dev);
> +}
> +
> +static int qcom_pcie_ecam_resume_noirq(struct device *dev)
> +{
> + return pm_runtime_get_sync(dev);
> +}
> +
> +static int qcom_pcie_ecam_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct qcom_msi *msi;
> + int ret;
> +
> + ret = devm_pm_runtime_enable(dev);
> + if (ret)
> + return ret;
> +
> + ret = pm_runtime_resume_and_get(dev);
> + if (ret < 0) {
> + dev_err(dev, "fail to enable pcie controller: %d\n", ret);
> + return ret;
> + }
> +
> + msi = qcom_msi_init(dev);
> + if (IS_ERR(msi)) {
> + pm_runtime_put_sync(dev);
> + return PTR_ERR(msi);
> + }
> +
> + ret = pci_host_common_probe(pdev);
> + if (ret) {
> + dev_err(dev, "pci_host_common_probe() failed:%d\n", ret);
Don't print function name, but instead say something useful. Above error
message is so not useful that just drop it.
> + qcom_msi_deinit(msi);
> + pm_runtime_put_sync(dev);
> + }
> +
> + return ret;
> +}
> +
> +static const struct dev_pm_ops qcom_pcie_ecam_pm_ops = {
> + NOIRQ_SYSTEM_SLEEP_PM_OPS(qcom_pcie_ecam_suspend_noirq,
> + qcom_pcie_ecam_resume_noirq)
> +};
> +
> +static const struct pci_ecam_ops qcom_pcie_ecam_ops = {
> + .pci_ops = {
> + .map_bus = pci_ecam_map_bus,
> + .read = pci_generic_config_read,
> + .write = pci_generic_config_write,
> + }
> +};
> +
> +static const struct of_device_id qcom_pcie_ecam_of_match[] = {
> + {
> + .compatible = "qcom,pcie-ecam-rc",
> + .data = &qcom_pcie_ecam_ops,
Why do you have ops/match data for generic compatible?
Best regards,
Krzysztof
next prev parent reply other threads:[~2024-04-04 19:33 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-04 19:11 [RFC PATCH 0/2] Add Qualcomm PCIe ECAM root complex driver Mayank Rana
2024-04-04 19:11 ` [RFC PATCH 1/2] dt-bindings: pcie: Document QCOM PCIE ECAM compatible root complex Mayank Rana
2024-04-04 19:30 ` Krzysztof Kozlowski
2024-04-08 19:09 ` Mayank Rana
2024-04-09 6:21 ` Krzysztof Kozlowski
2024-04-18 18:56 ` Mayank Rana
2024-04-18 20:53 ` Krzysztof Kozlowski
2024-04-04 19:11 ` [RFC PATCH 2/2] PCI: Add Qualcomm PCIe ECAM root complex driver Mayank Rana
2024-04-04 19:33 ` Krzysztof Kozlowski [this message]
2024-04-05 5:30 ` Manivannan Sadhasivam
2024-04-05 17:41 ` Mayank Rana
2024-04-06 4:17 ` Manivannan Sadhasivam
2024-04-08 18:57 ` Mayank Rana
2024-04-10 6:26 ` Manivannan Sadhasivam
2024-04-10 16:58 ` Rob Herring
2024-04-15 23:30 ` Mayank Rana
2024-05-31 22:47 ` Mayank Rana
2024-06-06 2:39 ` Manivannan Sadhasivam
2024-06-10 17:17 ` Mayank Rana
2024-06-12 6:14 ` Manivannan Sadhasivam
2024-06-17 18:09 ` Mayank Rana
2024-04-05 18:30 ` Bjorn Helgaas
2024-04-06 0:43 ` Mayank Rana
2024-04-04 19:33 ` [RFC PATCH 0/2] " Krzysztof Kozlowski
2024-04-04 23:02 ` Mayank Rana
2024-04-05 6:50 ` Krzysztof Kozlowski
2024-04-05 17:45 ` Mayank Rana
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bf7b3b80-764f-4d80-95cd-e547bf767200@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=andersson@kernel.org \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kw@linux.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=quic_mrana@quicinc.com \
--cc=quic_msarkar@quicinc.com \
--cc=quic_nitegupt@quicinc.com \
--cc=quic_nkela@quicinc.com \
--cc=quic_ramkri@quicinc.com \
--cc=quic_shazhuss@quicinc.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox