All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Jeffy Chen <jeffy.chen@rock-chips.com>,
	linux-kernel@vger.kernel.org, bhelgaas@google.com,
	shawn.lin@rock-chips.com, dianders@chromium.org,
	Heiko Stuebner <heiko@sntech.de>,
	linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v6 1/3] PCI: rockchip: Add support for pcie wake irq
Date: Tue, 17 Oct 2017 18:03:14 -0700	[thread overview]
Message-ID: <20171018010312.GB65743@google.com> (raw)
In-Reply-To: <20171016200350.GH25517@bhelgaas-glaptop.roam.corp.google.com>

On Mon, Oct 16, 2017 at 03:03:50PM -0500, Bjorn Helgaas wrote:
> On Sat, Oct 14, 2017 at 03:50:56AM +0800, Jeffy Chen wrote:
> > Add support for PCIE_WAKE pin in rockchip pcie driver.
> > 
> > Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> > ---
> > 
> > Changes in v6:
> > Fix device_init_wake error handling, and add some comments.
> > 
> > Changes in v5:
> > Rebase
> > 
> > Changes in v3:
> > Fix error handling
> > 
> > Changes in v2:
> > Use dev_pm_set_dedicated_wake_irq
> >         -- Suggested by Brian Norris <briannorris@chromium.com>
> > 
> >  drivers/pci/host/pcie-rockchip.c | 27 +++++++++++++++++++++------
> >  1 file changed, 21 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> > index 9051c6c8fea4..268513b6c9c4 100644
> > --- a/drivers/pci/host/pcie-rockchip.c
> > +++ b/drivers/pci/host/pcie-rockchip.c
...
> > @@ -995,6 +996,17 @@ static int rockchip_pcie_setup_irq(struct rockchip_pcie *rockchip)
> >  		return err;
> >  	}
> >  
> > +	irq = platform_get_irq_byname(pdev, "wakeup");
> > +	if (irq >= 0) {
> > +		/* Must init wakeup before setting dedicated wakeup irq. */
> > +		device_init_wakeup(dev, true);
> > +		err = dev_pm_set_dedicated_wake_irq(dev, irq);
> > +		if (err) {
> > +			dev_err(dev, "failed to setup PCIe wakeup IRQ\n");
> > +			device_init_wakeup(dev, false);
> > +		}
> > +	}
> 
> There's nothing Rockchip-specific here, so I'm hoping you can explore
> putting this support in the PCI core, so any system that describes the
> WAKE# connection in the DT can benefit.

I guess it could work to look into pci_create_root_bus(), and
do something like the following?

	if (IS_ENABLED(CONFIG_OF) && parent && parent->of_node)
		... do OF parsing for generic features like WAKE# ...

Brian

WARNING: multiple messages have this Message-ID (diff)
From: briannorris@chromium.org (Brian Norris)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 1/3] PCI: rockchip: Add support for pcie wake irq
Date: Tue, 17 Oct 2017 18:03:14 -0700	[thread overview]
Message-ID: <20171018010312.GB65743@google.com> (raw)
In-Reply-To: <20171016200350.GH25517@bhelgaas-glaptop.roam.corp.google.com>

On Mon, Oct 16, 2017 at 03:03:50PM -0500, Bjorn Helgaas wrote:
> On Sat, Oct 14, 2017 at 03:50:56AM +0800, Jeffy Chen wrote:
> > Add support for PCIE_WAKE pin in rockchip pcie driver.
> > 
> > Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
> > ---
> > 
> > Changes in v6:
> > Fix device_init_wake error handling, and add some comments.
> > 
> > Changes in v5:
> > Rebase
> > 
> > Changes in v3:
> > Fix error handling
> > 
> > Changes in v2:
> > Use dev_pm_set_dedicated_wake_irq
> >         -- Suggested by Brian Norris <briannorris@chromium.com>
> > 
> >  drivers/pci/host/pcie-rockchip.c | 27 +++++++++++++++++++++------
> >  1 file changed, 21 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> > index 9051c6c8fea4..268513b6c9c4 100644
> > --- a/drivers/pci/host/pcie-rockchip.c
> > +++ b/drivers/pci/host/pcie-rockchip.c
...
> > @@ -995,6 +996,17 @@ static int rockchip_pcie_setup_irq(struct rockchip_pcie *rockchip)
> >  		return err;
> >  	}
> >  
> > +	irq = platform_get_irq_byname(pdev, "wakeup");
> > +	if (irq >= 0) {
> > +		/* Must init wakeup before setting dedicated wakeup irq. */
> > +		device_init_wakeup(dev, true);
> > +		err = dev_pm_set_dedicated_wake_irq(dev, irq);
> > +		if (err) {
> > +			dev_err(dev, "failed to setup PCIe wakeup IRQ\n");
> > +			device_init_wakeup(dev, false);
> > +		}
> > +	}
> 
> There's nothing Rockchip-specific here, so I'm hoping you can explore
> putting this support in the PCI core, so any system that describes the
> WAKE# connection in the DT can benefit.

I guess it could work to look into pci_create_root_bus(), and
do something like the following?

	if (IS_ENABLED(CONFIG_OF) && parent && parent->of_node)
		... do OF parsing for generic features like WAKE# ...

Brian

  reply	other threads:[~2017-10-18  1:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 19:50 [PATCH v6 0/3] PCI: rockchip: Move PCIE_WAKE handling into rockchip pcie driver Jeffy Chen
2017-10-13 19:50 ` Jeffy Chen
2017-10-13 19:50 ` Jeffy Chen
2017-10-13 19:50 ` [PATCH v6 1/3] PCI: rockchip: Add support for pcie wake irq Jeffy Chen
2017-10-13 19:50   ` Jeffy Chen
2017-10-16 20:03   ` Bjorn Helgaas
2017-10-16 20:03     ` Bjorn Helgaas
2017-10-16 20:03     ` Bjorn Helgaas
2017-10-18  1:03     ` Brian Norris [this message]
2017-10-18  1:03       ` Brian Norris
2017-10-18 13:29       ` Bjorn Helgaas
2017-10-18 13:29         ` Bjorn Helgaas
2017-10-18 13:29         ` Bjorn Helgaas
2017-10-19 11:19         ` jeffy
2017-10-19 11:19           ` jeffy
2017-10-19 11:19           ` jeffy
2017-10-13 19:50 ` [PATCH v6 2/3] dt-bindings: PCI: Add definition of " Jeffy Chen
2017-10-13 19:50   ` Jeffy Chen
2017-10-17 19:03   ` Rob Herring
2017-10-13 19:50 ` [PATCH v6 3/3] arm64: dts: rockchip: Handle pcie wake in pcie driver for Gru Jeffy Chen
2017-10-13 19:50   ` Jeffy Chen

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=20171018010312.GB65743@google.com \
    --to=briannorris@chromium.org \
    --cc=bhelgaas@google.com \
    --cc=dianders@chromium.org \
    --cc=heiko@sntech.de \
    --cc=helgaas@kernel.org \
    --cc=jeffy.chen@rock-chips.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=shawn.lin@rock-chips.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.