Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
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 09:01:12 +0200	[thread overview]
Message-ID: <Z-uPOLNPIgm63PWY@wunner.de> (raw)
In-Reply-To: <20250401-wake_irq_support-v1-2-d2e22f4a0efd@oss.qualcomm.com>

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?

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

Thanks,

Lukas

  reply	other threads:[~2025-04-01  7:01 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 [this message]
2025-04-01  7:17     ` Krishna Chaitanya Chundru
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=Z-uPOLNPIgm63PWY@wunner.de \
    --to=lukas@wunner.de \
    --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=krishna.chundru@oss.qualcomm.com \
    --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=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