lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0c44fe3a-b6d7-c947-0137-be4d33e132d7@linux.intel.com>
Date:   Tue, 31 Jan 2017 11:32:44 +0200
From:   Jarkko Nikula <jarkko.nikula@...ux.intel.com>
To:     John Stultz <john.stultz@...aro.org>
Cc:     Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Wolfram Sang <wsa@...-dreams.de>, linux-i2c@...r.kernel.org,
        lkml <linux-kernel@...r.kernel.org>,
        zhangfei <zhangfei.gao@...aro.org>,
        Guodong Xu <guodong.xu@...aro.org>,
        Amit Pundir <amit.pundir@...aro.org>
Subject: Re: Issue with i2c-designware-platdrv's suspend/runtime-suspend
 handling

On 01/31/2017 12:05 AM, John Stultz wrote:
> On Tue, Jan 24, 2017 at 2:03 PM, John Stultz <john.stultz@...aro.org> wrote:
>> 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?
>
I wonder why device PM doesn't take care of this?

If i2c-designware is enumerated from ACPI then drivers/acpi/device_pm.c: 
acpi_subsys_suspend() resumes devices suspended at run time before 
system suspend so dw_i2c_plat_suspend() won't be called twice.

But still I think device PM should not attempt to suspend already 
suspended device?

-- 
Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ