From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: Hans de Goede <hdegoede@redhat.com>, <wsa@kernel.org>,
<jarkko.nikula@linux.intel.com>,
<andriy.shevchenko@linux.intel.com>,
<mika.westerberg@linux.intel.com>, <jsd@semihalf.com>
Cc: <linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<patches@opensource.cirrus.com>
Subject: Re: [PATCH] i2c: designware: Fix unbalanced suspended flag
Date: Fri, 9 Dec 2022 14:22:14 +0000 [thread overview]
Message-ID: <c210c1d6-7327-d377-22e7-b5a123de5cbb@opensource.cirrus.com> (raw)
In-Reply-To: <e8b6733c-33b8-cb28-a62b-21dad9bd6466@opensource.cirrus.com>
On 9/12/22 13:36, Richard Fitzgerald wrote:
> On 9/12/22 12:15, Hans de Goede wrote:
>> Hi Richard,
>>
>> On 12/9/22 12:40, Richard Fitzgerald wrote:
>>> Ensure that i2c_mark_adapter_suspended() is always balanced by a call to
>>> i2c_mark_adapter_resumed().
>
> <snip>
>
>>
>> It is not entirely clear to me where the unbalance you claim to see comes
>> from? When runtime-suspended SMART_SUSPEND should keep it suspended at
>> which point
>> the system suspend callback will never run ?
>>
>> Are you sure that you are not maybe seeing a suspend/resume ordering
>> issue?
>>
>> Did you add printk messages to the suspend/resume callbacks of
>> i2c-designware-platdrv.c which show the system suspend callback
>> being called but not the system resume one ?
>>
>
> With messages in strategic places.
>
> [ 169.607358] i2c_designware i2c_designware.2: PM: dev_pm_skip_suspend:
> SMART_SUSPEND=0 pm_runtime_status_suspended=1
> [ 169.607361] i2c_designware i2c_designware.2: PM:
> __device_suspend_late: dev_pm_skip_suspend:false
> [ 169.607364] i2c_designware i2c_designware.2: dw_i2c_plat_suspend
> ...
> [ 169.702511] i2c_designware i2c_designware.2: PM: dev_pm_skip_resume:
> 1 because !power.must_resume
> [ 169.706241] i2c_designware i2c_designware.2: PM: dev_pm_skip_resume:
> 1 because !power.must_resume
> [ 169.706244] i2c_designware i2c_designware.2: PM: device_resume_early:
> dev_pm_skip_resume:true
> ...
> [ 175.254832] i2c i2c-2: Transfer while suspended
>
> (Just to prove my logging isn't lying, for i2c3 it reports
> SMART_SUSPEND=1)
>
Oh, that's embarrassing. After confidently telling you my logging
is perfect, actually there was a bug in it...
New log summary:
[ 162.253431] i2c_designware i2c_designware.2: PM: dev_pm_skip_suspend:
SMART_SUSPEND=1 pm_runtime_status_suspended=0
[ 162.253438] i2c_designware i2c_designware.2: PM:
__device_suspend_late: dev_pm_skip_suspend:false
[ 162.253445] i2c_designware i2c_designware.2: dw_i2c_plat_suspend
[ 162.273115] i2c_designware i2c_designware.2: PM: dev_pm_skip_suspend:
SMART_SUSPEND=1 pm_runtime_status_suspended=0
[ 162.362547] i2c_designware i2c_designware.2: PM: dev_pm_skip_resume:
1 because !power.must_resume
[ 162.369216] i2c_designware i2c_designware.2: PM: dev_pm_skip_resume:
1 because !power.must_resume
[ 162.369220] i2c_designware i2c_designware.2: PM: device_resume_early:
dev_pm_skip_resume:true
[ 167.901269] i2c i2c-2: Transfer while suspended
Same result that it doesn't skip suspend but does skip resume.
next prev parent reply other threads:[~2022-12-09 14:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-09 11:40 [PATCH] i2c: designware: Fix unbalanced suspended flag Richard Fitzgerald
2022-12-09 12:15 ` Hans de Goede
2022-12-09 12:29 ` Richard Fitzgerald
2022-12-09 13:36 ` Richard Fitzgerald
2022-12-09 14:22 ` Richard Fitzgerald [this message]
2022-12-09 18:16 ` Hans de Goede
2022-12-09 13:40 ` Richard Fitzgerald
2022-12-09 14:04 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c210c1d6-7327-d377-22e7-b5a123de5cbb@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jsd@semihalf.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=patches@opensource.cirrus.com \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox