All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Abel Vesa <abel.vesa@oss.qualcomm.com>
Cc: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
	platform-driver-x86@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] platform: arm64: lenovo-thinkpad-t14s: Keep the interrupt off while suspended
Date: Wed, 18 Nov 2026 21:45:43 +0100	[thread overview]
Message-ID: <av4OAxLNIIXWBz9F@venus> (raw)
In-Reply-To: <20261118-platform-arm64-t14s-ec-irq-suspended-v1-1-635eb3e7325e@oss.qualcomm.com>

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

Hi,

On Wed, Nov 18, 2026 at 05:39:25PM +0200, Abel Vesa wrote:
> The interrupt handler reads the event from the EC over I2C. Nothing
> keeps it from running while the system is suspending or resuming, when
> the I2C controller cannot be used.
> 
> On resume the interrupts are enabled again after the noirq phase, while
> runtime PM of the I2C controller stays disabled until its early resume.
> An EC interrupt that is pending by then fails, and so does every further
> one until the controller is back. On the ThinkPad T14s Gen 7 that showed
> up as more than a thousand of these in a few milliseconds when resuming
> from hibernation:
> 
>   geni_i2c a84000.i2c: error turning SE resources:-13
>   thinkpad-t14s-ec 7-0028: Failed to read event
> 
> Disable the interrupt when suspending and enable it at the end of
> resume, once the EC can be talked to. An event that arrives in between
> is handled then.
> 
> Fixes: 60b7ab6ce030 ("platform: arm64: thinkpad-t14s-ec: new driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
> ---
> The EC interrupt handler talks to the EC over I2C, and nothing stops it
> from running while the I2C controller is not usable during a system
> sleep transition.
> 
> This was found on the ThinkPad T14s Gen 7 while getting hibernation to
> work there. The support for the EC of that machine is not upstream yet,
> but the interrupt handler and the suspend and resume callbacks are the
> ones the X1E based ThinkPad T14s uses.
> 
> Resuming from hibernation failed the read of the EC event more than a
> thousand times in a few milliseconds there. That many, because the
> interrupt was level triggered in the GIC at that point, as the SPI
> configuration is not restored after hibernation [1]. With that fixed,
> the handler still runs once before the I2C controller is back.
> 
> With this patch there are no failed reads on the ThinkPad T14s Gen 7
> when resuming from hibernation. It was not tested on the X1E based
> ThinkPad T14s.
> 
> [1] https://lore.kernel.org/r/20261024144720.113165-2-zhuling2709@phytium.com.cn
> 
> Prepared with help from an LLM-based assistant.
> ---

Reviewed-by: Sebastian Reichel <sre@kernel.org>

Greetings,

-- Sebastian

>  drivers/platform/arm64/lenovo-thinkpad-t14s.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/platform/arm64/lenovo-thinkpad-t14s.c b/drivers/platform/arm64/lenovo-thinkpad-t14s.c
> index 873747838a4f..a291daba0577 100644
> --- a/drivers/platform/arm64/lenovo-thinkpad-t14s.c
> +++ b/drivers/platform/arm64/lenovo-thinkpad-t14s.c
> @@ -616,6 +616,12 @@ static int t14s_ec_suspend(struct device *dev)
>  {
>  	struct t14s_ec *ec = dev_get_drvdata(dev);
>  
> +	/*
> +	 * The handler needs the I2C controller, which is not available
> +	 * again until this device is resumed.
> +	 */
> +	disable_irq(to_i2c_client(dev)->irq);
> +
>  	led_classdev_suspend(&ec->kbd_backlight);
>  
>  	t14s_ec_write_sequence(ec, T14S_EC_REG_MODERN_STANDBY,
> @@ -633,6 +639,8 @@ static int t14s_ec_resume(struct device *dev)
>  
>  	led_classdev_resume(&ec->kbd_backlight);
>  
> +	enable_irq(to_i2c_client(dev)->irq);
> +
>  	return 0;
>  }
>  
> 
> ---
> base-commit: 749a4de370409464cf8501ec5b2451df45c84eb4
> change-id: 20261118-platform-arm64-t14s-ec-irq-suspended-5fd6892d7e26
> 
> Best regards,
> --  
> 
> Abel
> 

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

      parent reply	other threads:[~2026-11-18 20:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 15:39 [PATCH] platform: arm64: lenovo-thinkpad-t14s: Keep the interrupt off while suspended Abel Vesa
2026-11-18 16:10 ` Hans de Goede
2026-11-18 20:45 ` Sebastian Reichel [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=av4OAxLNIIXWBz9F@venus \
    --to=sre@kernel.org \
    --cc=abel.vesa@oss.qualcomm.com \
    --cc=bryan.odonoghue@linaro.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stable@vger.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 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.