Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: johannes.goede@oss.qualcomm.com
To: Hardik Prakash <hardikprakash.official@gmail.com>,
	Thorsten Leemhuis <linux@leemhuis.info>
Cc: Mario Limonciello <mario.limonciello@amd.com>,
	Andy Shevchenko <andriy.shevchenko@intel.com>,
	Andi Shyti <andi.shyti@kernel.org>,
	linux-i2c@vger.kernel.org, linux-gpio@vger.kernel.org,
	wsa@kernel.org, brgl@bgdev.pl, basavaraj.natikar@amd.com,
	linusw@kernel.org, nathan@kernel.org,
	chaitanya.kumar.borah@intel.com,
	Linux kernel regressions list <regressions@lists.linux.dev>
Subject: Re: i2c designware change broke touchpad of a thinkpad
Date: Mon, 17 Aug 2026 11:51:24 +0200	[thread overview]
Message-ID: <1bca212d-fe9c-4666-8ac1-743f8c9ef1c5@oss.qualcomm.com> (raw)
In-Reply-To: <CANTFpSV9jguMzmfN7STb7XANYdn8i34bVmpT=0NdJ_o=3_Y1CQ@mail.gmail.com>

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

Hi Hardik,

On 14-Aug-26 12:09 PM, Hardik Prakash wrote:
> On Wed, 13 Aug 2026, Thorsten Leemhuis wrote:
>> Hardik, could you submit a revert to the lists? And then I'll provide my
>> Tested-by and ask Linus to directly pick this up?
> 
> Sent: https://lore.kernel.org/all/20260814100719.9548-1-hardikprakash.official@gmail.com/
> 
> Verified on my end that it builds clean, boots clean, and correctly
> restores the original Yoga 7 race (expected tradeoff) without
> introducing anything else.

Thank you for submitting a revert for this. Note it looks like Torvalds himself
beat you to it and already reverted this for 7.2 final :)

I hit another problem caused by this now reverted change, where the PMIC
i2c bus would not show up on many Intel BYT/CHT devices. I wrote a fix for
this (attached) on top of the now reverted commit.

I think my fix might also have helped for the broken touchpad issue from this
thread, but I believe there is a better way to fix all this, so IMHO it is
good that this was reverted.

If I understand things correctly the problem the reverted fix was trying
to fix is i2c-transfer errors happening before the GPIO controller driver
is ready.

The i2c-core will not initiate transfers itself, so the problem is that
the i2c-hid driver is initiating transfers before the GPIO controller
is setup.

The i2c-hid driver does actually request the interrupt itself, so we can
simply wait for that to succeed inside the i2c-hid code. ATM the i2c-hid
code starts with an i2c-connectivity check because some ACPI tables list
non existing I2C-HID devices.

But we could make the i2c-hid driver start with first requesting its IRQ
and if that fails bail (with -EPROBE_DEFER) before doing any i2c-transfers.

And then do the i2c-connectivity test after requesting the IRQ. So basically
swap the order of i2c-connectivity test vs IRQ requesting.

The IRQ requesting should then use the IRQF_NO_AUTOEN flag to keep the IRQ
disabled at first and explicitly enable it later when the rest of the driver
setup is done.

Hardik, can you take a shot at coding up the suggested i2c-hid(-core) changes
and test to see if this fixes the original Yoga 7 race in a cleaner manner ?

Regards,

Hans


[-- Attachment #2: 0001-i2c-designware-Make-check_child_gpioint-skip-devices.patch --]
[-- Type: text/x-patch, Size: 2339 bytes --]

From e12a71c64b996560d521ea9dda31a8c629b504e4 Mon Sep 17 00:00:00 2001
From: Hans de Goede <johannes.goede@oss.qualcomm.com>
Date: Sun, 16 Aug 2026 23:06:07 +0200
Subject: [PATCH] i2c: designware: Make check_child_gpioint() skip devices
 which are not present

Commit 0a4bb2abc3e5 ("i2c: designware: defer probe if child GpioInt
controllers are not bound") makes i2c-designware-platdrv delay binding
until all GpioInt resources of children of the i2c-controller are
available.

This causes the driver to sometimes never bound in case of bogus, or
not supported by Linux GpioInt resources on some of the i2c-clients of
the controller, which causes *all* of the clients to not work!

ACPI tables typically contain descriptions of many possible i2c-clients
under an i2c-controller (e.g. second sources of devices) but only
a few are actually marked as being present. The kernel will only
instantiate i2c-clients for those which are present, make the GpioInt
"ready" check only check actually present i2c-clients.

Intel BYT/CHT devices have a special INT33FE i2c-client which is
a duplicate of the exisiting PMIC i2c-client, with non supported
GpioInt resources (pointing back to the PMIC). Linux already ignores
these, so make the GpioInt check skip these too.

This fixes i2c-designware-platdrv not binding to the PMIC I2C bus on many
Intel Bay Trail and Cherry Trail devices like e.g. the MPman Convertor9.

Fixes: 0a4bb2abc3e5 ("i2c: designware: defer probe if child GpioInt controllers are not bound")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index c8a203fff4d1..f80817e6221d 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -180,6 +180,13 @@ static int check_child_gpioint(struct acpi_device *adev, void *data)
 	LIST_HEAD(res_list);
 	int ret;
 
+	if (!adev->status.present)
+		return 0;
+
+	/* Skip broken Intel BYT/CHT INT33FE battery devices */
+	if (acpi_dev_hid_match(adev, "INT33FE"))
+		return 0;
+
 	ret = acpi_dev_get_resources(adev, &res_list, check_gpioint_resource, NULL);
 	if (ret < 0)
 		return ret;
-- 
2.55.0


  reply	other threads:[~2026-08-17  9:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18  5:43 [PATCH v13] i2c: designware: defer probe if child GpioInt controllers are not bound Hardik Prakash
2026-07-18  8:50 ` Andy Shevchenko
2026-07-20  8:07 ` Bartosz Golaszewski
2026-07-28  6:04   ` Hardik Prakash
2026-07-28  8:30 ` Andi Shyti
2026-08-07 14:07   ` i2c designware change broke touchpad of a thinkpad (was: i2c: designware: defer probe if child GpioInt controllers are not bound) Thorsten Leemhuis
2026-08-08 17:01     ` Hardik Prakash
     [not found]       ` <aneQvMN_Zet2b62n@ashevche-desk.local>
2026-08-09 16:19         ` i2c designware change broke touchpad of a thinkpad Thorsten Leemhuis
2026-08-10  5:23           ` Hardik Prakash
2026-08-10  5:36             ` Thorsten Leemhuis
2026-08-10  5:54               ` Hardik Prakash
2026-08-10  6:48                 ` Thorsten Leemhuis
2026-08-12  4:59                   ` Hardik Prakash
2026-08-12  5:21                     ` Thorsten Leemhuis
2026-08-12  5:45                       ` Hardik Prakash
2026-08-12 12:34                         ` Mario Limonciello
2026-08-13  5:30                           ` Hardik Prakash
2026-08-13 10:56                           ` Thorsten Leemhuis
2026-08-14 10:09                             ` Hardik Prakash
2026-08-17  9:51                               ` johannes.goede [this message]
2026-08-17 11:12                                 ` Thorsten Leemhuis
2026-08-17 11:24                                   ` Tiến Đạt Trần
2026-08-17 12:33                                   ` johannes.goede

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=1bca212d-fe9c-4666-8ac1-743f8c9ef1c5@oss.qualcomm.com \
    --to=johannes.goede@oss.qualcomm.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=basavaraj.natikar@amd.com \
    --cc=brgl@bgdev.pl \
    --cc=chaitanya.kumar.borah@intel.com \
    --cc=hardikprakash.official@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux@leemhuis.info \
    --cc=mario.limonciello@amd.com \
    --cc=nathan@kernel.org \
    --cc=regressions@lists.linux.dev \
    --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