platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: x86-android-tablets: Fix broken touchscreen on Chuwi Hi8 with Windows BIOS
@ 2022-08-10 14:19 Hans de Goede
  2022-08-11 18:52 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2022-08-10 14:19 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko; +Cc: Hans de Goede, platform-driver-x86

The x86-android-tablets handling for the Chuwi Hi8 is only necessary with
the Android BIOS and it is causing problems with the Windows BIOS version.

Specifically when trying to register the already present touchscreen
x86_acpi_irq_helper_get() calls acpi_unregister_gsi(), this breaks
the working of the touchscreen and also leads to an oops:

[   14.248946] ------------[ cut here ]------------
[   14.248954] remove_proc_entry: removing non-empty directory 'irq/75', leaking at least 'MSSL0001:00'
[   14.248983] WARNING: CPU: 3 PID: 440 at fs/proc/generic.c:718 remove_proc_entry
...
[   14.249293]  unregister_irq_proc+0xe0/0x100
[   14.249305]  free_desc+0x29/0x70
[   14.249312]  irq_free_descs+0x4b/0x80
[   14.249320]  mp_unmap_irq+0x5c/0x60
[   14.249329]  acpi_unregister_gsi_ioapic+0x2a/0x40
[   14.249338]  x86_acpi_irq_helper_get+0x4b/0x190 [x86_android_tablets]
[   14.249355]  x86_android_tablet_init+0x178/0xe34 [x86_android_tablets]

Add an init callback for the Chuwi Hi8, which detects when the Windows BIOS
is in use and exits with -ENODEV in that case, fixing this.

Fixes: 84c2dcdd475f ("platform/x86: x86-android-tablets: Add an init() callback to struct x86_dev_info")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/x86-android-tablets.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c
index 480375977435..4acd6fa8d43b 100644
--- a/drivers/platform/x86/x86-android-tablets.c
+++ b/drivers/platform/x86/x86-android-tablets.c
@@ -663,9 +663,23 @@ static const struct x86_i2c_client_info chuwi_hi8_i2c_clients[] __initconst = {
 	},
 };
 
+static int __init chuwi_hi8_init(void)
+{
+	/*
+	 * Avoid the acpi_unregister_gsi() call in x86_acpi_irq_helper_get()
+	 * breaking the touchscreen + logging various errors when the Windows
+	 * BIOS is used.
+	 */
+	if (acpi_dev_present("MSSL0001", NULL, 1))
+		return -ENODEV;
+
+	return 0;
+}
+
 static const struct x86_dev_info chuwi_hi8_info __initconst = {
 	.i2c_client_info = chuwi_hi8_i2c_clients,
 	.i2c_client_count = ARRAY_SIZE(chuwi_hi8_i2c_clients),
+	.init = chuwi_hi8_init,
 };
 
 #define CZC_EC_EXTRA_PORT	0x68
-- 
2.37.1


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

* Re: [PATCH] platform/x86: x86-android-tablets: Fix broken touchscreen on Chuwi Hi8 with Windows BIOS
  2022-08-10 14:19 [PATCH] platform/x86: x86-android-tablets: Fix broken touchscreen on Chuwi Hi8 with Windows BIOS Hans de Goede
@ 2022-08-11 18:52 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2022-08-11 18:52 UTC (permalink / raw)
  To: Mark Gross, Andy Shevchenko; +Cc: platform-driver-x86

Hi All,

On 8/10/22 16:19, Hans de Goede wrote:
> The x86-android-tablets handling for the Chuwi Hi8 is only necessary with
> the Android BIOS and it is causing problems with the Windows BIOS version.
> 
> Specifically when trying to register the already present touchscreen
> x86_acpi_irq_helper_get() calls acpi_unregister_gsi(), this breaks
> the working of the touchscreen and also leads to an oops:
> 
> [   14.248946] ------------[ cut here ]------------
> [   14.248954] remove_proc_entry: removing non-empty directory 'irq/75', leaking at least 'MSSL0001:00'
> [   14.248983] WARNING: CPU: 3 PID: 440 at fs/proc/generic.c:718 remove_proc_entry
> ...
> [   14.249293]  unregister_irq_proc+0xe0/0x100
> [   14.249305]  free_desc+0x29/0x70
> [   14.249312]  irq_free_descs+0x4b/0x80
> [   14.249320]  mp_unmap_irq+0x5c/0x60
> [   14.249329]  acpi_unregister_gsi_ioapic+0x2a/0x40
> [   14.249338]  x86_acpi_irq_helper_get+0x4b/0x190 [x86_android_tablets]
> [   14.249355]  x86_android_tablet_init+0x178/0xe34 [x86_android_tablets]
> 
> Add an init callback for the Chuwi Hi8, which detects when the Windows BIOS
> is in use and exits with -ENODEV in that case, fixing this.
> 
> Fixes: 84c2dcdd475f ("platform/x86: x86-android-tablets: Add an init() callback to struct x86_dev_info")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

I've added this to my review-hans (soon to be for-next) branch now.

Regards,

Hans



> ---
>  drivers/platform/x86/x86-android-tablets.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/platform/x86/x86-android-tablets.c b/drivers/platform/x86/x86-android-tablets.c
> index 480375977435..4acd6fa8d43b 100644
> --- a/drivers/platform/x86/x86-android-tablets.c
> +++ b/drivers/platform/x86/x86-android-tablets.c
> @@ -663,9 +663,23 @@ static const struct x86_i2c_client_info chuwi_hi8_i2c_clients[] __initconst = {
>  	},
>  };
>  
> +static int __init chuwi_hi8_init(void)
> +{
> +	/*
> +	 * Avoid the acpi_unregister_gsi() call in x86_acpi_irq_helper_get()
> +	 * breaking the touchscreen + logging various errors when the Windows
> +	 * BIOS is used.
> +	 */
> +	if (acpi_dev_present("MSSL0001", NULL, 1))
> +		return -ENODEV;
> +
> +	return 0;
> +}
> +
>  static const struct x86_dev_info chuwi_hi8_info __initconst = {
>  	.i2c_client_info = chuwi_hi8_i2c_clients,
>  	.i2c_client_count = ARRAY_SIZE(chuwi_hi8_i2c_clients),
> +	.init = chuwi_hi8_init,
>  };
>  
>  #define CZC_EC_EXTRA_PORT	0x68


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

end of thread, other threads:[~2022-08-11 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-10 14:19 [PATCH] platform/x86: x86-android-tablets: Fix broken touchscreen on Chuwi Hi8 with Windows BIOS Hans de Goede
2022-08-11 18:52 ` Hans de Goede

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