From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: caizhaopeng@uniontech.com,
Linus Walleij <linus.walleij@linaro.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Andy Shevchenko <andy@kernel.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Zhangyueqian <zhangyueqian@uniontech.com>,
Zhangshuang <zhangshuang@uniontech.com>,
Hualet Wang <wangyaohua@uniontech.com>,
Zhanglei <zhanglei@uniontech.com>
Subject: Re: [PATCH 1/1] pinctrl: add IRQF_EARLY_RESUME flags with gpio irq for elan touchpad.
Date: Mon, 23 Nov 2020 15:35:36 +0200 [thread overview]
Message-ID: <20201123133536.GC4077@smile.fi.intel.com> (raw)
In-Reply-To: <1e67c040-2aff-65bd-188a-bacf9a7fd7c4@redhat.com>
On Mon, Nov 23, 2020 at 01:46:50PM +0100, Hans de Goede wrote:
> On 11/12/20 2:52 PM, Andy Shevchenko wrote:
> >
> > +Cc: Hans.
> >
> > I can't speak for AMD, but I think it may be useful for Intel pin control.
> > However, I didn't check what may be the side effects of this change and neither
> > contributor answered to my comments...
>
> AFAICT setting IRQF_EARLY_RESUME causes it to not be resumed during
> normal IRQ resuming, but earlier during the syscore_resume() call.
>
> There are 2 problems with this:
>
> 1. When using S3 suspend syscore_resume() runs before any device
> suspend handlers, so any state restoring which the GPIO controller's
> resume handler is doing has not been done yet. While esp. after
> S3 suspend the restoring may be important (s2idle suspend should
> not touch the GPIO registers contents).
>
> 2. When using S2idle suspend syscore_resume() *never* runs, and
> IRQs marked with IRQF_EARLY_RESUME are skipped during the normal
> IRQ resume phase, so these IRQs will never be resumed.
>
> Also IRQF_EARLY_RESUME is used almost no where:
Yes, I also noticed this.
> [hans@x1 linux]$ ack -l IRQF_EARLY_RESUME drivers
> drivers/xen/events/events_base.c
> drivers/rtc/rtc-sc27xx.c
> drivers/mfd/twl4030-irq.c
>
> Which is probably why we have not yet hit the s2idle issue with it.
>
> So this all in all seems like a bad idea, and we need to better root
> cause the issue with these Elan touchpads and fix the actual issue.
Thanks! That is useful to know.
> > So, just heads up.
> >
> > On Fri, Apr 24, 2020 at 05:12:01PM +0800, caizhaopeng@uniontech.com wrote:
> >> From: Caicai <caizhaopeng@uniontech.com>
> >>
> >> I had tested two Notebook machines, the Intel i5(or amd ryzen)
> >> with elan touchpad, and there's a probability that the touchpad
> >> won't work after going to the S3/S4 to wake up, that it would
> >> appear no more than 15 times. I found that there's no interrupt
> >> to check for /proc/interrupt. It was found that the gpio
> >> interrupt of i2c was also not on top. By adding the gpio
> >> interrupt flags with IRQF_EARLY_RESUME, now the touchpad tested
> >> 200 + times works well.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2020-11-23 13:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-24 9:12 [PATCH 1/1] pinctrl: add IRQF_EARLY_RESUME flags with gpio irq for elan touchpad caizhaopeng
2020-04-24 9:50 ` Andy Shevchenko
2020-11-12 13:52 ` Andy Shevchenko
2020-11-23 12:46 ` Hans de Goede
2020-11-23 13:35 ` Andy Shevchenko [this message]
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=20201123133536.GC4077@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=caizhaopeng@uniontech.com \
--cc=hdegoede@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=wangyaohua@uniontech.com \
--cc=zhanglei@uniontech.com \
--cc=zhangshuang@uniontech.com \
--cc=zhangyueqian@uniontech.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).