Thread (17 messages) flat view 17 messages, 4 authors, 2017-01-31

Re: [PATCH 1/2] power: bq24190_charger: Check the interrupt status on resume

From: Tony Lindgren <tony@atomide.com>
Date: 2017-01-24 00:47:52
Also in: linux-omap

* Sebastian Reichel [off-list ref] [170121 17:55]:
Hi Tony,

I think your runtime_resume is missing runtime_pm_get/put_sync, see
below:

On Fri, Jan 20, 2017 at 02:04:39PM -0800, Tony Lindgren wrote:
quoted
[...]
+static irqreturn_t bq24190_irq_handler_thread(int irq, void *data)
+{
+	struct bq24190_dev_info *bdi = data;
+
+	bdi->irq_event = true;
+	pm_runtime_get_sync(bdi->dev);
+	bq24190_check_status(bdi);
+	pm_runtime_put_sync(bdi->dev);
bq24190_check_status is called with runtime_pm enabled.
quoted
+	bdi->irq_event = false;
 
 	return IRQ_HANDLED;
 }

[...]

+static int bq24190_runtime_resume(struct device *dev)
+{
+	struct i2c_client *client = to_i2c_client(dev);
+	struct bq24190_dev_info *bdi = i2c_get_clientdata(client);
+
+	if (!bdi->initialized)
+		return 0;
+
+	if (!bdi->irq_event) {
+		dev_dbg(bdi->dev, "checking events on possible wakeirq\n");
+		bq24190_check_status(bdi);
bq24190_check_status is called without runtime_pm enabled.
But it's the runtime_resume call we're calling it from :)

I don't think there is anything to configure in bq24190 at least
at this point, we just want to see if we got the wakeirq call
resume while in some deeper idle state.

Regards,

Tony
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help