On Tue, Jan 24, 2017 at 2:03 PM, John Stultz <john.stultz@xxxxxxxxxx> wrote:I wonder why device PM doesn't take care of this?
Doing some further debugging, it seems the problem is that the device
is being runtime suspended, and then at suspend time, we're calling
the same logic, calling i2c_dw_plat_prepare_clk, which causes the clk
count warning.
Removing the runtime pm ops:
- SET_RUNTIME_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume, NULL)
+// SET_RUNTIME_PM_OPS(dw_i2c_plat_suspend, dw_i2c_plat_resume, NULL)
seems to avoid the warning, but clearly isn't ideal. :)
Should there be some logic keep track of the suspend state for the
dw_i2c_dev device so we don't try to suspend (or resume) it twice? Or
is there something else I'm missing to keep this from happening?
Ping? Any thoughts on how best to fix this? I'm leaning towards
adding a suspended state to the struct dw_i2c_dev. Any objections?