linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()
@ 2020-09-09 10:32 Hans de Goede
  2020-09-16 15:56 ` Hans de Goede
  2020-09-17 21:18 ` Wolfram Sang
  0 siblings, 2 replies; 4+ messages in thread
From: Hans de Goede @ 2020-09-09 10:32 UTC (permalink / raw)
  To: Wolfram Sang, Mika Westerberg
  Cc: Hans de Goede, Kai Heng Feng, linux-i2c, linux-acpi

Some ACPI i2c-devices _STA method (which is used to detect if the device
is present) use autodetection code which probes which device is present
over i2c. This requires the I2C ACPI OpRegion handler to be registered
before we enumerate i2c-clients under the i2c-adapter.

This fixes the i2c touchpad on the Lenovo ThinkBook 14-IIL and
ThinkBook 15 IIL not getting an i2c-client instantiated and thus not
working.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1842039
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/i2c/i2c-core-base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 5ec082e2039d..573b5da145d1 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -1464,8 +1464,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 
 	/* create pre-declared device nodes */
 	of_i2c_register_devices(adap);
-	i2c_acpi_register_devices(adap);
 	i2c_acpi_install_space_handler(adap);
+	i2c_acpi_register_devices(adap);
 
 	if (adap->nr < __i2c_first_dynamic_bus_num)
 		i2c_scan_static_board_info(adap);
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()
  2020-09-09 10:32 [PATCH] i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices() Hans de Goede
@ 2020-09-16 15:56 ` Hans de Goede
  2020-09-16 16:04   ` Mika Westerberg
  2020-09-17 21:18 ` Wolfram Sang
  1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2020-09-16 15:56 UTC (permalink / raw)
  To: Wolfram Sang, Mika Westerberg; +Cc: Kai Heng Feng, linux-i2c, linux-acpi

Hi,

On 9/9/20 12:32 PM, Hans de Goede wrote:
> Some ACPI i2c-devices _STA method (which is used to detect if the device
> is present) use autodetection code which probes which device is present
> over i2c. This requires the I2C ACPI OpRegion handler to be registered
> before we enumerate i2c-clients under the i2c-adapter.
> 
> This fixes the i2c touchpad on the Lenovo ThinkBook 14-IIL and
> ThinkBook 15 IIL not getting an i2c-client instantiated and thus not
> working.
> 
> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1842039
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Ping? This fixes a serious problem (non working touchpad on various
laptop models) and is a pretty straight-forward fix.

Arguably it should even go to stable, but I'm not 100% sure about that
because these sorta ACPI enumeration problems can sometimes by
tricky. With that said in this case the fix does seem to be
very straight forward and obviously correct.

Mika, since this deals with the ACPI bits of the i2c-core can
you review this one please?

Regards,

Hans


> ---
>   drivers/i2c/i2c-core-base.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
> index 5ec082e2039d..573b5da145d1 100644
> --- a/drivers/i2c/i2c-core-base.c
> +++ b/drivers/i2c/i2c-core-base.c
> @@ -1464,8 +1464,8 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
>   
>   	/* create pre-declared device nodes */
>   	of_i2c_register_devices(adap);
> -	i2c_acpi_register_devices(adap);
>   	i2c_acpi_install_space_handler(adap);
> +	i2c_acpi_register_devices(adap);
>   
>   	if (adap->nr < __i2c_first_dynamic_bus_num)
>   		i2c_scan_static_board_info(adap);
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()
  2020-09-16 15:56 ` Hans de Goede
@ 2020-09-16 16:04   ` Mika Westerberg
  0 siblings, 0 replies; 4+ messages in thread
From: Mika Westerberg @ 2020-09-16 16:04 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Wolfram Sang, Kai Heng Feng, linux-i2c, linux-acpi

On Wed, Sep 16, 2020 at 05:56:54PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 9/9/20 12:32 PM, Hans de Goede wrote:
> > Some ACPI i2c-devices _STA method (which is used to detect if the device
> > is present) use autodetection code which probes which device is present
> > over i2c. This requires the I2C ACPI OpRegion handler to be registered
> > before we enumerate i2c-clients under the i2c-adapter.
> > 
> > This fixes the i2c touchpad on the Lenovo ThinkBook 14-IIL and
> > ThinkBook 15 IIL not getting an i2c-client instantiated and thus not
> > working.
> > 
> > BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1842039
> > Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> 
> Ping? This fixes a serious problem (non working touchpad on various
> laptop models) and is a pretty straight-forward fix.
> 
> Arguably it should even go to stable, but I'm not 100% sure about that
> because these sorta ACPI enumeration problems can sometimes by
> tricky. With that said in this case the fix does seem to be
> very straight forward and obviously correct.
> 
> Mika, since this deals with the ACPI bits of the i2c-core can
> you review this one please?

Sure, looks like the right thing to do:

Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()
  2020-09-09 10:32 [PATCH] i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices() Hans de Goede
  2020-09-16 15:56 ` Hans de Goede
@ 2020-09-17 21:18 ` Wolfram Sang
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2020-09-17 21:18 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Mika Westerberg, Kai Heng Feng, linux-i2c, linux-acpi

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

On Wed, Sep 09, 2020 at 12:32:33PM +0200, Hans de Goede wrote:
> Some ACPI i2c-devices _STA method (which is used to detect if the device
> is present) use autodetection code which probes which device is present
> over i2c. This requires the I2C ACPI OpRegion handler to be registered
> before we enumerate i2c-clients under the i2c-adapter.
> 
> This fixes the i2c touchpad on the Lenovo ThinkBook 14-IIL and
> ThinkBook 15 IIL not getting an i2c-client instantiated and thus not
> working.
> 
> BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1842039
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Applied to for-current, thanks!


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-17 21:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 10:32 [PATCH] i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices() Hans de Goede
2020-09-16 15:56 ` Hans de Goede
2020-09-16 16:04   ` Mika Westerberg
2020-09-17 21:18 ` Wolfram Sang

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).