Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1378809 > unrolled thread

[PATCH 0/4] i2c: designware: runtime pm fix and improve

Started byJisheng Zhang <jszhang@marvell.com>
First post2016-04-14 15:00 +0200
Last post2016-04-14 15:00 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/4] i2c: designware: runtime pm fix and improve Jisheng Zhang <jszhang@marvell.com> - 2016-04-14 15:00 +0200
    [PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core Jisheng Zhang <jszhang@marvell.com> - 2016-04-14 15:00 +0200
    [PATCH 4/4] i2c: designware: remove runtime suspend prevention during registration Jisheng Zhang <jszhang@marvell.com> - 2016-04-14 15:00 +0200

#1378809 — [PATCH 0/4] i2c: designware: runtime pm fix and improve

FromJisheng Zhang <jszhang@marvell.com>
Date2016-04-14 15:00 +0200
Subject[PATCH 0/4] i2c: designware: runtime pm fix and improve
Message-ID<rnP2i-1K8-7@gated-at.bofh.it>
This series tries to fix one hang issue during probe found on arm
platform, and unbalanced clk enable prepare issue. Then applies similar
change as commit 36d48fb5766a ("i2c: designware-platdrv: enable
RuntimePM before registering to the core"), lastly remove the runtime
suspend prevention in i2c_dw_probe().


Jisheng Zhang (4):
  i2c: designware-platdrv: Fix runtime PM initialization
  i2c: designware-platdrv: fix unbalanced clk enable and prepare
  i2c: designware-pcidrv: enable RuntimePM before registering to the
    core
  i2c: designware: remove runtime suspend prevention during registration

 drivers/i2c/busses/i2c-designware-core.c    |  8 --------
 drivers/i2c/busses/i2c-designware-pcidrv.c  | 11 +++++++----
 drivers/i2c/busses/i2c-designware-platdrv.c | 16 +++++++++++++++-
 3 files changed, 22 insertions(+), 13 deletions(-)

-- 
2.8.0.rc3

[toc] | [next] | [standalone]


#1378810 — [PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core

FromJisheng Zhang <jszhang@marvell.com>
Date2016-04-14 15:00 +0200
Subject[PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core
Message-ID<rnP2j-1K8-11@gated-at.bofh.it>
In reply to#1378809
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);
 
 	return 0;
 }
-- 
2.8.0.rc3

[toc] | [prev] | [next] | [standalone]


#1378811 — [PATCH 4/4] i2c: designware: remove runtime suspend prevention during registration

FromJisheng Zhang <jszhang@marvell.com>
Date2016-04-14 15:00 +0200
Subject[PATCH 4/4] i2c: designware: remove runtime suspend prevention during registration
Message-ID<rnP2j-1K8-13@gated-at.bofh.it>
In reply to#1378809
Now all users make sure there won't be runtime suspend when calling
i2c_dw_probe(), so we can remove the prevention code now.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/i2c/busses/i2c-designware-core.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 99b54be..4255eaa 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -881,17 +881,9 @@ int i2c_dw_probe(struct dw_i2c_dev *dev)
 		return r;
 	}
 
-	/*
-	 * Increment PM usage count during adapter registration in order to
-	 * avoid possible spurious runtime suspend when adapter device is
-	 * registered to the device core and immediate resume in case bus has
-	 * registered I2C slaves that do I2C transfers in their probe.
-	 */
-	pm_runtime_get_noresume(dev->dev);
 	r = i2c_add_numbered_adapter(adap);
 	if (r)
 		dev_err(dev->dev, "failure adding adapter: %d\n", r);
-	pm_runtime_put_noidle(dev->dev);
 
 	return r;
 }
-- 
2.8.0.rc3

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web