From: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
cros-qcom-dts-watchers@chromium.org,
Bjorn Helgaas <bhelgaas@google.com>,
linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
quic_vbadigan@quicinc.com, quic_mrana@quicinc.com
Subject: Re: [PATCH 2/2] PCI: Add support for PCIe wake interrupt
Date: Tue, 1 Apr 2025 12:47:15 +0530 [thread overview]
Message-ID: <95db82e9-8527-0520-07db-672e64b6e25b@oss.qualcomm.com> (raw)
In-Reply-To: <Z-uPOLNPIgm63PWY@wunner.de>
On 4/1/2025 12:31 PM, Lukas Wunner wrote:
> On Tue, Apr 01, 2025 at 10:12:44AM +0530, Krishna Chaitanya Chundru wrote:
>> PCIe wake interrupt is needed for bringing back PCIe device state
>> from D3cold to D0.
>>
>> Implement new functions, of_pci_setup_wake_irq() and
>> of_pci_teardown_wake_irq(), to manage wake interrupts for PCI devices
>> using the Device Tree.
>>
>> From the port bus driver call these functions to enable wake support
>> for bridges.
> [...]
>> --- a/drivers/pci/pcie/portdrv.c
>> +++ b/drivers/pci/pcie/portdrv.c
>> @@ -695,6 +695,10 @@ static int pcie_portdrv_probe(struct pci_dev *dev,
>> if (type == PCI_EXP_TYPE_RC_EC)
>> pcie_link_rcec(dev);
>>
>> + status = of_pci_setup_wake_irq(dev);
>> + if (status)
>> + return status;
>> +
>> status = pcie_port_device_register(dev);
>> if (status)
>> return status;
>> @@ -728,6 +732,8 @@ static void pcie_portdrv_remove(struct pci_dev *dev)
>> pm_runtime_dont_use_autosuspend(&dev->dev);
>> }
>>
>> + of_pci_teardown_wake_irq(dev);
>> +
>> pcie_port_device_remove(dev);
>>
>> pci_disable_device(dev);
>
> Why doesn't the teardown order mirror the probe order, i.e. why is
> of_pci_teardown_wake_irq() called *before* pcie_port_device_remove()
> instead of after?
>
ack, in the next patch I will move teardown after
pcie_port_device_remove()
> (pcie_port_device_remove() is the opposite of pcie_port_device_register().)
>
> Also, why is it safe to bail out of probe on failure of
> of_pci_setup_wake_irq() without unwinding whatever pcie_link_rcec()
> has done? I think this needs either an explanation or reordering.
>
if there is a failure in port_device_register also we are not unwinding
so I taught it is already taken care. Looks like it is not.
In the next patch I will move of_pci_setup_wake_irq() above
pcie_link_rcec() to avoid all this.
- Krishna Chaitanya.
> Thanks,
>
> Lukas
next prev parent reply other threads:[~2025-04-01 7:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-01 4:42 [PATCH 0/2] PCI: Add support for PCIe wake interrupt Krishna Chaitanya Chundru
2025-04-01 4:42 ` [PATCH 1/2] arm64: dts: qcom: sc7280: Add wake GPIO Krishna Chaitanya Chundru
2025-04-01 4:42 ` [PATCH 2/2] PCI: Add support for PCIe wake interrupt Krishna Chaitanya Chundru
2025-04-01 7:01 ` Lukas Wunner
2025-04-01 7:17 ` Krishna Chaitanya Chundru [this message]
2025-04-01 10:16 ` Krishna Chaitanya Chundru
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=95db82e9-8527-0520-07db-672e64b6e25b@oss.qualcomm.com \
--to=krishna.chundru@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=bhelgaas@google.com \
--cc=conor+dt@kernel.org \
--cc=cros-qcom-dts-watchers@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=konradybcio@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=quic_mrana@quicinc.com \
--cc=quic_vbadigan@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;
as well as URLs for NNTP newsgroup(s).