From: jarkko.nikula@linux.intel.com (Jarkko Nikula)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core
Date: Wed, 20 Apr 2016 16:03:01 +0300 [thread overview]
Message-ID: <57177E05.80107@linux.intel.com> (raw)
In-Reply-To: <1460638414-5987-4-git-send-email-jszhang@marvell.com>
On 04/14/2016 03:53 PM, Jisheng Zhang wrote:
> As pointed out by commit 36d48fb5766a ("i2c: designware-platdrv: enable
> RuntimePM before registering to the core"), "The core may register
> clients attached to this master which may use funtionality from the
> master", so enable RuntimePM before registering to the core.
>
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> ---
> drivers/i2c/busses/i2c-designware-pcidrv.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
> index 7368be0..41a01a7 100644
> --- a/drivers/i2c/busses/i2c-designware-pcidrv.c
> +++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
> @@ -248,14 +248,17 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
> ACPI_COMPANION_SET(&adap->dev, ACPI_COMPANION(&pdev->dev));
> adap->nr = controller->bus_num;
>
> + pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
> + pm_runtime_use_autosuspend(&pdev->dev);
> + pm_runtime_allow(&pdev->dev);
> +
> r = i2c_dw_probe(dev);
> - if (r)
> + if (r) {
> + pm_runtime_forbid(&pdev->dev);
> return r;
> + }
>
> - pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
> - pm_runtime_use_autosuspend(&pdev->dev);
> pm_runtime_put_autosuspend(&pdev->dev);
> - pm_runtime_allow(&pdev->dev);
>
Last time I checked this I didn't see urgent reason for the move because
runtime PM is enabled for PCI devices by default via pci_device_add() ->
pci_init_capabilities() -> pci_pm_init() -> pm_runtime_enable().
--
Jarkko
next prev parent reply other threads:[~2016-04-20 13:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 12:53 [PATCH 0/4] i2c: designware: runtime pm fix and improve Jisheng Zhang
2016-04-14 12:53 ` [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM initialization Jisheng Zhang
2016-04-20 13:53 ` Jarkko Nikula
2016-04-21 3:08 ` Jisheng Zhang
2016-04-21 7:48 ` Jarkko Nikula
2016-04-21 8:15 ` Jisheng Zhang
2016-04-14 12:53 ` [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Jisheng Zhang
2016-04-20 12:55 ` Jarkko Nikula
2016-04-20 14:16 ` Andy Shevchenko
2016-04-21 2:40 ` Jisheng Zhang
2016-04-21 7:39 ` Jarkko Nikula
2016-04-21 8:19 ` Jisheng Zhang
2016-04-14 12:53 ` [PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core Jisheng Zhang
2016-04-20 13:03 ` Jarkko Nikula [this message]
2016-04-14 12:53 ` [PATCH 4/4] i2c: designware: remove runtime suspend prevention during registration Jisheng Zhang
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=57177E05.80107@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--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).