* [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper
@ 2014-09-24 16:14 Vinod Koul
2014-09-24 16:14 ` [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend() Vinod Koul
` (28 more replies)
0 siblings, 29 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Alan Stern, Alexandre Courbot,
Andrew Morton, Andy Gross, Baruch Siach, Ben Skeggs,
Bjorn Andersson, Chew, Chiau Ee, Chris Ball, Dan Carpenter,
Daniel Vetter, Dave Airlie, David Herrmann, dmaengine, dri-devel,
Du, Wenkai, Grant Grundler, Ilia Mirkin, intel-gfx,
Ivan T. Ivanov, Jaehoon Chung, Jani Nikula, Jingoo Han,
Laurent Pinchart, Laurent Pinchart, linux-arm-kernel, linux-doc,
linux-fbdev, linux-i2c, linux-mmc, linux-nfc, linux-omap,
linux-pm, linux-serial, linux-spi, linux-usb, linux-wireless,
Marcin Wojtas, Mika Westerberg, patches, Pramod Gurav,
Rafael J. Wysocki, Rob Clark, Romain Baeriswyl, Russell King,
Seungwon Jeon, Shinya Kuribayashi, Thierry Reding, Tim Kryger,
Tomi Valkeinen, Ulf Hansson, Wolfram Sang
This patch series adds a simple macro pm_runtime_last_busy_and_autosuspend()
which invokes pm_runtime_mark_last_busy() and pm_runtime_put_autosuspend()
sequentially. Then we do a tree wide update of current patterns which are
present. As evident from log below this pattern is frequent in the
kernel.
This series can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/slave-dma.git
topic/pm_runtime_last_busy_and_autosuspend
Fengguang's kbuild has tested it so it shouldn't break things for anyone.
Barring one patch (explictyly mentioned in its changelog) rest are simple
replacements.
If all are okay, this should be merged thru PM tree as it depends on macro
addition.
Subhransu S. Prusty (1):
PM: Add helper pm_runtime_last_busy_and_autosuspend()
Vinod Koul (26):
dmaengine: ste_dma: use pm_runtime_last_busy_and_autosuspend helper
extcon: arizona: use pm_runtime_last_busy_and_autosuspend helper
drm/i915: use pm_runtime_last_busy_and_autosuspend helper
drm/nouveau: use pm_runtime_last_busy_and_autosuspend helper
drm/radeon: use pm_runtime_last_busy_and_autosuspend helper
vga_switcheroo: use pm_runtime_last_busy_and_autosuspend helper
i2c: designware: use pm_runtime_last_busy_and_autosuspend helper
i2c: omap: use pm_runtime_last_busy_and_autosuspend helper
i2c: qup: use pm_runtime_last_busy_and_autosuspend helper
mfd: ab8500-gpadc: use pm_runtime_last_busy_and_autosuspend helper
mfd: arizona: use pm_runtime_last_busy_and_autosuspend helper
mei: use pm_runtime_last_busy_and_autosuspend helper
mmc: use pm_runtime_last_busy_and_autosuspend helper
mmc: mmci: use pm_runtime_last_busy_and_autosuspend helper
mmc: omap_hsmmc: use pm_runtime_last_busy_and_autosuspend helper
mmc: sdhci-pxav3: use pm_runtime_last_busy_and_autosuspend helper
mmc: sdhci: use pm_runtime_last_busy_and_autosuspend helper
NFC: trf7970a: use pm_runtime_last_busy_and_autosuspend helper
pm2301-charger: use pm_runtime_last_busy_and_autosuspend helper
spi: omap2-mcspi: use pm_runtime_last_busy_and_autosuspend helper
spi: orion: use pm_runtime_last_busy_and_autosuspend helper
spi: ti-qspi: use pm_runtime_last_busy_and_autosuspend helper
spi: core: use pm_runtime_last_busy_and_autosuspend helper
tty: serial: omap: use pm_runtime_last_busy_and_autosuspend helper
usb: musb: omap2430: use pm_runtime_last_busy_and_autosuspend helper
video: fbdev: use pm_runtime_last_busy_and_autosuspend helper
Documentation/power/runtime_pm.txt | 4 ++
drivers/dma/ste_dma40.c | 30 ++++---------
drivers/extcon/extcon-arizona.c | 6 +--
drivers/gpu/drm/i915/intel_pm.c | 3 +-
drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 9 +---
drivers/gpu/drm/radeon/radeon_connectors.c | 15 ++----
drivers/gpu/drm/radeon/radeon_drv.c | 5 +-
drivers/gpu/drm/radeon/radeon_kms.c | 6 +--
drivers/gpu/vga/vga_switcheroo.c | 7 +--
drivers/i2c/busses/i2c-designware-core.c | 3 +-
drivers/i2c/busses/i2c-omap.c | 6 +--
drivers/i2c/busses/i2c-qup.c | 3 +-
drivers/mfd/ab8500-gpadc.c | 6 +--
drivers/mfd/arizona-irq.c | 3 +-
drivers/misc/mei/client.c | 12 ++----
drivers/mmc/core/core.c | 3 +-
drivers/mmc/host/mmci.c | 12 ++----
drivers/mmc/host/omap_hsmmc.c | 19 ++-------
drivers/mmc/host/sdhci-pxav3.c | 6 +--
drivers/mmc/host/sdhci.c | 3 +-
drivers/nfc/trf7970a.c | 3 +-
drivers/power/pm2301_charger.c | 3 +-
drivers/spi/spi-omap2-mcspi.c | 9 +---
drivers/spi/spi-orion.c | 3 +-
drivers/spi/spi-ti-qspi.c | 5 +-
drivers/spi/spi.c | 6 +--
drivers/tty/serial/omap-serial.c | 60 +++++++++------------------
drivers/usb/musb/omap2430.c | 6 +--
drivers/video/fbdev/auo_k190x.c | 9 +---
include/linux/pm_runtime.h | 6 +++
31 files changed, 97 insertions(+), 177 deletions(-)
Thanks
--
~Vinod
^ permalink raw reply [flat|nested] 53+ messages in thread
* [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend()
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-24 17:54 ` Pavel Machek
2014-09-25 8:13 ` Ulf Hansson
2014-09-24 16:14 ` [PATCH 02/27] dmaengine: ste_dma: use pm_runtime_last_busy_and_autosuspend helper Vinod Koul
` (27 subsequent siblings)
28 siblings, 2 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Rafael J. Wysocki, Len Brown,
Pavel Machek, Randy Dunlap, Ulf Hansson, Alan Stern, linux-pm,
linux-doc
From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
pm_runtime_mark_last_busy and pm_runtime_put_autosuspend are used together
in quite a lot of places. Add a helper for these.
Also updated Documentation for this
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
Documentation/power/runtime_pm.txt | 4 ++++
include/linux/pm_runtime.h | 6 ++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
index f32ce54..5d9565b 100644
--- a/Documentation/power/runtime_pm.txt
+++ b/Documentation/power/runtime_pm.txt
@@ -490,6 +490,10 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
power.use_autosuspend isn't set, otherwise returns the expiration time
in jiffies
+ int pm_runtime_last_busy_and_autosuspend(struct device *dev);
+ - invoke pm_runtime_mark_last_busy(dev) and then run
+ pm_runtime_put_autosuspend(dev) and return its result
+
It is safe to execute the following helper functions from interrupt context:
pm_request_idle()
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 367f49b..256ec50 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -277,4 +277,10 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
__pm_runtime_use_autosuspend(dev, false);
}
+static inline int pm_runtime_last_busy_and_autosuspend(struct device *dev)
+{
+ pm_runtime_mark_last_busy(dev);
+ return pm_runtime_put_autosuspend(dev);
+}
+
#endif
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 02/27] dmaengine: ste_dma: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
2014-09-24 16:14 ` [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend() Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-25 13:19 ` Linus Walleij
2014-09-24 16:14 ` [PATCH 03/27] extcon: arizona: " Vinod Koul
` (26 subsequent siblings)
28 siblings, 1 reply; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Linus Walleij, Dan Williams,
linux-arm-kernel, dmaengine
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/dma/ste_dma40.c | 30 ++++++++++--------------------
1 files changed, 10 insertions(+), 20 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 5fe5933..621b941 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -1442,8 +1442,7 @@ static int d40_pause(struct d40_chan *d40c)
res = d40_channel_execute_command(d40c, D40_DMA_SUSPEND_REQ);
- pm_runtime_mark_last_busy(d40c->base->dev);
- pm_runtime_put_autosuspend(d40c->base->dev);
+ pm_runtime_last_busy_and_autosuspend(d40c->base->dev);
spin_unlock_irqrestore(&d40c->lock, flags);
return res;
}
@@ -1463,8 +1462,7 @@ static int d40_resume(struct d40_chan *d40c)
if (d40_residue(d40c) || d40_tx_is_linked(d40c))
res = d40_channel_execute_command(d40c, D40_DMA_RUN);
- pm_runtime_mark_last_busy(d40c->base->dev);
- pm_runtime_put_autosuspend(d40c->base->dev);
+ pm_runtime_last_busy_and_autosuspend(d40c->base->dev);
spin_unlock_irqrestore(&d40c->lock, flags);
return res;
}
@@ -1565,8 +1563,7 @@ static void dma_tc_handle(struct d40_chan *d40c)
if (d40_queue_start(d40c) == NULL) {
d40c->busy = false;
- pm_runtime_mark_last_busy(d40c->base->dev);
- pm_runtime_put_autosuspend(d40c->base->dev);
+ pm_runtime_last_busy_and_autosuspend(d40c->base->dev);
}
d40_desc_remove(d40d);
@@ -2045,18 +2042,15 @@ static int d40_free_dma(struct d40_chan *d40c)
else
d40c->base->lookup_phy_chans[phy->num] = NULL;
- if (d40c->busy) {
- pm_runtime_mark_last_busy(d40c->base->dev);
- pm_runtime_put_autosuspend(d40c->base->dev);
- }
+ if (d40c->busy)
+ pm_runtime_last_busy_and_autosuspend(d40c->base->dev);
d40c->busy = false;
d40c->phy_chan = NULL;
d40c->configured = false;
out:
- pm_runtime_mark_last_busy(d40c->base->dev);
- pm_runtime_put_autosuspend(d40c->base->dev);
+ pm_runtime_last_busy_and_autosuspend(d40c->base->dev);
return res;
}
@@ -2457,8 +2451,7 @@ static int d40_alloc_chan_resources(struct dma_chan *chan)
if (is_free_phy)
d40_config_write(d40c);
fail:
- pm_runtime_mark_last_busy(d40c->base->dev);
- pm_runtime_put_autosuspend(d40c->base->dev);
+ pm_runtime_last_busy_and_autosuspend(d40c->base->dev);
spin_unlock_irqrestore(&d40c->lock, flags);
return err;
}
@@ -2618,12 +2611,9 @@ static void d40_terminate_all(struct dma_chan *chan)
chan_err(d40c, "Failed to stop channel\n");
d40_term_all(d40c);
- pm_runtime_mark_last_busy(d40c->base->dev);
- pm_runtime_put_autosuspend(d40c->base->dev);
- if (d40c->busy) {
- pm_runtime_mark_last_busy(d40c->base->dev);
- pm_runtime_put_autosuspend(d40c->base->dev);
- }
+ pm_runtime_last_busy_and_autosuspend(d40c->base->dev);
+ if (d40c->busy)
+ pm_runtime_last_busy_and_autosuspend(d40c->base->dev);
d40c->busy = false;
spin_unlock_irqrestore(&d40c->lock, flags);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 03/27] extcon: arizona: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
2014-09-24 16:14 ` [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend() Vinod Koul
2014-09-24 16:14 ` [PATCH 02/27] dmaengine: ste_dma: use pm_runtime_last_busy_and_autosuspend helper Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-25 1:05 ` Chanwoo Choi
2014-09-25 8:10 ` Charles Keepax
2014-09-24 16:14 ` [PATCH 04/27] drm/i915: " Vinod Koul
` (25 subsequent siblings)
28 siblings, 2 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, MyungJoo Ham, Chanwoo Choi, patches
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/extcon/extcon-arizona.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index ba51588..7774e80 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -323,8 +323,7 @@ static void arizona_stop_mic(struct arizona_extcon_info *info)
if (change) {
regulator_disable(info->micvdd);
- pm_runtime_mark_last_busy(info->dev);
- pm_runtime_put_autosuspend(info->dev);
+ pm_runtime_last_busy_and_autosuspend(info->dev);
}
}
@@ -1077,8 +1076,7 @@ out:
mutex_unlock(&info->lock);
- pm_runtime_mark_last_busy(info->dev);
- pm_runtime_put_autosuspend(info->dev);
+ pm_runtime_last_busy_and_autosuspend(info->dev);
return IRQ_HANDLED;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 04/27] drm/i915: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (2 preceding siblings ...)
2014-09-24 16:14 ` [PATCH 03/27] extcon: arizona: " Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-24 18:35 ` Daniel Vetter
2014-09-24 16:14 ` [PATCH 05/27] drm/nouveau: " Vinod Koul
` (24 subsequent siblings)
28 siblings, 1 reply; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Daniel Vetter, Jani Nikula,
David Airlie, intel-gfx, dri-devel
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/gpu/drm/i915/intel_pm.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 40c1229..1ec9b8d 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -6729,8 +6729,7 @@ void intel_runtime_pm_put(struct drm_i915_private *dev_priv)
if (!HAS_RUNTIME_PM(dev))
return;
- pm_runtime_mark_last_busy(device);
- pm_runtime_put_autosuspend(device);
+ pm_runtime_last_busy_and_autosuspend(device);
}
void intel_init_runtime_pm(struct drm_i915_private *dev_priv)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 05/27] drm/nouveau: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (3 preceding siblings ...)
2014-09-24 16:14 ` [PATCH 04/27] drm/i915: " Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-24 16:14 ` [PATCH 06/27] drm/radeon: " Vinod Koul
` (23 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, David Airlie, Ben Skeggs,
Dave Airlie, Daniel Vetter, David Herrmann, Ilia Mirkin,
Jani Nikula, Alexandre Courbot, Rob Clark, Thierry Reding,
dri-devel
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +--
drivers/gpu/drm/nouveau/nouveau_drm.c | 9 +++------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 1ec44c8..0e3108a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -323,8 +323,7 @@ detect_analog:
out:
- pm_runtime_mark_last_busy(connector->dev->dev);
- pm_runtime_put_autosuspend(connector->dev->dev);
+ pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
return conn_status;
}
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 250a5e8..719eabf 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -766,8 +766,7 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv)
mutex_unlock(&drm->client.mutex);
out_suspend:
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
return ret;
}
@@ -794,8 +793,7 @@ nouveau_drm_postclose(struct drm_device *dev, struct drm_file *fpriv)
{
struct nouveau_cli *cli = nouveau_cli(fpriv);
nouveau_cli_destroy(cli);
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
}
static const struct drm_ioctl_desc
@@ -834,8 +832,7 @@ nouveau_drm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
}
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
return ret;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 06/27] drm/radeon: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (4 preceding siblings ...)
2014-09-24 16:14 ` [PATCH 05/27] drm/nouveau: " Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-24 20:37 ` Alex Deucher
2014-09-24 16:14 ` [PATCH 07/27] vga_switcheroo: " Vinod Koul
` (22 subsequent siblings)
28 siblings, 1 reply; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Alex Deucher,
Christian König, David Airlie, dri-devel
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/gpu/drm/radeon/radeon_connectors.c | 15 +++++----------
drivers/gpu/drm/radeon/radeon_drv.c | 5 ++---
drivers/gpu/drm/radeon/radeon_kms.c | 6 ++----
3 files changed, 9 insertions(+), 17 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
index 300c4b3..b48cf9d 100644
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
@@ -852,8 +852,7 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
/* check acpi lid status ??? */
radeon_connector_update_scratch_regs(connector, ret);
- pm_runtime_mark_last_busy(connector->dev->dev);
- pm_runtime_put_autosuspend(connector->dev->dev);
+ pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
return ret;
}
@@ -1025,8 +1024,7 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
radeon_connector_update_scratch_regs(connector, ret);
out:
- pm_runtime_mark_last_busy(connector->dev->dev);
- pm_runtime_put_autosuspend(connector->dev->dev);
+ pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
return ret;
}
@@ -1103,8 +1101,7 @@ radeon_tv_detect(struct drm_connector *connector, bool force)
if (ret == connector_status_connected)
ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, false);
radeon_connector_update_scratch_regs(connector, ret);
- pm_runtime_mark_last_busy(connector->dev->dev);
- pm_runtime_put_autosuspend(connector->dev->dev);
+ pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
return ret;
}
@@ -1321,8 +1318,7 @@ out:
radeon_connector_update_scratch_regs(connector, ret);
exit:
- pm_runtime_mark_last_busy(connector->dev->dev);
- pm_runtime_put_autosuspend(connector->dev->dev);
+ pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
return ret;
}
@@ -1638,8 +1634,7 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
radeon_connector_update_scratch_regs(connector, ret);
out:
- pm_runtime_mark_last_busy(connector->dev->dev);
- pm_runtime_put_autosuspend(connector->dev->dev);
+ pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
return ret;
}
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index 092d067..548d129 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -503,9 +503,8 @@ long radeon_drm_ioctl(struct file *filp,
return ret;
ret = drm_ioctl(filp, cmd, arg);
-
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
return ret;
}
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index eb7164d..80f061d 100644
--- a/drivers/gpu/drm/radeon/radeon_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_kms.c
@@ -147,8 +147,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
pm_runtime_set_autosuspend_delay(dev->dev, 5000);
pm_runtime_set_active(dev->dev);
pm_runtime_allow(dev->dev);
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
}
out:
@@ -632,8 +631,7 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
file_priv->driver_priv = fpriv;
}
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
return 0;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 07/27] vga_switcheroo: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (5 preceding siblings ...)
2014-09-24 16:14 ` [PATCH 06/27] drm/radeon: " Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-24 20:37 ` Alex Deucher
2014-09-24 16:14 ` [PATCH 08/27] i2c: designware: " Vinod Koul
` (21 subsequent siblings)
28 siblings, 1 reply; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel; +Cc: subhransu.s.prusty, vinod.koul, David Airlie, dri-devel
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/gpu/vga/vga_switcheroo.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 6866448..697ffbd 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -682,10 +682,9 @@ static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
ret = dev->bus->pm->runtime_resume(dev);
/* put the reference for the gpu */
- if (found) {
- pm_runtime_mark_last_busy(&found->pdev->dev);
- pm_runtime_put_autosuspend(&found->pdev->dev);
- }
+ if (found)
+ pm_runtime_last_busy_and_autosuspend(&found->pdev->dev);
+
return ret;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 08/27] i2c: designware: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (6 preceding siblings ...)
2014-09-24 16:14 ` [PATCH 07/27] vga_switcheroo: " Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-24 16:14 ` [PATCH 09/27] i2c: omap: " Vinod Koul
` (20 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Wolfram Sang, Mika Westerberg,
Andrew Morton, Du, Wenkai, Shinya Kuribayashi, Chew, Chiau Ee,
Romain Baeriswyl, Baruch Siach, linux-i2c
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/i2c/busses/i2c-designware-core.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 3c20e4b..13aa1cc 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -676,8 +676,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
ret = -EIO;
done:
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
mutex_unlock(&dev->lock);
return ret;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 09/27] i2c: omap: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (7 preceding siblings ...)
2014-09-24 16:14 ` [PATCH 08/27] i2c: designware: " Vinod Koul
@ 2014-09-24 16:14 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 10/27] i2c: qup: " Vinod Koul
` (19 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:14 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Tony Lindgren, Wolfram Sang,
linux-omap, linux-i2c
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/i2c/busses/i2c-omap.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 0dffb0e..8a7de50 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -661,8 +661,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
dev->set_mpu_wkup_lat(dev->dev, -1);
out:
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
return r;
}
@@ -1253,8 +1252,7 @@ omap_i2c_probe(struct platform_device *pdev)
dev_info(dev->dev, "bus %d rev%d.%d at %d kHz\n", adap->nr,
major, minor, dev->speed);
- pm_runtime_mark_last_busy(dev->dev);
- pm_runtime_put_autosuspend(dev->dev);
+ pm_runtime_last_busy_and_autosuspend(dev->dev);
return 0;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 10/27] i2c: qup: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (8 preceding siblings ...)
2014-09-24 16:14 ` [PATCH 09/27] i2c: omap: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 11/27] mfd: ab8500-gpadc: " Vinod Koul
` (18 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Wolfram Sang, Bjorn Andersson,
Ivan T. Ivanov, Andy Gross, Dan Carpenter, Pramod Gurav,
linux-i2c
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/i2c/busses/i2c-qup.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 3a4d64e..9ada3ee 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -518,8 +518,7 @@ static int qup_i2c_xfer(struct i2c_adapter *adap,
ret = num;
out:
- pm_runtime_mark_last_busy(qup->dev);
- pm_runtime_put_autosuspend(qup->dev);
+ pm_runtime_last_busy_and_autosuspend(qup->dev);
return ret;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 11/27] mfd: ab8500-gpadc: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (9 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 10/27] i2c: qup: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-26 8:38 ` Linus Walleij
2014-10-06 21:40 ` Lee Jones
2014-09-24 16:15 ` [PATCH 12/27] mfd: arizona: " Vinod Koul
` (17 subsequent siblings)
28 siblings, 2 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Linus Walleij, Samuel Ortiz,
Lee Jones, linux-arm-kernel
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/mfd/ab8500-gpadc.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
index 36000f9..46bea3a 100644
--- a/drivers/mfd/ab8500-gpadc.c
+++ b/drivers/mfd/ab8500-gpadc.c
@@ -571,8 +571,7 @@ int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
}
/* Disable VTVout LDO this is required for GPADC */
- pm_runtime_mark_last_busy(gpadc->dev);
- pm_runtime_put_autosuspend(gpadc->dev);
+ pm_runtime_last_busy_and_autosuspend(gpadc->dev);
mutex_unlock(&gpadc->ab8500_gpadc_lock);
@@ -910,8 +909,7 @@ static int ab8500_gpadc_resume(struct device *dev)
if (ret)
dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
- pm_runtime_mark_last_busy(gpadc->dev);
- pm_runtime_put_autosuspend(gpadc->dev);
+ pm_runtime_last_busy_and_autosuspend(gpadc->dev);
mutex_unlock(&gpadc->ab8500_gpadc_lock);
return ret;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 12/27] mfd: arizona: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (10 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 11/27] mfd: ab8500-gpadc: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-25 8:10 ` Charles Keepax
2014-10-06 21:41 ` Lee Jones
2014-09-24 16:15 ` [PATCH 13/27] mei: " Vinod Koul
` (16 subsequent siblings)
28 siblings, 2 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Samuel Ortiz, Lee Jones, patches
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/mfd/arizona-irq.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
index d420dbc..dc755d1 100644
--- a/drivers/mfd/arizona-irq.c
+++ b/drivers/mfd/arizona-irq.c
@@ -138,8 +138,7 @@ static irqreturn_t arizona_irq_thread(int irq, void *data)
}
} while (poll);
- pm_runtime_mark_last_busy(arizona->dev);
- pm_runtime_put_autosuspend(arizona->dev);
+ pm_runtime_last_busy_and_autosuspend(arizona->dev);
return IRQ_HANDLED;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 13/27] mei: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (11 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 12/27] mfd: arizona: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 14/27] mmc: " Vinod Koul
` (15 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel; +Cc: subhransu.s.prusty, vinod.koul, Tomas Winkler
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/misc/mei/client.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 324e1de..e522c01 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -519,8 +519,7 @@ int mei_cl_disconnect(struct mei_cl *cl)
mei_io_list_flush(&dev->ctrl_wr_list, cl);
free:
cl_dbg(dev, cl, "rpm: autosuspend\n");
- pm_runtime_mark_last_busy(&dev->pdev->dev);
- pm_runtime_put_autosuspend(&dev->pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&dev->pdev->dev);
mei_io_cb_free(cb);
return rets;
@@ -625,8 +624,7 @@ int mei_cl_connect(struct mei_cl *cl, struct file *file)
out:
cl_dbg(dev, cl, "rpm: autosuspend\n");
- pm_runtime_mark_last_busy(&dev->pdev->dev);
- pm_runtime_put_autosuspend(&dev->pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&dev->pdev->dev);
mei_io_cb_free(cb);
return rets;
@@ -779,8 +777,7 @@ int mei_cl_read_start(struct mei_cl *cl, size_t length)
out:
cl_dbg(dev, cl, "rpm: autosuspend\n");
- pm_runtime_mark_last_busy(&dev->pdev->dev);
- pm_runtime_put_autosuspend(&dev->pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&dev->pdev->dev);
if (rets)
mei_io_cb_free(cb);
@@ -978,8 +975,7 @@ out:
rets = buf->size;
err:
cl_dbg(dev, cl, "rpm: autosuspend\n");
- pm_runtime_mark_last_busy(&dev->pdev->dev);
- pm_runtime_put_autosuspend(&dev->pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&dev->pdev->dev);
return rets;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 14/27] mmc: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (12 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 13/27] mei: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 15/27] mmc: mmci: " Vinod Koul
` (14 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Chris Ball, Ulf Hansson,
Seungwon Jeon, Jaehoon Chung, Tim Kryger, Grant Grundler,
linux-mmc
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/mmc/core/core.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index d03a080..5081089 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -954,8 +954,7 @@ EXPORT_SYMBOL(mmc_get_card);
void mmc_put_card(struct mmc_card *card)
{
mmc_release_host(card->host);
- pm_runtime_mark_last_busy(&card->dev);
- pm_runtime_put_autosuspend(&card->dev);
+ pm_runtime_last_busy_and_autosuspend(&card->dev);
}
EXPORT_SYMBOL(mmc_put_card);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 15/27] mmc: mmci: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (13 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 14/27] mmc: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 16/27] mmc: omap_hsmmc: " Vinod Koul
` (13 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Russell King, Chris Ball,
Ulf Hansson, linux-mmc
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/mmc/host/mmci.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index e4d4707..27dcfba 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -223,8 +223,7 @@ static int mmci_card_busy(struct mmc_host *mmc)
busy = 1;
spin_unlock_irqrestore(&host->lock, flags);
- pm_runtime_mark_last_busy(mmc_dev(mmc));
- pm_runtime_put_autosuspend(mmc_dev(mmc));
+ pm_runtime_last_busy_and_autosuspend(mmc_dev(mmc));
return busy;
}
@@ -372,8 +371,7 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
mmc_request_done(host->mmc, mrq);
- pm_runtime_mark_last_busy(mmc_dev(host->mmc));
- pm_runtime_put_autosuspend(mmc_dev(host->mmc));
+ pm_runtime_last_busy_and_autosuspend(mmc_dev(host->mmc));
}
static void mmci_set_mask1(struct mmci_host *host, unsigned int mask)
@@ -1397,8 +1395,7 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
spin_unlock_irqrestore(&host->lock, flags);
- pm_runtime_mark_last_busy(mmc_dev(mmc));
- pm_runtime_put_autosuspend(mmc_dev(mmc));
+ pm_runtime_last_busy_and_autosuspend(mmc_dev(mmc));
}
static int mmci_get_cd(struct mmc_host *mmc)
@@ -1442,8 +1439,7 @@ static int mmci_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)
if (ret)
dev_warn(mmc_dev(mmc), "Voltage switch failed\n");
- pm_runtime_mark_last_busy(mmc_dev(mmc));
- pm_runtime_put_autosuspend(mmc_dev(mmc));
+ pm_runtime_last_busy_and_autosuspend(mmc_dev(mmc));
}
return ret;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 16/27] mmc: omap_hsmmc: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (14 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 15/27] mmc: mmci: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 17/27] mmc: sdhci-pxav3: " Vinod Koul
` (12 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Balaji T K, Chris Ball,
Ulf Hansson, linux-mmc, linux-omap
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
This patch also changes return value from macro rather than 0 always!
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/mmc/host/omap_hsmmc.c | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 9656726..2a2affc 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1823,10 +1823,7 @@ static int omap_hsmmc_disable_fclk(struct mmc_host *mmc)
{
struct omap_hsmmc_host *host = mmc_priv(mmc);
- pm_runtime_mark_last_busy(host->dev);
- pm_runtime_put_autosuspend(host->dev);
-
- return 0;
+ return pm_runtime_last_busy_and_autosuspend(host->dev);
}
static const struct mmc_host_ops omap_hsmmc_ops = {
@@ -1877,10 +1874,7 @@ static int omap_hsmmc_regs_show(struct seq_file *s, void *data)
seq_printf(s, "CAPA:\t\t0x%08x\n",
OMAP_HSMMC_READ(host->base, CAPA));
- pm_runtime_mark_last_busy(host->dev);
- pm_runtime_put_autosuspend(host->dev);
-
- return 0;
+ return pm_runtime_last_busy_and_autosuspend(host->dev);
}
static int omap_hsmmc_regs_open(struct inode *inode, struct file *file)
@@ -2258,10 +2252,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
}
omap_hsmmc_debugfs(mmc);
- pm_runtime_mark_last_busy(host->dev);
- pm_runtime_put_autosuspend(host->dev);
-
- return 0;
+ return pm_runtime_last_busy_and_autosuspend(host->dev);
err_slot_name:
mmc_remove_host(mmc);
@@ -2386,9 +2377,7 @@ static int omap_hsmmc_resume(struct device *dev)
!(host->mmc->pm_flags & MMC_PM_WAKE_SDIO_IRQ))
enable_irq(host->wake_irq);
- pm_runtime_mark_last_busy(host->dev);
- pm_runtime_put_autosuspend(host->dev);
- return 0;
+ return pm_runtime_last_busy_and_autosuspend(host->dev);
}
#else
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 17/27] mmc: sdhci-pxav3: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (15 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 16/27] mmc: omap_hsmmc: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 18/27] mmc: sdhci: " Vinod Koul
` (11 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Chris Ball, Ulf Hansson,
Russell King, Marcin Wojtas, Laurent Pinchart, linux-mmc
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/mmc/host/sdhci-pxav3.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
index 6f842fb..2706d3f 100644
--- a/drivers/mmc/host/sdhci-pxav3.c
+++ b/drivers/mmc/host/sdhci-pxav3.c
@@ -417,8 +417,7 @@ static int sdhci_pxav3_suspend(struct device *dev)
pm_runtime_get_sync(dev);
ret = sdhci_suspend_host(host);
- pm_runtime_mark_last_busy(dev);
- pm_runtime_put_autosuspend(dev);
+ pm_runtime_last_busy_and_autosuspend(dev);
return ret;
}
@@ -430,8 +429,7 @@ static int sdhci_pxav3_resume(struct device *dev)
pm_runtime_get_sync(dev);
ret = sdhci_resume_host(host);
- pm_runtime_mark_last_busy(dev);
- pm_runtime_put_autosuspend(dev);
+ pm_runtime_last_busy_and_autosuspend(dev);
return ret;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 18/27] mmc: sdhci: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (16 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 17/27] mmc: sdhci-pxav3: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 19/27] NFC: trf7970a: " Vinod Koul
` (10 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Chris Ball, Ulf Hansson, linux-mmc
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/mmc/host/sdhci.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 37b2a9a..862346a 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2623,8 +2623,7 @@ static int sdhci_runtime_pm_get(struct sdhci_host *host)
static int sdhci_runtime_pm_put(struct sdhci_host *host)
{
- pm_runtime_mark_last_busy(host->mmc->parent);
- return pm_runtime_put_autosuspend(host->mmc->parent);
+ return pm_runtime_last_busy_and_autosuspend(host->mmc->parent);
}
static void sdhci_runtime_pm_bus_on(struct sdhci_host *host)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 19/27] NFC: trf7970a: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (17 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 18/27] mmc: sdhci: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 20/27] pm2301-charger: " Vinod Koul
` (9 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Lauro Ramos Venancio,
Aloisio Almeida Jr, Samuel Ortiz, linux-wireless, linux-nfc
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/nfc/trf7970a.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 3b78b03..d22ca2f 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -801,8 +801,7 @@ static void trf7970a_switch_rf_off(struct trf7970a *trf)
trf->aborting = false;
trf->state = TRF7970A_ST_OFF;
- pm_runtime_mark_last_busy(trf->dev);
- pm_runtime_put_autosuspend(trf->dev);
+ pm_runtime_last_busy_and_autosuspend(trf->dev);
}
static void trf7970a_switch_rf_on(struct trf7970a *trf)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 20/27] pm2301-charger: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (18 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 19/27] NFC: trf7970a: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 21/27] spi: omap2-mcspi: " Vinod Koul
` (8 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Sebastian Reichel,
Dmitry Eremin-Solenikov, David Woodhouse, linux-pm
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/power/pm2301_charger.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/power/pm2301_charger.c b/drivers/power/pm2301_charger.c
index 62c15af..673b203 100644
--- a/drivers/power/pm2301_charger.c
+++ b/drivers/power/pm2301_charger.c
@@ -499,8 +499,7 @@ static irqreturn_t pm2xxx_irq_int(int irq, void *data)
}
} while (gpio_get_value(pm2->pdata->gpio_irq_number) == 0);
- pm_runtime_mark_last_busy(pm2->dev);
- pm_runtime_put_autosuspend(pm2->dev);
+ pm_runtime_last_busy_and_autosuspend(pm2->dev);
return IRQ_HANDLED;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 21/27] spi: omap2-mcspi: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (19 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 20/27] pm2301-charger: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:58 ` Mark Brown
2014-09-25 13:03 ` Mark Brown
2014-09-24 16:15 ` [PATCH 22/27] spi: orion: " Vinod Koul
` (7 subsequent siblings)
28 siblings, 2 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel; +Cc: subhransu.s.prusty, vinod.koul, Mark Brown, linux-spi
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/spi/spi-omap2-mcspi.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 68441fa..fa2aae8 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1020,8 +1020,7 @@ static int omap2_mcspi_setup(struct spi_device *spi)
return ret;
ret = omap2_mcspi_setup_transfer(spi, NULL);
- pm_runtime_mark_last_busy(mcspi->dev);
- pm_runtime_put_autosuspend(mcspi->dev);
+ pm_runtime_last_busy_and_autosuspend(mcspi->dev);
return ret;
}
@@ -1282,8 +1281,7 @@ static int omap2_mcspi_master_setup(struct omap2_mcspi *mcspi)
ctx->wakeupenable = OMAP2_MCSPI_WAKEUPENABLE_WKEN;
omap2_mcspi_set_master_mode(master);
- pm_runtime_mark_last_busy(mcspi->dev);
- pm_runtime_put_autosuspend(mcspi->dev);
+ pm_runtime_last_busy_and_autosuspend(mcspi->dev);
return 0;
}
@@ -1504,8 +1502,7 @@ static int omap2_mcspi_resume(struct device *dev)
writel_relaxed(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);
}
}
- pm_runtime_mark_last_busy(mcspi->dev);
- pm_runtime_put_autosuspend(mcspi->dev);
+ pm_runtime_last_busy_and_autosuspend(mcspi->dev);
return 0;
}
#else
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 22/27] spi: orion: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (20 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 21/27] spi: omap2-mcspi: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-25 13:03 ` Mark Brown
2014-09-24 16:15 ` [PATCH 23/27] spi: ti-qspi: " Vinod Koul
` (6 subsequent siblings)
28 siblings, 1 reply; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel; +Cc: subhransu.s.prusty, vinod.koul, Mark Brown, linux-spi
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/spi/spi-orion.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-orion.c b/drivers/spi/spi-orion.c
index c4675fa..3f14578 100644
--- a/drivers/spi/spi-orion.c
+++ b/drivers/spi/spi-orion.c
@@ -408,8 +408,7 @@ static int orion_spi_probe(struct platform_device *pdev)
if (status < 0)
goto out_rel_pm;
- pm_runtime_mark_last_busy(&pdev->dev);
- pm_runtime_put_autosuspend(&pdev->dev);
+ pm_runtime_last_busy_and_autosuspend(&pdev->dev);
master->dev.of_node = pdev->dev.of_node;
status = spi_register_master(master);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 23/27] spi: ti-qspi: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (21 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 22/27] spi: orion: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-25 13:04 ` Mark Brown
2014-09-24 16:15 ` [PATCH 24/27] spi: core: " Vinod Koul
` (5 subsequent siblings)
28 siblings, 1 reply; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel; +Cc: subhransu.s.prusty, vinod.koul, Mark Brown, linux-spi
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/spi/spi-ti-qspi.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c
index 6c211d1..3a57173 100644
--- a/drivers/spi/spi-ti-qspi.c
+++ b/drivers/spi/spi-ti-qspi.c
@@ -182,10 +182,9 @@ static int ti_qspi_setup(struct spi_device *spi)
ti_qspi_write(qspi, clk_mask, QSPI_SPI_CLOCK_CNTRL_REG);
ctx_reg->clkctrl = clk_mask;
- pm_runtime_mark_last_busy(qspi->dev);
- ret = pm_runtime_put_autosuspend(qspi->dev);
+ pm_runtime_last_busy_and_autosuspend(qspi->dev);
if (ret < 0) {
- dev_err(qspi->dev, "pm_runtime_put_autosuspend() failed\n");
+ dev_err(qspi->dev, "pm_runtime_last_busy_and_autosuspend() failed\n");
return ret;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 24/27] spi: core: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (22 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 23/27] spi: ti-qspi: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-25 13:04 ` Mark Brown
2014-09-24 16:15 ` [PATCH 25/27] tty: serial: omap: " Vinod Koul
` (4 subsequent siblings)
28 siblings, 1 reply; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel; +Cc: subhransu.s.prusty, vinod.koul, Mark Brown, linux-spi
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/spi/spi.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index e0531ba..6ec5330 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -893,10 +893,8 @@ static void spi_pump_messages(struct kthread_work *work)
master->unprepare_transfer_hardware(master))
dev_err(&master->dev,
"failed to unprepare transfer hardware\n");
- if (master->auto_runtime_pm) {
- pm_runtime_mark_last_busy(master->dev.parent);
- pm_runtime_put_autosuspend(master->dev.parent);
- }
+ if (master->auto_runtime_pm)
+ pm_runtime_last_busy_and_autosuspend(master->dev.parent);
trace_spi_master_idle(master);
return;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 25/27] tty: serial: omap: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (23 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 24/27] spi: core: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 26/27] usb: musb: omap2430: " Vinod Koul
` (3 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Greg Kroah-Hartman, Jiri Slaby,
linux-serial
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/tty/serial/omap-serial.c | 60 ++++++++++++-------------------------
1 files changed, 20 insertions(+), 40 deletions(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index d017cec..83a50ca 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -290,8 +290,7 @@ static void serial_omap_enable_ms(struct uart_port *port)
pm_runtime_get_sync(up->dev);
up->ier |= UART_IER_MSI;
serial_out(up, UART_IER, up->ier);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static void serial_omap_stop_tx(struct uart_port *port)
@@ -352,8 +351,7 @@ static void serial_omap_stop_tx(struct uart_port *port)
serial_out(up, UART_IER, up->ier);
}
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static void serial_omap_stop_rx(struct uart_port *port)
@@ -364,8 +362,7 @@ static void serial_omap_stop_rx(struct uart_port *port)
up->ier &= ~(UART_IER_RLSI | UART_IER_RDI);
up->port.read_status_mask &= ~UART_LSR_DR;
serial_out(up, UART_IER, up->ier);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static void transmit_chars(struct uart_omap_port *up, unsigned int lsr)
@@ -434,8 +431,7 @@ static void serial_omap_start_tx(struct uart_port *port)
serial_omap_stop_rx(port);
serial_omap_enable_ier_thri(up);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static void serial_omap_throttle(struct uart_port *port)
@@ -448,8 +444,7 @@ static void serial_omap_throttle(struct uart_port *port)
up->ier &= ~(UART_IER_RLSI | UART_IER_RDI);
serial_out(up, UART_IER, up->ier);
spin_unlock_irqrestore(&up->port.lock, flags);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static void serial_omap_unthrottle(struct uart_port *port)
@@ -462,8 +457,7 @@ static void serial_omap_unthrottle(struct uart_port *port)
up->ier |= UART_IER_RLSI | UART_IER_RDI;
serial_out(up, UART_IER, up->ier);
spin_unlock_irqrestore(&up->port.lock, flags);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static unsigned int check_modem_status(struct uart_omap_port *up)
@@ -616,8 +610,7 @@ static irqreturn_t serial_omap_irq(int irq, void *dev_id)
tty_flip_buffer_push(&up->port.state->port);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
up->port_activity = jiffies;
return ret;
@@ -634,8 +627,7 @@ static unsigned int serial_omap_tx_empty(struct uart_port *port)
spin_lock_irqsave(&up->port.lock, flags);
ret = serial_in(up, UART_LSR) & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
spin_unlock_irqrestore(&up->port.lock, flags);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
return ret;
}
@@ -647,8 +639,7 @@ static unsigned int serial_omap_get_mctrl(struct uart_port *port)
pm_runtime_get_sync(up->dev);
status = check_modem_status(up);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
dev_dbg(up->port.dev, "serial_omap_get_mctrl+%d\n", up->port.line);
@@ -686,8 +677,7 @@ static void serial_omap_set_mctrl(struct uart_port *port, unsigned int mctrl)
UART_MCR_DTR | UART_MCR_RTS);
up->mcr = old_mcr | mcr;
serial_out(up, UART_MCR, up->mcr);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static void serial_omap_break_ctl(struct uart_port *port, int break_state)
@@ -704,8 +694,7 @@ static void serial_omap_break_ctl(struct uart_port *port, int break_state)
up->lcr &= ~UART_LCR_SBC;
serial_out(up, UART_LCR, up->lcr);
spin_unlock_irqrestore(&up->port.lock, flags);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static int serial_omap_startup(struct uart_port *port)
@@ -781,8 +770,7 @@ static int serial_omap_startup(struct uart_port *port)
serial_out(up, UART_OMAP_WER, up->wer);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
up->port_activity = jiffies;
return 0;
}
@@ -818,8 +806,7 @@ static void serial_omap_shutdown(struct uart_port *port)
if (serial_in(up, UART_LSR) & UART_LSR_DR)
(void) serial_in(up, UART_RX);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
free_irq(up->port.irq, up);
if (up->wakeirq)
free_irq(up->wakeirq, up);
@@ -1088,8 +1075,7 @@ serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
serial_omap_set_mctrl(&up->port, up->port.mctrl);
spin_unlock_irqrestore(&up->port.lock, flags);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
dev_dbg(up->port.dev, "serial_omap_set_termios+%d\n", up->port.line);
}
@@ -1120,8 +1106,7 @@ serial_omap_pm(struct uart_port *port, unsigned int state,
pm_runtime_allow(up->dev);
}
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static void serial_omap_release_port(struct uart_port *port)
@@ -1204,8 +1189,7 @@ static void serial_omap_poll_put_char(struct uart_port *port, unsigned char ch)
pm_runtime_get_sync(up->dev);
wait_for_xmitr(up);
serial_out(up, UART_TX, ch);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static int serial_omap_poll_get_char(struct uart_port *port)
@@ -1223,8 +1207,7 @@ static int serial_omap_poll_get_char(struct uart_port *port)
status = serial_in(up, UART_RX);
out:
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
return status;
}
@@ -1288,8 +1271,7 @@ serial_omap_console_write(struct console *co, const char *s,
if (up->msr_saved_flags)
check_modem_status(up);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
if (locked)
spin_unlock(&up->port.lock);
local_irq_restore(flags);
@@ -1387,8 +1369,7 @@ serial_omap_config_rs485(struct uart_port *port, struct serial_rs485 *rs485conf)
}
spin_unlock_irqrestore(&up->port.lock, flags);
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
}
static int
@@ -1724,8 +1705,7 @@ static int serial_omap_probe(struct platform_device *pdev)
if (ret != 0)
goto err_add_port;
- pm_runtime_mark_last_busy(up->dev);
- pm_runtime_put_autosuspend(up->dev);
+ pm_runtime_last_busy_and_autosuspend(up->dev);
return 0;
err_add_port:
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 26/27] usb: musb: omap2430: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (24 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 25/27] tty: serial: omap: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 27/27] video: fbdev: " Vinod Koul
` (2 subsequent siblings)
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Felipe Balbi, Greg Kroah-Hartman,
linux-usb, linux-omap
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/usb/musb/omap2430.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index d369bf1..17c6c49 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -293,8 +293,7 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue)
musb->xceiv->last_event = USB_EVENT_NONE;
if (musb->gadget_driver) {
omap2430_musb_set_vbus(musb, 0);
- pm_runtime_mark_last_busy(dev);
- pm_runtime_put_autosuspend(dev);
+ pm_runtime_last_busy_and_autosuspend(dev);
}
if (data->interface_type == MUSB_INTERFACE_UTMI)
@@ -321,8 +320,7 @@ static void omap_musb_mailbox_work(struct work_struct *mailbox_work)
pm_runtime_get_sync(dev);
omap_musb_set_mailbox(glue);
- pm_runtime_mark_last_busy(dev);
- pm_runtime_put_autosuspend(dev);
+ pm_runtime_last_busy_and_autosuspend(dev);
}
static irqreturn_t omap2430_musb_interrupt(int irq, void *__hci)
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* [PATCH 27/27] video: fbdev: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (25 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 26/27] usb: musb: omap2430: " Vinod Koul
@ 2014-09-24 16:15 ` Vinod Koul
2014-09-24 20:28 ` [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Rafael J. Wysocki
[not found] ` <20140925142201.GD28045@saruman>
28 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:15 UTC (permalink / raw)
To: linux-kernel
Cc: subhransu.s.prusty, vinod.koul, Jean-Christophe Plagniol-Villard,
Tomi Valkeinen, Jingoo Han, Laurent Pinchart, Rob Clark,
Daniel Vetter, linux-fbdev
Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
coding the same code
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
drivers/video/fbdev/auo_k190x.c | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c
index 8d2499d..e12f513 100644
--- a/drivers/video/fbdev/auo_k190x.c
+++ b/drivers/video/fbdev/auo_k190x.c
@@ -354,8 +354,7 @@ static void auok190xfb_dpy_deferred_io(struct fb_info *info,
par->update_partial(par, y1, min((u16) (y1 + h), yres));
out:
- pm_runtime_mark_last_busy(info->device);
- pm_runtime_put_autosuspend(info->device);
+ pm_runtime_last_busy_and_autosuspend(info->device);
}
/*
@@ -591,8 +590,7 @@ static int auok190x_read_temperature(struct auok190xfb_par *par)
mutex_unlock(&(par->io_lock));
- pm_runtime_mark_last_busy(dev);
- pm_runtime_put_autosuspend(dev);
+ pm_runtime_last_busy_and_autosuspend(dev);
/* sanitize and split of half-degrees for now */
temp = ((data[0] & AUOK190X_VERSION_TEMP_MASK) >> 1);
@@ -630,8 +628,7 @@ static void auok190x_identify(struct auok190xfb_par *par)
par->panel_size_int, par->panel_size_float, par->panel_model,
par->epd_type, par->tcon_version, par->lut_version);
- pm_runtime_mark_last_busy(dev);
- pm_runtime_put_autosuspend(dev);
+ pm_runtime_last_busy_and_autosuspend(dev);
}
/*
--
1.7.0.4
^ permalink raw reply related [flat|nested] 53+ messages in thread
* Re: [PATCH 21/27] spi: omap2-mcspi: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:58 ` Mark Brown
@ 2014-09-24 16:39 ` Vinod Koul
0 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-24 16:39 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, subhransu.s.prusty, linux-spi
[-- Attachment #1: Type: text/plain, Size: 665 bytes --]
On Wed, Sep 24, 2014 at 05:58:55PM +0100, Mark Brown wrote:
> On Wed, Sep 24, 2014 at 09:45:11PM +0530, Vinod Koul wrote:
> > Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> > coding the same code
>
> You haven't CCed me on anything earlier in the series so I've no idea
> what's going on here but it looks like there is probably some
> dependency?
And thats very surprsing :(
I used the Wolfram's cocci_cc script to auto cc and add everyone to cover
letter . Looks like it missed some. Sorry about that I should have been more
careful
FWIW here is cover letter https://lkml.org/lkml/2014/9/24/862
Thanks
--
~Vinod
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 21/27] spi: omap2-mcspi: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 21/27] spi: omap2-mcspi: " Vinod Koul
@ 2014-09-24 16:58 ` Mark Brown
2014-09-24 16:39 ` Vinod Koul
2014-09-25 13:03 ` Mark Brown
1 sibling, 1 reply; 53+ messages in thread
From: Mark Brown @ 2014-09-24 16:58 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-kernel, subhransu.s.prusty, linux-spi
[-- Attachment #1: Type: text/plain, Size: 302 bytes --]
On Wed, Sep 24, 2014 at 09:45:11PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
You haven't CCed me on anything earlier in the series so I've no idea
what's going on here but it looks like there is probably some
dependency?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend()
2014-09-24 16:14 ` [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend() Vinod Koul
@ 2014-09-24 17:54 ` Pavel Machek
2014-09-25 8:00 ` Vinod Koul
2014-09-25 8:13 ` Ulf Hansson
1 sibling, 1 reply; 53+ messages in thread
From: Pavel Machek @ 2014-09-24 17:54 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, subhransu.s.prusty, Rafael J. Wysocki, Len Brown,
Randy Dunlap, Ulf Hansson, Alan Stern, linux-pm, linux-doc
On Wed 2014-09-24 21:44:51, Vinod Koul wrote:
> From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
>
> pm_runtime_mark_last_busy and pm_runtime_put_autosuspend are used together
> in quite a lot of places. Add a helper for these.
> Also updated Documentation for this
With function name as long as the implementation... I'm not sure if
this is good helper :-).
Pavel
> +static inline int pm_runtime_last_busy_and_autosuspend(struct device *dev)
> +{
> + pm_runtime_mark_last_busy(dev);
> + return pm_runtime_put_autosuspend(dev);
> +}
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 04/27] drm/i915: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 ` [PATCH 04/27] drm/i915: " Vinod Koul
@ 2014-09-24 18:35 ` Daniel Vetter
0 siblings, 0 replies; 53+ messages in thread
From: Daniel Vetter @ 2014-09-24 18:35 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, subhransu.s.prusty, Daniel Vetter, Jani Nikula,
David Airlie, intel-gfx, dri-devel
On Wed, Sep 24, 2014 at 09:44:54PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Ack to merge through whatever tree is appropriate for this. Or tell me
when I should pick this up for drm-intel.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_pm.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 40c1229..1ec9b8d 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -6729,8 +6729,7 @@ void intel_runtime_pm_put(struct drm_i915_private *dev_priv)
> if (!HAS_RUNTIME_PM(dev))
> return;
>
> - pm_runtime_mark_last_busy(device);
> - pm_runtime_put_autosuspend(device);
> + pm_runtime_last_busy_and_autosuspend(device);
> }
>
> void intel_init_runtime_pm(struct drm_i915_private *dev_priv)
> --
> 1.7.0.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
` (26 preceding siblings ...)
2014-09-24 16:15 ` [PATCH 27/27] video: fbdev: " Vinod Koul
@ 2014-09-24 20:28 ` Rafael J. Wysocki
2014-09-25 7:46 ` Vinod Koul
[not found] ` <20140925142201.GD28045@saruman>
28 siblings, 1 reply; 53+ messages in thread
From: Rafael J. Wysocki @ 2014-09-24 20:28 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, subhransu.s.prusty, Alan Stern, Alexandre Courbot,
Andrew Morton, Andy Gross, Baruch Siach, Ben Skeggs,
Bjorn Andersson, Chew, Chiau Ee, Chris Ball, Dan Carpenter,
Daniel Vetter, Dave Airlie, David Herrmann, dmaengine, dri-devel,
Du, Wenkai, Grant Grundler, Ilia Mirkin, intel-gfx,
Ivan T. Ivanov, Jaehoon Chung, Jani Nikula, Jingoo Han,
Laurent Pinchart, Laurent Pinchart, linux-arm-kernel, linux-doc,
linux-fbdev, linux-i2c, linux-mmc, linux-nfc, linux-omap,
linux-pm, linux-serial, linux-spi, linux-usb, linux-wireless,
Marcin Wojtas, Mika Westerberg, patches, Pramod Gurav,
Rafael J. Wysocki, Rob Clark, Romain Baeriswyl, Russell King,
Seungwon Jeon, Shinya Kuribayashi, Thierry Reding, Tim Kryger,
Tomi Valkeinen, Ulf Hansson, Wolfram Sang
On Wednesday, September 24, 2014 09:44:50 PM Vinod Koul wrote:
> This patch series adds a simple macro pm_runtime_last_busy_and_autosuspend()
> which invokes pm_runtime_mark_last_busy() and pm_runtime_put_autosuspend()
> sequentially. Then we do a tree wide update of current patterns which are
> present. As evident from log below this pattern is frequent in the
> kernel.
>
> This series can be found at
> git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/slave-dma.git
> topic/pm_runtime_last_busy_and_autosuspend
>
> Fengguang's kbuild has tested it so it shouldn't break things for anyone.
> Barring one patch (explictyly mentioned in its changelog) rest are simple
> replacements.
>
> If all are okay, this should be merged thru PM tree as it depends on macro
> addition.
>
> Subhransu S. Prusty (1):
> PM: Add helper pm_runtime_last_busy_and_autosuspend()
>
> Vinod Koul (26):
> dmaengine: ste_dma: use pm_runtime_last_busy_and_autosuspend helper
> extcon: arizona: use pm_runtime_last_busy_and_autosuspend helper
> drm/i915: use pm_runtime_last_busy_and_autosuspend helper
> drm/nouveau: use pm_runtime_last_busy_and_autosuspend helper
> drm/radeon: use pm_runtime_last_busy_and_autosuspend helper
> vga_switcheroo: use pm_runtime_last_busy_and_autosuspend helper
> i2c: designware: use pm_runtime_last_busy_and_autosuspend helper
> i2c: omap: use pm_runtime_last_busy_and_autosuspend helper
> i2c: qup: use pm_runtime_last_busy_and_autosuspend helper
> mfd: ab8500-gpadc: use pm_runtime_last_busy_and_autosuspend helper
> mfd: arizona: use pm_runtime_last_busy_and_autosuspend helper
> mei: use pm_runtime_last_busy_and_autosuspend helper
> mmc: use pm_runtime_last_busy_and_autosuspend helper
> mmc: mmci: use pm_runtime_last_busy_and_autosuspend helper
> mmc: omap_hsmmc: use pm_runtime_last_busy_and_autosuspend helper
> mmc: sdhci-pxav3: use pm_runtime_last_busy_and_autosuspend helper
> mmc: sdhci: use pm_runtime_last_busy_and_autosuspend helper
> NFC: trf7970a: use pm_runtime_last_busy_and_autosuspend helper
> pm2301-charger: use pm_runtime_last_busy_and_autosuspend helper
> spi: omap2-mcspi: use pm_runtime_last_busy_and_autosuspend helper
> spi: orion: use pm_runtime_last_busy_and_autosuspend helper
> spi: ti-qspi: use pm_runtime_last_busy_and_autosuspend helper
> spi: core: use pm_runtime_last_busy_and_autosuspend helper
> tty: serial: omap: use pm_runtime_last_busy_and_autosuspend helper
> usb: musb: omap2430: use pm_runtime_last_busy_and_autosuspend helper
> video: fbdev: use pm_runtime_last_busy_and_autosuspend helper
>
> Documentation/power/runtime_pm.txt | 4 ++
> drivers/dma/ste_dma40.c | 30 ++++---------
> drivers/extcon/extcon-arizona.c | 6 +--
> drivers/gpu/drm/i915/intel_pm.c | 3 +-
> drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +-
> drivers/gpu/drm/nouveau/nouveau_drm.c | 9 +---
> drivers/gpu/drm/radeon/radeon_connectors.c | 15 ++----
> drivers/gpu/drm/radeon/radeon_drv.c | 5 +-
> drivers/gpu/drm/radeon/radeon_kms.c | 6 +--
> drivers/gpu/vga/vga_switcheroo.c | 7 +--
> drivers/i2c/busses/i2c-designware-core.c | 3 +-
> drivers/i2c/busses/i2c-omap.c | 6 +--
> drivers/i2c/busses/i2c-qup.c | 3 +-
> drivers/mfd/ab8500-gpadc.c | 6 +--
> drivers/mfd/arizona-irq.c | 3 +-
> drivers/misc/mei/client.c | 12 ++----
> drivers/mmc/core/core.c | 3 +-
> drivers/mmc/host/mmci.c | 12 ++----
> drivers/mmc/host/omap_hsmmc.c | 19 ++-------
> drivers/mmc/host/sdhci-pxav3.c | 6 +--
> drivers/mmc/host/sdhci.c | 3 +-
> drivers/nfc/trf7970a.c | 3 +-
> drivers/power/pm2301_charger.c | 3 +-
> drivers/spi/spi-omap2-mcspi.c | 9 +---
> drivers/spi/spi-orion.c | 3 +-
> drivers/spi/spi-ti-qspi.c | 5 +-
> drivers/spi/spi.c | 6 +--
> drivers/tty/serial/omap-serial.c | 60 +++++++++------------------
> drivers/usb/musb/omap2430.c | 6 +--
> drivers/video/fbdev/auo_k190x.c | 9 +---
> include/linux/pm_runtime.h | 6 +++
> 31 files changed, 97 insertions(+), 177 deletions(-)
OK, I guess this is as good as it gets.
What tree would you like it go through?
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 07/27] vga_switcheroo: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 ` [PATCH 07/27] vga_switcheroo: " Vinod Koul
@ 2014-09-24 20:37 ` Alex Deucher
0 siblings, 0 replies; 53+ messages in thread
From: Alex Deucher @ 2014-09-24 20:37 UTC (permalink / raw)
To: Vinod Koul; +Cc: LKML, subhransu.s.prusty, Maling list - DRI developers
On Wed, Sep 24, 2014 at 12:14 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/vga/vga_switcheroo.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
> index 6866448..697ffbd 100644
> --- a/drivers/gpu/vga/vga_switcheroo.c
> +++ b/drivers/gpu/vga/vga_switcheroo.c
> @@ -682,10 +682,9 @@ static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
> ret = dev->bus->pm->runtime_resume(dev);
>
> /* put the reference for the gpu */
> - if (found) {
> - pm_runtime_mark_last_busy(&found->pdev->dev);
> - pm_runtime_put_autosuspend(&found->pdev->dev);
> - }
> + if (found)
> + pm_runtime_last_busy_and_autosuspend(&found->pdev->dev);
> +
> return ret;
> }
>
> --
> 1.7.0.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 06/27] drm/radeon: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 ` [PATCH 06/27] drm/radeon: " Vinod Koul
@ 2014-09-24 20:37 ` Alex Deucher
0 siblings, 0 replies; 53+ messages in thread
From: Alex Deucher @ 2014-09-24 20:37 UTC (permalink / raw)
To: Vinod Koul
Cc: LKML, Maling list - DRI developers, Alex Deucher,
subhransu.s.prusty, Christian König
On Wed, Sep 24, 2014 at 12:14 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
I don't care which tree this goes through.
> ---
> drivers/gpu/drm/radeon/radeon_connectors.c | 15 +++++----------
> drivers/gpu/drm/radeon/radeon_drv.c | 5 ++---
> drivers/gpu/drm/radeon/radeon_kms.c | 6 ++----
> 3 files changed, 9 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
> index 300c4b3..b48cf9d 100644
> --- a/drivers/gpu/drm/radeon/radeon_connectors.c
> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c
> @@ -852,8 +852,7 @@ radeon_lvds_detect(struct drm_connector *connector, bool force)
> /* check acpi lid status ??? */
>
> radeon_connector_update_scratch_regs(connector, ret);
> - pm_runtime_mark_last_busy(connector->dev->dev);
> - pm_runtime_put_autosuspend(connector->dev->dev);
> + pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
> return ret;
> }
>
> @@ -1025,8 +1024,7 @@ radeon_vga_detect(struct drm_connector *connector, bool force)
> radeon_connector_update_scratch_regs(connector, ret);
>
> out:
> - pm_runtime_mark_last_busy(connector->dev->dev);
> - pm_runtime_put_autosuspend(connector->dev->dev);
> + pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
>
> return ret;
> }
> @@ -1103,8 +1101,7 @@ radeon_tv_detect(struct drm_connector *connector, bool force)
> if (ret == connector_status_connected)
> ret = radeon_connector_analog_encoder_conflict_solve(connector, encoder, ret, false);
> radeon_connector_update_scratch_regs(connector, ret);
> - pm_runtime_mark_last_busy(connector->dev->dev);
> - pm_runtime_put_autosuspend(connector->dev->dev);
> + pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
> return ret;
> }
>
> @@ -1321,8 +1318,7 @@ out:
> radeon_connector_update_scratch_regs(connector, ret);
>
> exit:
> - pm_runtime_mark_last_busy(connector->dev->dev);
> - pm_runtime_put_autosuspend(connector->dev->dev);
> + pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
>
> return ret;
> }
> @@ -1638,8 +1634,7 @@ radeon_dp_detect(struct drm_connector *connector, bool force)
>
> radeon_connector_update_scratch_regs(connector, ret);
> out:
> - pm_runtime_mark_last_busy(connector->dev->dev);
> - pm_runtime_put_autosuspend(connector->dev->dev);
> + pm_runtime_last_busy_and_autosuspend(connector->dev->dev);
>
> return ret;
> }
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index 092d067..548d129 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -503,9 +503,8 @@ long radeon_drm_ioctl(struct file *filp,
> return ret;
>
> ret = drm_ioctl(filp, cmd, arg);
> -
> - pm_runtime_mark_last_busy(dev->dev);
> - pm_runtime_put_autosuspend(dev->dev);
> +
> + pm_runtime_last_busy_and_autosuspend(dev->dev);
> return ret;
> }
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
> index eb7164d..80f061d 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -147,8 +147,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
> pm_runtime_set_autosuspend_delay(dev->dev, 5000);
> pm_runtime_set_active(dev->dev);
> pm_runtime_allow(dev->dev);
> - pm_runtime_mark_last_busy(dev->dev);
> - pm_runtime_put_autosuspend(dev->dev);
> + pm_runtime_last_busy_and_autosuspend(dev->dev);
> }
>
> out:
> @@ -632,8 +631,7 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
> file_priv->driver_priv = fpriv;
> }
>
> - pm_runtime_mark_last_busy(dev->dev);
> - pm_runtime_put_autosuspend(dev->dev);
> + pm_runtime_last_busy_and_autosuspend(dev->dev);
> return 0;
> }
>
> --
> 1.7.0.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 03/27] extcon: arizona: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 ` [PATCH 03/27] extcon: arizona: " Vinod Koul
@ 2014-09-25 1:05 ` Chanwoo Choi
2014-09-25 8:10 ` Charles Keepax
1 sibling, 0 replies; 53+ messages in thread
From: Chanwoo Choi @ 2014-09-25 1:05 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-kernel, subhransu.s.prusty, MyungJoo Ham, patches
On 09/25/2014 01:14 AM, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
> drivers/extcon/extcon-arizona.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
> index ba51588..7774e80 100644
> --- a/drivers/extcon/extcon-arizona.c
> +++ b/drivers/extcon/extcon-arizona.c
> @@ -323,8 +323,7 @@ static void arizona_stop_mic(struct arizona_extcon_info *info)
>
> if (change) {
> regulator_disable(info->micvdd);
> - pm_runtime_mark_last_busy(info->dev);
> - pm_runtime_put_autosuspend(info->dev);
> + pm_runtime_last_busy_and_autosuspend(info->dev);
> }
> }
>
> @@ -1077,8 +1076,7 @@ out:
>
> mutex_unlock(&info->lock);
>
> - pm_runtime_mark_last_busy(info->dev);
> - pm_runtime_put_autosuspend(info->dev);
> + pm_runtime_last_busy_and_autosuspend(info->dev);
>
> return IRQ_HANDLED;
> }
>
Looks good to me about this patch.
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Thanks,
Chanwoo Choi
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper
2014-09-24 20:28 ` [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Rafael J. Wysocki
@ 2014-09-25 7:46 ` Vinod Koul
0 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-25 7:46 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: linux-kernel, subhransu.s.prusty, Alan Stern, Alexandre Courbot,
Andrew Morton, Andy Gross, Baruch Siach, Ben Skeggs,
Bjorn Andersson, Chew, Chiau Ee, Chris Ball, Dan Carpenter,
Daniel Vetter, Dave Airlie, David Herrmann, dmaengine, dri-devel,
Du, Wenkai, Grant Grundler, Ilia Mirkin, intel-gfx,
Ivan T. Ivanov, Jaehoon Chung, Jani Nikula, Jingoo Han,
Laurent Pinchart, Laurent Pinchart, linux-arm-kernel, linux-doc,
linux-fbdev, linux-i2c, linux-mmc, linux-nfc, linux-omap,
linux-pm, linux-serial, linux-spi, linux-usb, linux-wireless,
Marcin Wojtas, Mika Westerberg, patches, Pramod Gurav,
Rafael J. Wysocki, Rob Clark, Romain Baeriswyl, Russell King,
Seungwon Jeon, Shinya Kuribayashi, Thierry Reding, Tim Kryger,
Tomi Valkeinen, Ulf Hansson, Wolfram Sang
On Wed, Sep 24, 2014 at 10:28:07PM +0200, Rafael J. Wysocki wrote:
>
> OK, I guess this is as good as it gets.
>
> What tree would you like it go through?
Since rest of the patches are dependent upon 1st patch which should go thru
your tree, we should merge this thru your tree
Thanks
--
~Vinod
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend()
2014-09-24 17:54 ` Pavel Machek
@ 2014-09-25 8:00 ` Vinod Koul
0 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-09-25 8:00 UTC (permalink / raw)
To: Pavel Machek
Cc: linux-kernel, subhransu.s.prusty, Rafael J. Wysocki, Len Brown,
Randy Dunlap, Ulf Hansson, Alan Stern, linux-pm, linux-doc
On Wed, Sep 24, 2014 at 07:54:10PM +0200, Pavel Machek wrote:
> On Wed 2014-09-24 21:44:51, Vinod Koul wrote:
> > From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> >
> > pm_runtime_mark_last_busy and pm_runtime_put_autosuspend are used together
> > in quite a lot of places. Add a helper for these.
> > Also updated Documentation for this
>
> With function name as long as the implementation... I'm not sure if
> this is good helper :-).
am all ears if that is a general consensus to cut down on length and
suggestions welcome :)
--
~Vinod
> Pavel
>
> > +static inline int pm_runtime_last_busy_and_autosuspend(struct device *dev)
> > +{
> > + pm_runtime_mark_last_busy(dev);
> > + return pm_runtime_put_autosuspend(dev);
> > +}
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 03/27] extcon: arizona: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 ` [PATCH 03/27] extcon: arizona: " Vinod Koul
2014-09-25 1:05 ` Chanwoo Choi
@ 2014-09-25 8:10 ` Charles Keepax
1 sibling, 0 replies; 53+ messages in thread
From: Charles Keepax @ 2014-09-25 8:10 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, Chanwoo Choi, MyungJoo Ham, subhransu.s.prusty, patches
On Wed, Sep 24, 2014 at 09:44:53PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 12/27] mfd: arizona: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 12/27] mfd: arizona: " Vinod Koul
@ 2014-09-25 8:10 ` Charles Keepax
2014-10-06 21:41 ` Lee Jones
1 sibling, 0 replies; 53+ messages in thread
From: Charles Keepax @ 2014-09-25 8:10 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, Lee Jones, patches, subhransu.s.prusty, Samuel Ortiz
On Wed, Sep 24, 2014 at 09:45:02PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend()
2014-09-24 16:14 ` [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend() Vinod Koul
2014-09-24 17:54 ` Pavel Machek
@ 2014-09-25 8:13 ` Ulf Hansson
1 sibling, 0 replies; 53+ messages in thread
From: Ulf Hansson @ 2014-09-25 8:13 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, subhransu.s.prusty, Rafael J. Wysocki, Len Brown,
Pavel Machek, Randy Dunlap, Alan Stern, linux-pm, linux-doc
On 24 September 2014 18:14, Vinod Koul <vinod.koul@intel.com> wrote:
> From: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
>
> pm_runtime_mark_last_busy and pm_runtime_put_autosuspend are used together
> in quite a lot of places. Add a helper for these.
> Also updated Documentation for this
>
> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
> Documentation/power/runtime_pm.txt | 4 ++++
> include/linux/pm_runtime.h | 6 ++++++
> 2 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/power/runtime_pm.txt b/Documentation/power/runtime_pm.txt
> index f32ce54..5d9565b 100644
> --- a/Documentation/power/runtime_pm.txt
> +++ b/Documentation/power/runtime_pm.txt
> @@ -490,6 +490,10 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
> power.use_autosuspend isn't set, otherwise returns the expiration time
> in jiffies
>
> + int pm_runtime_last_busy_and_autosuspend(struct device *dev);
> + - invoke pm_runtime_mark_last_busy(dev) and then run
> + pm_runtime_put_autosuspend(dev) and return its result
> +
> It is safe to execute the following helper functions from interrupt context:
>
> pm_request_idle()
> diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
> index 367f49b..256ec50 100644
> --- a/include/linux/pm_runtime.h
> +++ b/include/linux/pm_runtime.h
> @@ -277,4 +277,10 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
> __pm_runtime_use_autosuspend(dev, false);
> }
>
> +static inline int pm_runtime_last_busy_and_autosuspend(struct device *dev)
This doesn't help code readability I think. The function name is quite
long as Pavel also pointed out. :-)
And, I also lack the "put" prefix, following the other functions in
the runtime PM API - which would make the name even longer. :-)
Kind regards
Uffe
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 21/27] spi: omap2-mcspi: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 21/27] spi: omap2-mcspi: " Vinod Koul
2014-09-24 16:58 ` Mark Brown
@ 2014-09-25 13:03 ` Mark Brown
1 sibling, 0 replies; 53+ messages in thread
From: Mark Brown @ 2014-09-25 13:03 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-kernel, subhransu.s.prusty, linux-spi
[-- Attachment #1: Type: text/plain, Size: 280 bytes --]
On Wed, Sep 24, 2014 at 09:45:11PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
Acked-by: Mark Brown <broonie@kernel.org>
though I have to say that the function name is rather spectacularly long
here.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 22/27] spi: orion: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 22/27] spi: orion: " Vinod Koul
@ 2014-09-25 13:03 ` Mark Brown
0 siblings, 0 replies; 53+ messages in thread
From: Mark Brown @ 2014-09-25 13:03 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-kernel, subhransu.s.prusty, linux-spi
[-- Attachment #1: Type: text/plain, Size: 200 bytes --]
On Wed, Sep 24, 2014 at 09:45:12PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 23/27] spi: ti-qspi: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 23/27] spi: ti-qspi: " Vinod Koul
@ 2014-09-25 13:04 ` Mark Brown
0 siblings, 0 replies; 53+ messages in thread
From: Mark Brown @ 2014-09-25 13:04 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-kernel, subhransu.s.prusty, linux-spi
[-- Attachment #1: Type: text/plain, Size: 200 bytes --]
On Wed, Sep 24, 2014 at 09:45:13PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 24/27] spi: core: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 24/27] spi: core: " Vinod Koul
@ 2014-09-25 13:04 ` Mark Brown
0 siblings, 0 replies; 53+ messages in thread
From: Mark Brown @ 2014-09-25 13:04 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-kernel, subhransu.s.prusty, linux-spi
[-- Attachment #1: Type: text/plain, Size: 200 bytes --]
On Wed, Sep 24, 2014 at 09:45:14PM +0530, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
Acked-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 02/27] dmaengine: ste_dma: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:14 ` [PATCH 02/27] dmaengine: ste_dma: use pm_runtime_last_busy_and_autosuspend helper Vinod Koul
@ 2014-09-25 13:19 ` Linus Walleij
0 siblings, 0 replies; 53+ messages in thread
From: Linus Walleij @ 2014-09-25 13:19 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, subhransu.s.prusty, Dan Williams, linux-arm-kernel,
dmaengine, Ulf Hansson
On Wed, Sep 24, 2014 at 6:14 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper
[not found] ` <20140925142758.GB1316@katana>
@ 2014-09-25 19:54 ` Rafael J. Wysocki
0 siblings, 0 replies; 53+ messages in thread
From: Rafael J. Wysocki @ 2014-09-25 19:54 UTC (permalink / raw)
To: Wolfram Sang, Vinod Koul
Cc: Felipe Balbi, linux-kernel, subhransu.s.prusty, Alan Stern,
Alexandre Courbot, Andrew Morton, Andy Gross, Baruch Siach,
Ben Skeggs, Bjorn Andersson, Chew, Chiau Ee, Chris Ball,
Dan Carpenter, Daniel Vetter, Dave Airlie, David Herrmann,
dmaengine, dri-devel, Du, Wenkai, Grant Grundler, Ilia Mirkin,
intel-gfx, Ivan T. Ivanov, Jaehoon Chung, Jani Nikula,
Jingoo Han, Laurent Pinchart, Laurent Pinchart, linux-arm-kernel,
linux-doc, linux-fbdev, linux-i2c, linux-mmc, linux-nfc,
linux-omap, linux-pm, linux-serial, linux-spi, linux-usb,
linux-wireless, Marcin Wojtas, Mika Westerberg, patches,
Pramod Gurav, Rafael J. Wysocki, Rob Clark, Romain Baeriswyl,
Russell King, Seungwon Jeon, Shinya Kuribayashi, Thierry Reding,
Tim Kryger, Tomi Valkeinen, Ulf Hansson
On Thursday, September 25, 2014 04:27:58 PM Wolfram Sang wrote:
>
> --Bn2rw/3z4jIqBvZU
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> On Thu, Sep 25, 2014 at 09:22:01AM -0500, Felipe Balbi wrote:
> > On Thu, Sep 25, 2014 at 01:27:18PM +0530, Vinod Koul wrote:
> > > On Wed, Sep 24, 2014 at 03:32:19PM -0500, Felipe Balbi wrote:
> > > > > > > OK, I guess this is as good as it gets.
> > > > > > >=20
> > > > > > > What tree would you like it go through?
> > > > > >=20
> > > > > > Do we really need this new helper ? I mean, the very moment when =
> we
> > > > > > decide to implement ->runtime_idle() we will need to get rid of t=
> his
> > > > > > change. I wonder if it's really valid...
> > > > >=20
> > > > > I'm not sure I'm following? This seems to simply implement what dr=
> ivers
> > > > > have been doing already as one function. Why would it be invalid t=
> o reduce
> > > > > code duplication?
> > > >=20
> > > > For two reasons:
> > > >=20
> > > > 1) the helper has no inteligence whatsoever. It just calls the same
> > > > functions.
> > > >=20
> > > > 2) the duplication will vanish whenever someone implements
> > > > ->runtime_idle() and have that call pm_runtime_autosuspend() (like PCI
> > > > and USB buses are doing today). This will just be yet another line th=
> at
> > > > needs to change.
> > > >=20
> > > > Frankly though, no strong feelings, I just think it's a commit that
> > > > doesn't bring that any benefits other than looking like one line was
> > > > removed.
> > > and yes that is what it tries to do nothing more nothing less. If in fu=
> ture
> > > there are no users (today we have quite a few), then we can remove the =
> dead
> > > macro, no harm. But that is not the situation today.
> >=20
> > as I said, a commit that's bound to be useless. It's not like you're
> > saving 10 lines of code, it's only one. Replacing two simple lines with
> > a function which takes <joke> almost as many characters to type </joke>.
> >=20
> > IMO, this is pretty useless and I'd rather not see them in the drivers I
> > maintain, sorry.
>
> It is not a NACK from me; yet from a high-level perspective I agree with
> Felipe.
OK
I'd rather not merge something that driver people don't want to use.
Vinod?
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 11/27] mfd: ab8500-gpadc: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 11/27] mfd: ab8500-gpadc: " Vinod Koul
@ 2014-09-26 8:38 ` Linus Walleij
2014-10-06 21:40 ` Lee Jones
1 sibling, 0 replies; 53+ messages in thread
From: Linus Walleij @ 2014-09-26 8:38 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, subhransu.s.prusty, Samuel Ortiz, Lee Jones,
linux-arm-kernel
On Wed, Sep 24, 2014 at 6:15 PM, Vinod Koul <vinod.koul@intel.com> wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 11/27] mfd: ab8500-gpadc: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 11/27] mfd: ab8500-gpadc: " Vinod Koul
2014-09-26 8:38 ` Linus Walleij
@ 2014-10-06 21:40 ` Lee Jones
2014-10-07 7:21 ` Lee Jones
1 sibling, 1 reply; 53+ messages in thread
From: Lee Jones @ 2014-10-06 21:40 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, subhransu.s.prusty, Linus Walleij, Samuel Ortiz,
linux-arm-kernel
On Wed, 24 Sep 2014, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
> drivers/mfd/ab8500-gpadc.c | 6 ++----
> 1 files changed, 2 insertions(+), 4 deletions(-)
Applied with Linus' Ack.
> diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
> index 36000f9..46bea3a 100644
> --- a/drivers/mfd/ab8500-gpadc.c
> +++ b/drivers/mfd/ab8500-gpadc.c
> @@ -571,8 +571,7 @@ int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
> }
>
> /* Disable VTVout LDO this is required for GPADC */
> - pm_runtime_mark_last_busy(gpadc->dev);
> - pm_runtime_put_autosuspend(gpadc->dev);
> + pm_runtime_last_busy_and_autosuspend(gpadc->dev);
>
> mutex_unlock(&gpadc->ab8500_gpadc_lock);
>
> @@ -910,8 +909,7 @@ static int ab8500_gpadc_resume(struct device *dev)
> if (ret)
> dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
>
> - pm_runtime_mark_last_busy(gpadc->dev);
> - pm_runtime_put_autosuspend(gpadc->dev);
> + pm_runtime_last_busy_and_autosuspend(gpadc->dev);
>
> mutex_unlock(&gpadc->ab8500_gpadc_lock);
> return ret;
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 12/27] mfd: arizona: use pm_runtime_last_busy_and_autosuspend helper
2014-09-24 16:15 ` [PATCH 12/27] mfd: arizona: " Vinod Koul
2014-09-25 8:10 ` Charles Keepax
@ 2014-10-06 21:41 ` Lee Jones
2014-10-07 7:21 ` Lee Jones
1 sibling, 1 reply; 53+ messages in thread
From: Lee Jones @ 2014-10-06 21:41 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-kernel, subhransu.s.prusty, Samuel Ortiz, patches
On Wed, 24 Sep 2014, Vinod Koul wrote:
> Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> coding the same code
>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
> drivers/mfd/arizona-irq.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
Applied to v3.19 (same as patch 11), with Charles' Ack.
> diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
> index d420dbc..dc755d1 100644
> --- a/drivers/mfd/arizona-irq.c
> +++ b/drivers/mfd/arizona-irq.c
> @@ -138,8 +138,7 @@ static irqreturn_t arizona_irq_thread(int irq, void *data)
> }
> } while (poll);
>
> - pm_runtime_mark_last_busy(arizona->dev);
> - pm_runtime_put_autosuspend(arizona->dev);
> + pm_runtime_last_busy_and_autosuspend(arizona->dev);
>
> return IRQ_HANDLED;
> }
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 12/27] mfd: arizona: use pm_runtime_last_busy_and_autosuspend helper
2014-10-06 21:41 ` Lee Jones
@ 2014-10-07 7:21 ` Lee Jones
0 siblings, 0 replies; 53+ messages in thread
From: Lee Jones @ 2014-10-07 7:21 UTC (permalink / raw)
To: Vinod Koul; +Cc: linux-kernel, subhransu.s.prusty, Samuel Ortiz, patches
On Mon, 06 Oct 2014, Lee Jones wrote:
> On Wed, 24 Sep 2014, Vinod Koul wrote:
>
> > Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> > coding the same code
> >
> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > ---
> > drivers/mfd/arizona-irq.c | 3 +--
> > 1 files changed, 1 insertions(+), 2 deletions(-)
>
> Applied to v3.19 (same as patch 11), with Charles' Ack.
Okay, I just had to search online for the other patches (as you left
me off PATCH 00/27). It appears this approach has gone down like a
lead balloon. For this reason I'm pulling these patches from my v3.19
branch.
> > diff --git a/drivers/mfd/arizona-irq.c b/drivers/mfd/arizona-irq.c
> > index d420dbc..dc755d1 100644
> > --- a/drivers/mfd/arizona-irq.c
> > +++ b/drivers/mfd/arizona-irq.c
> > @@ -138,8 +138,7 @@ static irqreturn_t arizona_irq_thread(int irq, void *data)
> > }
> > } while (poll);
> >
> > - pm_runtime_mark_last_busy(arizona->dev);
> > - pm_runtime_put_autosuspend(arizona->dev);
> > + pm_runtime_last_busy_and_autosuspend(arizona->dev);
> >
> > return IRQ_HANDLED;
> > }
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 11/27] mfd: ab8500-gpadc: use pm_runtime_last_busy_and_autosuspend helper
2014-10-06 21:40 ` Lee Jones
@ 2014-10-07 7:21 ` Lee Jones
2014-10-07 7:38 ` Vinod Koul
0 siblings, 1 reply; 53+ messages in thread
From: Lee Jones @ 2014-10-07 7:21 UTC (permalink / raw)
To: Vinod Koul
Cc: linux-kernel, subhransu.s.prusty, Linus Walleij, Samuel Ortiz,
linux-arm-kernel
On Mon, 06 Oct 2014, Lee Jones wrote:
> On Wed, 24 Sep 2014, Vinod Koul wrote:
>
> > Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> > coding the same code
> >
> > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > ---
> > drivers/mfd/ab8500-gpadc.c | 6 ++----
> > 1 files changed, 2 insertions(+), 4 deletions(-)
>
> Applied with Linus' Ack.
Okay, I just had to search online for the other patches (as you left
me off PATCH 00/27). It appears this approach has gone down like a
lead balloon. For this reason I'm pulling these patches from my v3.19
branch.
> > diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
> > index 36000f9..46bea3a 100644
> > --- a/drivers/mfd/ab8500-gpadc.c
> > +++ b/drivers/mfd/ab8500-gpadc.c
> > @@ -571,8 +571,7 @@ int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
> > }
> >
> > /* Disable VTVout LDO this is required for GPADC */
> > - pm_runtime_mark_last_busy(gpadc->dev);
> > - pm_runtime_put_autosuspend(gpadc->dev);
> > + pm_runtime_last_busy_and_autosuspend(gpadc->dev);
> >
> > mutex_unlock(&gpadc->ab8500_gpadc_lock);
> >
> > @@ -910,8 +909,7 @@ static int ab8500_gpadc_resume(struct device *dev)
> > if (ret)
> > dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
> >
> > - pm_runtime_mark_last_busy(gpadc->dev);
> > - pm_runtime_put_autosuspend(gpadc->dev);
> > + pm_runtime_last_busy_and_autosuspend(gpadc->dev);
> >
> > mutex_unlock(&gpadc->ab8500_gpadc_lock);
> > return ret;
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 53+ messages in thread
* Re: [PATCH 11/27] mfd: ab8500-gpadc: use pm_runtime_last_busy_and_autosuspend helper
2014-10-07 7:21 ` Lee Jones
@ 2014-10-07 7:38 ` Vinod Koul
0 siblings, 0 replies; 53+ messages in thread
From: Vinod Koul @ 2014-10-07 7:38 UTC (permalink / raw)
To: Lee Jones
Cc: linux-kernel, subhransu.s.prusty, Linus Walleij, Samuel Ortiz,
linux-arm-kernel
On Tue, Oct 07, 2014 at 08:21:25AM +0100, Lee Jones wrote:
> On Mon, 06 Oct 2014, Lee Jones wrote:
>
> > On Wed, 24 Sep 2014, Vinod Koul wrote:
> >
> > > Use the new pm_runtime_last_busy_and_autosuspend helper instead of open
> > > coding the same code
> > >
> > > Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> > > ---
> > > drivers/mfd/ab8500-gpadc.c | 6 ++----
> > > 1 files changed, 2 insertions(+), 4 deletions(-)
> >
> > Applied with Linus' Ack.
>
> Okay, I just had to search online for the other patches (as you left
> me off PATCH 00/27). It appears this approach has gone down like a
> lead balloon. For this reason I'm pulling these patches from my v3.19
> branch.
I was about to reply to you to revert.
I need to fix the script I used to do CC on 0th patch, looks like few
people were left off while collecting the names. Sorry about that
--
~Vinod
>
> > > diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c
> > > index 36000f9..46bea3a 100644
> > > --- a/drivers/mfd/ab8500-gpadc.c
> > > +++ b/drivers/mfd/ab8500-gpadc.c
> > > @@ -571,8 +571,7 @@ int ab8500_gpadc_double_read_raw(struct ab8500_gpadc *gpadc, u8 channel,
> > > }
> > >
> > > /* Disable VTVout LDO this is required for GPADC */
> > > - pm_runtime_mark_last_busy(gpadc->dev);
> > > - pm_runtime_put_autosuspend(gpadc->dev);
> > > + pm_runtime_last_busy_and_autosuspend(gpadc->dev);
> > >
> > > mutex_unlock(&gpadc->ab8500_gpadc_lock);
> > >
> > > @@ -910,8 +909,7 @@ static int ab8500_gpadc_resume(struct device *dev)
> > > if (ret)
> > > dev_err(dev, "Failed to enable vtvout LDO: %d\n", ret);
> > >
> > > - pm_runtime_mark_last_busy(gpadc->dev);
> > > - pm_runtime_put_autosuspend(gpadc->dev);
> > > + pm_runtime_last_busy_and_autosuspend(gpadc->dev);
> > >
> > > mutex_unlock(&gpadc->ab8500_gpadc_lock);
> > > return ret;
> >
>
> --
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org │ Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog
--
^ permalink raw reply [flat|nested] 53+ messages in thread
end of thread, other threads:[~2014-10-07 8:11 UTC | newest]
Thread overview: 53+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 16:14 [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Vinod Koul
2014-09-24 16:14 ` [PATCH 01/27] PM: Add helper pm_runtime_last_busy_and_autosuspend() Vinod Koul
2014-09-24 17:54 ` Pavel Machek
2014-09-25 8:00 ` Vinod Koul
2014-09-25 8:13 ` Ulf Hansson
2014-09-24 16:14 ` [PATCH 02/27] dmaengine: ste_dma: use pm_runtime_last_busy_and_autosuspend helper Vinod Koul
2014-09-25 13:19 ` Linus Walleij
2014-09-24 16:14 ` [PATCH 03/27] extcon: arizona: " Vinod Koul
2014-09-25 1:05 ` Chanwoo Choi
2014-09-25 8:10 ` Charles Keepax
2014-09-24 16:14 ` [PATCH 04/27] drm/i915: " Vinod Koul
2014-09-24 18:35 ` Daniel Vetter
2014-09-24 16:14 ` [PATCH 05/27] drm/nouveau: " Vinod Koul
2014-09-24 16:14 ` [PATCH 06/27] drm/radeon: " Vinod Koul
2014-09-24 20:37 ` Alex Deucher
2014-09-24 16:14 ` [PATCH 07/27] vga_switcheroo: " Vinod Koul
2014-09-24 20:37 ` Alex Deucher
2014-09-24 16:14 ` [PATCH 08/27] i2c: designware: " Vinod Koul
2014-09-24 16:14 ` [PATCH 09/27] i2c: omap: " Vinod Koul
2014-09-24 16:15 ` [PATCH 10/27] i2c: qup: " Vinod Koul
2014-09-24 16:15 ` [PATCH 11/27] mfd: ab8500-gpadc: " Vinod Koul
2014-09-26 8:38 ` Linus Walleij
2014-10-06 21:40 ` Lee Jones
2014-10-07 7:21 ` Lee Jones
2014-10-07 7:38 ` Vinod Koul
2014-09-24 16:15 ` [PATCH 12/27] mfd: arizona: " Vinod Koul
2014-09-25 8:10 ` Charles Keepax
2014-10-06 21:41 ` Lee Jones
2014-10-07 7:21 ` Lee Jones
2014-09-24 16:15 ` [PATCH 13/27] mei: " Vinod Koul
2014-09-24 16:15 ` [PATCH 14/27] mmc: " Vinod Koul
2014-09-24 16:15 ` [PATCH 15/27] mmc: mmci: " Vinod Koul
2014-09-24 16:15 ` [PATCH 16/27] mmc: omap_hsmmc: " Vinod Koul
2014-09-24 16:15 ` [PATCH 17/27] mmc: sdhci-pxav3: " Vinod Koul
2014-09-24 16:15 ` [PATCH 18/27] mmc: sdhci: " Vinod Koul
2014-09-24 16:15 ` [PATCH 19/27] NFC: trf7970a: " Vinod Koul
2014-09-24 16:15 ` [PATCH 20/27] pm2301-charger: " Vinod Koul
2014-09-24 16:15 ` [PATCH 21/27] spi: omap2-mcspi: " Vinod Koul
2014-09-24 16:58 ` Mark Brown
2014-09-24 16:39 ` Vinod Koul
2014-09-25 13:03 ` Mark Brown
2014-09-24 16:15 ` [PATCH 22/27] spi: orion: " Vinod Koul
2014-09-25 13:03 ` Mark Brown
2014-09-24 16:15 ` [PATCH 23/27] spi: ti-qspi: " Vinod Koul
2014-09-25 13:04 ` Mark Brown
2014-09-24 16:15 ` [PATCH 24/27] spi: core: " Vinod Koul
2014-09-25 13:04 ` Mark Brown
2014-09-24 16:15 ` [PATCH 25/27] tty: serial: omap: " Vinod Koul
2014-09-24 16:15 ` [PATCH 26/27] usb: musb: omap2430: " Vinod Koul
2014-09-24 16:15 ` [PATCH 27/27] video: fbdev: " Vinod Koul
2014-09-24 20:28 ` [PATCH 00/27] add pm_runtime_last_busy_and_autosuspend() helper Rafael J. Wysocki
2014-09-25 7:46 ` Vinod Koul
[not found] ` <20140925142201.GD28045@saruman>
[not found] ` <20140925142758.GB1316@katana>
2014-09-25 19:54 ` Rafael J. Wysocki
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).