public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Petlozu Pravareshwar <petlozup@nvidia.com>
Cc: Manikanta Maddireddy <mmaddireddy@nvidia.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"rafael.j.wysocki@intel.com" <rafael.j.wysocki@intel.com>,
	"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"jeffy.chen@rock-chips.com" <jeffy.chen@rock-chips.com>,
	"krzysztof.kozlowski+dt@linaro.org" 
	<krzysztof.kozlowski+dt@linaro.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	"dmitry.osipenko@collabora.com" <dmitry.osipenko@collabora.com>,
	"viresh.kumar@linaro.org" <viresh.kumar@linaro.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"steven.price@arm.com" <steven.price@arm.com>,
	"kw@linux.com" <kw@linux.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Vidya Sagar <vidyas@nvidia.com>
Subject: Re: [RFC,v14 4/5] arm64: tegra: Add PCIe port node with PCIe WAKE# for C1 controller
Date: Thu, 9 Feb 2023 12:12:27 +0100	[thread overview]
Message-ID: <Y+TVG4gUbbw5Vehi@orome> (raw)
In-Reply-To: <DM6PR12MB316420D07FBB9F8CE9AF5CD3B5D99@DM6PR12MB3164.namprd12.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3557 bytes --]

On Thu, Feb 09, 2023 at 10:53:25AM +0000, Petlozu Pravareshwar wrote:
> > 
> > On Wed, Feb 08, 2023 at 05:43:35PM +0530, Manikanta Maddireddy wrote:
> > >
> > > On 2/8/2023 5:07 PM, Thierry Reding wrote:
> > > > On Wed, Feb 08, 2023 at 04:46:44PM +0530, Manikanta Maddireddy
> > wrote:
> > > > > Add PCIe port node under the PCIe controller-1 device tree node to
> > > > > support PCIe WAKE# interrupt for WiFi.
> > > > >
> > > > > Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
> > > > > ---
> > > > >
> > > > > Changes in v14:
> > > > > New patch in the series to support PCIe WAKE# in NVIDIA Jetson AGX
> > Orin.
> > > > >
> > > > >   .../dts/nvidia/tegra234-p3737-0000+p3701-0000.dts     | 11
> > +++++++++++
> > > > >   1 file changed, 11 insertions(+)
> > > > >
> > > > > diff --git
> > > > > a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
> > > > > b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
> > > > > index 8a9747855d6b..9c89be263141 100644
> > > > > ---
> > > > > a/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-0000.dts
> > > > > +++ b/arch/arm64/boot/dts/nvidia/tegra234-p3737-0000+p3701-
> > 0000.dt
> > > > > +++ s
> > > > > @@ -2147,6 +2147,17 @@ pcie@14100000 {
> > > > >   			phys = <&p2u_hsio_3>;
> > > > >   			phy-names = "p2u-0";
> > > > > +
> > > > > +			pci@0,0 {
> > > > > +				reg = <0x0000 0 0 0 0>;
> > > > > +				#address-cells = <3>;
> > > > > +				#size-cells = <2>;
> > > > > +				ranges;
> > > > > +
> > > > > +				interrupt-parent = <&gpio>;
> > > > > +				interrupts = <TEGRA234_MAIN_GPIO(L, 2)
> > IRQ_TYPE_LEVEL_LOW>;
> > > > > +				interrupt-names = "wakeup";
> > > > > +			};
> > > > Don't we need to wire this to the PMC interrupt controller and the
> > > > wake event corresponding to the L2 GPIO? Otherwise none of the wake
> > > > logic in PMC will get invoked.
> > > >
> > > > Thierry
> > > PCIe wake is gpio based not pmc, only wake support is provided by PMC
> > > controller.
> > > I verified this patch and able to wake up Tegra from suspend.
> > > Petlozu, correct me if my understanding is wrong.
> > 
> > The way that this usually works is that you need to use something like
> > this:
> > 
> > 	interrupt-parent = <&pmc>;
> > 	interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
> > 	interrupt-names = "wakeup";
> > 
> > This will then cause the PMC's interrupt chip callbacks to setup all the wake-
> > related interrupts and use the internal wake event tables to forward the
> > GPIO/IRQ corresponding to the PMC wake event to the GPIO controller or
> > GIC, respectively.
> > 
> > If you use &gpio as the interrupt parent, none of the PMC logic will be
> > invoked, so unless this is somehow set up correctly by default, the PMC
> > wouldn't be able to wake up the system.
> > 
> > Thierry
> Thierry,
> Since PMC's IRQ domain is made as parent of GPIO controller's IRQ domain,
> I think, for GPIO based wakes setting &gpio as the interrupt parent can still
> invoke PMC logic to program the required registers to enable such wakes.
> Related commit in this regard:
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/drivers/gpio/gpio-tegra186.c?id=2a36550567307b881ce570a81189682ae1c9d08d

Heh... nicely self-owned =). You're right, no need for the detour in DT
with those, the GPIO driver will hook up the IRQ hierarchy itself. We
already do this for the "power" key in the various gpio-keys, so it
should work fine.

Sorry for the noise,
Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-02-09 11:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 11:16 [RFC,v14 0/5] Add DT based PCIe wake support in PCI core driver Manikanta Maddireddy
2023-02-08 11:16 ` [RFC,v14 1/5] dt-bindings: PCI: Add definition of PCIe WAKE# irq and PCI irq Manikanta Maddireddy
2023-02-08 13:53   ` Rob Herring
2023-02-08 15:54     ` Manikanta Maddireddy
2023-02-08 11:16 ` [RFC,v14 2/5] of/irq: Adjust of_pci_irq parsing for multiple interrupts Manikanta Maddireddy
2023-02-08 11:44   ` Thierry Reding
2023-02-08 12:20     ` Manikanta Maddireddy
2023-02-08 11:16 ` [RFC,v14 3/5] PCI / PM: Add support for the PCIe WAKE# signal for OF Manikanta Maddireddy
2023-02-08 11:50   ` Thierry Reding
2023-02-08 12:19     ` Manikanta Maddireddy
2023-02-08 11:16 ` [RFC,v14 4/5] arm64: tegra: Add PCIe port node with PCIe WAKE# for C1 controller Manikanta Maddireddy
2023-02-08 11:37   ` Thierry Reding
2023-02-08 12:13     ` Manikanta Maddireddy
2023-02-08 16:14       ` Thierry Reding
2023-02-09 10:53         ` Petlozu Pravareshwar
2023-02-09 11:12           ` Thierry Reding [this message]
2023-12-06 15:36   ` Manivannan Sadhasivam
2023-12-07  7:24     ` Manikanta Maddireddy
2023-12-07  7:59       ` Manivannan Sadhasivam
2023-12-07  8:53         ` Manikanta Maddireddy
2023-12-07  9:31           ` Manivannan Sadhasivam
2023-02-08 11:16 ` [RFC,v14 5/5] soc/tegra: pmc: Add Tegra234 PCIe wake event Manikanta Maddireddy
2023-02-08 11:38   ` Thierry Reding
2023-02-08 12:06     ` Manikanta Maddireddy
2023-12-06 14:44 ` [RFC,v14 0/5] Add DT based PCIe wake support in PCI core driver Krishna Chaitanya Chundru
2023-12-07  7:09   ` Manikanta Maddireddy

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=Y+TVG4gUbbw5Vehi@orome \
    --to=thierry.reding@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.osipenko@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jeffy.chen@rock-chips.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mmaddireddy@nvidia.com \
    --cc=petlozup@nvidia.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=robh@kernel.org \
    --cc=steven.price@arm.com \
    --cc=vidyas@nvidia.com \
    --cc=viresh.kumar@linaro.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