linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: "Volker Rümelin" <volker.ruemelin@googlemail.com>
Cc: Jean Delvare <jdelvare@suse.de>,
	Linux I2C <linux-i2c@vger.kernel.org>,
	Bjorn Helgaas <helgaas@kernel.org>,
	Vaibhav Gupta <vaibhavgupta40@gmail.com>
Subject: Re: [PATCH v2 1/2] i2c: i801: Fix resume bug
Date: Thu, 10 Sep 2020 09:09:13 +0200	[thread overview]
Message-ID: <20200910070913.GI1031@ninjato> (raw)
In-Reply-To: <19d445a6-0410-78a0-77aa-4297e864d064@googlemail.com>

[-- Attachment #1: Type: text/plain, Size: 1744 bytes --]

Hi Volker, hi Jean,

On Sun, Sep 06, 2020 at 10:00:50AM +0200, Volker Rümelin wrote:
> Hi Jean,
> 
> with these two patches the code in i2c-i801.c looks really good.
> 
> But there is an issue with the reproducer.

I am not familiar with the HW; do we want these two patches here or does
the issue below need to be solved first? And if we want them, is it
still stable material?

Regards,

   Wolfram

> 
> > I noticed this bug in a QEMU x86_64 q35 VM booted with OVMF. OVMF
> > doesn't inititialize the SMBus master. After 1s of SMBus inactivity
> > autosuspend disables the SMBus master. To reproduce please note QEMU's
> > ICH9 SMBus emulation does not handle interrupts and it's necessary
> > to pass the parameter disable_features=0x10 to the i2c_i801 driver.
> 
> Since commit a9c8088c7988e "i2c: i801: Don't restore config
> registers on runtime PM" the reproducer doesn't work anymore.
> This is because commit a9c8088c7988e works as intended and the
> pm->runtime_* callbacks no longer call i801_suspend() and
> i801_resume().
> 
> But there is more. With the SMBus master in runtime suspended state
> the direct-complete mechanism skips the calls to the pm->suspend
> and pm->resume callbacks on system suspend/resume. I am convinced
> in nearly all cases this disables the fix from commit a5aaea37858fb
> "i2c-i801: Restore the device state before leaving".
> 
> At the moment I see two ways to fix this problem. One way is to
> revert a9c8088c7988e "i2c: i801: Don't restore config registers
> on runtime PM", the other is to set the driver flag
> DPM_FLAG_NO_DIRECT_COMPLETE in i801_probe(). I tested both, but I
> can't decide which way is better.
> 
> With best regards,
> Volker
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-09-10  7:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 13:22 [PATCH v2 1/2] i2c: i801: Fix resume bug Jean Delvare
2020-09-01 13:28 ` [PATCH v2 2/2] i2c: i801: Simplify the suspend callback Jean Delvare
2020-09-14  7:03   ` Wolfram Sang
2020-09-03 17:17 ` [PATCH v2 1/2] i2c: i801: Fix resume bug Jean Delvare
2020-09-06  8:00 ` Volker Rümelin
2020-09-10  7:09   ` Wolfram Sang [this message]
2020-09-10  9:32     ` Jean Delvare
2020-09-10  9:14   ` Jean Delvare
2020-09-14  7:03 ` Wolfram Sang

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=20200910070913.GI1031@ninjato \
    --to=wsa@kernel.org \
    --cc=helgaas@kernel.org \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=vaibhavgupta40@gmail.com \
    --cc=volker.ruemelin@googlemail.com \
    /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;
as well as URLs for NNTP newsgroup(s).