[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b3c6f560-fb10-005d-0e61-04b15efc380a@linux.intel.com>
Date: Mon, 19 Dec 2022 17:01:18 +0200
From: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Richard Fitzgerald <rf@...nsource.cirrus.com>
Cc: mika.westerberg@...ux.intel.com, jsd@...ihalf.com, wsa@...nel.org,
hdegoede@...hat.com, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org, patches@...nsource.cirrus.com
Subject: Re: [PATCH v4] i2c: designware: Fix unbalanced suspended flag
On 12/19/22 15:10, Andy Shevchenko wrote:
> On Mon, Dec 19, 2022 at 01:01:45PM +0000, Richard Fitzgerald wrote:
>> Ensure that i2c_mark_adapter_suspended() is always balanced by a call to
>> i2c_mark_adapter_resumed().
>>
>> dw_i2c_plat_resume() must always be called, so that
>> i2c_mark_adapter_resumed() is called. This is not compatible with
>> DPM_FLAG_MAY_SKIP_RESUME, so remove the flag.
>>
>> Since the controller is always resumed on system resume the
>> dw_i2c_plat_complete() callback is redundant and has been removed.
>>
>> The unbalanced suspended flag was introduced by commit c57813b8b288
>> ("i2c: designware: Lock the adapter while setting the suspended flag")
>>
>> Before that commit, the system and runtime PM used the same functions. The
>> DPM_FLAG_MAY_SKIP_RESUME was used to skip the system resume if the driver
>> had been in runtime-suspend. If system resume was skipped, the suspended
>> flag would be cleared by the next runtime resume. The check of the
>> suspended flag was _after_ the call to pm_runtime_get_sync() in
>> i2c_dw_xfer(). So either a system resume or a runtime resume would clear
>> the flag before it was checked.
>>
>> Having introduced the unbalanced suspended flag with that commit, a further
>> commit 80704a84a9f8
>> ("i2c: designware: Use the i2c_mark_adapter_suspended/resumed() helpers")
>
> This is still unwrapped propertly, but no need to resend, it so minor, really.
> Just a hint for the future submissions.
>
This version was working on those two machines that saw a regression
with v2 so
Acked-by: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Powered by blists - more mailing lists