From: briannorris@chromium.org (Brian Norris)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/3] PCI: rockchip: Add support for pcie wake irq
Date: Thu, 12 Oct 2017 18:56:22 -0700 [thread overview]
Message-ID: <20171013015620.GA94568@google.com> (raw)
In-Reply-To: <20170911151029.25185-2-jeffy.chen@rock-chips.com>
Hi,
On Mon, Sep 11, 2017 at 11:10:27PM +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 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 | 19 +++++++++++++++++--
> 1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rockchip.c b/drivers/pci/host/pcie-rockchip.c
> index 9051c6c8fea4..a8b7272597a7 100644
> --- a/drivers/pci/host/pcie-rockchip.c
> +++ b/drivers/pci/host/pcie-rockchip.c
> @@ -37,6 +37,7 @@
> #include <linux/pci_ids.h>
> #include <linux/phy/phy.h>
> #include <linux/platform_device.h>
> +#include <linux/pm_wakeirq.h>
> #include <linux/reset.h>
> #include <linux/regmap.h>
>
> @@ -995,6 +996,15 @@ static int rockchip_pcie_setup_irq(struct rockchip_pcie *rockchip)
> return err;
> }
>
> + /* Must init wakeup before setting dedicated wakeup irq. */
> + device_init_wakeup(dev, true);
Am I crazy, or should this go inside the 'irq >= 0' conditional?
Otherwise, for the whole series:
Reviewed-by: Brian Norris <briannorris@chromium.org>
Tested-by: Brian Norris <briannorris@chromium.org>
Bjorn, were you planning to pick this up?
Also, the DT binding change conflicts (just simple context) with the
PERST# series I just sent out. Would be good if we could land one or
both :)
Thanks,
Brian
> + irq = platform_get_irq_byname(pdev, "wakeup");
> + if (irq >= 0) {
> + err = dev_pm_set_dedicated_wake_irq(dev, irq);
> + if (err)
> + dev_err(dev, "failed to setup PCIe wakeup IRQ\n");
> + }
> +
> return 0;
> }
>
> @@ -1542,11 +1552,11 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
>
> err = rockchip_pcie_parse_dt(rockchip);
> if (err)
> - return err;
> + goto err_disable_wake;
>
> err = rockchip_pcie_enable_clocks(rockchip);
> if (err)
> - return err;
> + goto err_disable_wake;
>
> err = rockchip_pcie_set_vpcie(rockchip);
> if (err) {
> @@ -1656,6 +1666,9 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
> regulator_disable(rockchip->vpcie0v9);
> err_set_vpcie:
> rockchip_pcie_disable_clocks(rockchip);
> +err_disable_wake:
> + dev_pm_clear_wake_irq(dev);
> + device_init_wakeup(dev, false);
> return err;
> }
>
> @@ -1682,6 +1695,8 @@ static int rockchip_pcie_remove(struct platform_device *pdev)
> if (!IS_ERR(rockchip->vpcie0v9))
> regulator_disable(rockchip->vpcie0v9);
>
> + dev_pm_clear_wake_irq(dev);
> + device_init_wakeup(dev, false);
> return 0;
> }
>
> --
> 2.11.0
>
>
next prev parent reply other threads:[~2017-10-13 1:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-11 15:10 [PATCH v5 0/3] PCI: rockchip: Move PCIE_WAKE handling into rockchip pcie driver Jeffy Chen
2017-09-11 15:10 ` [PATCH v5 1/3] PCI: rockchip: Add support for pcie wake irq Jeffy Chen
2017-09-12 0:39 ` Shawn Lin
2017-10-13 1:56 ` Brian Norris [this message]
2017-10-13 2:32 ` Bjorn Helgaas
2017-10-13 6:31 ` Brian Norris
2017-10-13 3:04 ` Bjorn Helgaas
2017-10-13 13:21 ` Rafael J. Wysocki
2017-10-13 17:58 ` Tony Lindgren
2017-10-13 18:33 ` jeffy
2017-10-13 19:19 ` Bjorn Helgaas
2017-10-13 19:26 ` jeffy
2017-10-13 20:44 ` Brian Norris
2017-09-11 15:10 ` [PATCH v5 3/3] arm64: dts: rockchip: Handle pcie wake in pcie driver for Gru Jeffy Chen
2017-09-12 0:40 ` Shawn Lin
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=20171013015620.GA94568@google.com \
--to=briannorris@chromium.org \
--cc=linux-arm-kernel@lists.infradead.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).