Thread (2 messages) 2 messages, 2 authors, 2012-08-18
STALE5042d

[PATCH] I2C: OMAP: xfer: fix runtime PM get/put balance on error

From: Kevin Hilman <hidden>
Date: 2012-08-07 00:28:44
Also in: linux-i2c, linux-omap

Possibly related (same subject, not in this thread)

Hi Wolfram,

Kevin Hilman [off-list ref] writes:
In omap_i2c_xfer(), ensure pm_runtime_put() is called, even on
failure.

Without this, after a failed xfer, the runtime PM usecount will have
been incremented, but not decremented causing the usecount to never
reach zero after a failure.  This keeps the device always runtime PM
enabled which keeps the enclosing power domain active, and prevents
full-chip retention/off from happening during idle.

Cc: Shubhrajyoti D <redacted>
Signed-off-by: Kevin Hilman <redacted>
---
This patch applies to current i2c-embedded/for-next branch
This one is needed for v3.6.  Can you queue this up as a fix for
v3.6-rc?

Thanks,

Kevin
quoted hunk
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 9895fa7..b105733 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -582,7 +582,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
 
 	r = pm_runtime_get_sync(dev->dev);
 	if (IS_ERR_VALUE(r))
-		return r;
+		goto out;
 
 	r = omap_i2c_wait_for_bb(dev);
 	if (r < 0)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help