All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keijo Vaara <ferdasyn@rocketmail.com>
To: linux-i2c@vger.kernel.org, Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
	linux-input@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH] i2c: Prevent runtime suspend of adapter when Host Notify is required
Date: Thu, 2 May 2019 08:07:58 +0000 (UTC)	[thread overview]
Message-ID: <1541197134.3231703.1556784478268@mail.yahoo.com> (raw)
In-Reply-To: <20190430142322.15013-1-jarkko.nikula@linux.intel.com>

On Tue, Apr 30, 2019 at 4:23 PM Jarkko Nikula
<jarkko.nikula@linux.intel.com> wrote:
>
> ---
> Keijo: could you test this does it fix the issue you reported? This is
> practically the same diff I sent earlier what you probably haven't tested yet.
> I wanted to send a commitable fix in case it works since I'll be out of
> office in a few coming days.
> ---
>  drivers/i2c/i2c-core-base.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> index 38af18645133..8149c9e32b69 100644
> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c
> @@ -327,6 +327,8 @@ static int i2c_device_probe(struct device *dev)
>
>                if (client->flags & I2C_CLIENT_HOST_NOTIFY) {
>                        dev_dbg(dev, "Using Host Notify IRQ\n");
> +                      /* Keep adapter active when Host Notify is required */
> +                      pm_runtime_get_sync(&client->adapter->dev);
>                        irq = i2c_smbus_host_notify_to_irq(client);
>                } else if (dev->of_node) {
>                        irq = of_irq_get_byname(dev->of_node, "irq");
> @@ -431,6 +433,8 @@ static int i2c_device_remove(struct device *dev)
>        device_init_wakeup(&client->dev, false);
>
>        client->irq = client->init_irq;
> +      if (client->flags & I2C_CLIENT_HOST_NOTIFY)
> +              pm_runtime_put(&client->adapter->dev);
>
>        return status;
>  }
> --
> 2.20.1
>

Thanks guys, I've tested the patch and can confirm it fixes the issue.

  parent reply	other threads:[~2019-05-02  8:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 14:23 [PATCH] i2c: Prevent runtime suspend of adapter when Host Notify is required Jarkko Nikula
2019-04-30 15:42 ` Rafael J. Wysocki
2019-05-02  8:07 ` Keijo Vaara [this message]
     [not found] ` <20190430155637.1B45E21743@mail.kernel.org>
2019-05-02 12:32   ` Jarkko Nikula
2019-05-02 15:32     ` Charles Keepax
2019-05-02 15:32       ` Charles Keepax
2019-05-05 12:54       ` Greg KH
2019-05-02 16:43 ` 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=1541197134.3231703.1556784478268@mail.yahoo.com \
    --to=ferdasyn@rocketmail.com \
    --cc=helgaas@kernel.org \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.