Re: i2c designware change broke touchpad of a thinkpad
| Newsgroups | org.kernel.vger.linux-i2c,dev.linux.lists.regressions,org.kernel.vger.linux-gpio |
|---|---|
| Message-ID | <[email protected]> |
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/[email protected]/ > > 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
0001-i2c-designware-Make-check_child_gpioint-skip-devices.patch
(text/x-patch, 2.3 KB)
From e12a71c64b996560d521ea9dda31a8c629b504e4 Mon Sep 17 00:00:00 2001 From: Hans de Goede <[email protected]> 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: [email protected] Signed-off-by: Hans de Goede <[email protected]> --- 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