All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346
@ 2022-12-08 11:02 Hans de Goede
  2022-12-08 13:00 ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2022-12-08 11:02 UTC (permalink / raw)
  To: Rafael J . Wysocki, Mark Gross, Andy Shevchenko
  Cc: Hans de Goede, linux-acpi, platform-driver-x86

The Medion Lifetab S10346 is a x86 tablet which ships with Android x86 as
factory OS. The Android x86 kernel fork ignores I2C devices described in
the DSDT, except for the PMIC and Audio codecs.

As usual the Medion Lifetab S10346's DSDT contains a bunch of extra I2C
devices which are not actually there, causing various resource conflicts.
Add an ACPI_QUIRK_SKIP_I2C_CLIENTS quirk for the Medion Lifetab S10346 to
the acpi_quirk_skip_dmi_ids table to woraround this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/acpi/x86/utils.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index 635de40b5822..4e816bb402f6 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -329,6 +329,17 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
 		.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
 					ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
 	},
+	{
+		/* Medion Lifetab S10346 */
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
+			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
+			/* Way too generic, also match on BIOS data */
+			DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"),
+		},
+		.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
+					ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
+	},
 	{
 		/* Nextbook Ares 8 */
 		.matches = {
-- 
2.38.1


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

* Re: [PATCH 1/2] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346
  2022-12-08 11:02 [PATCH 1/2] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346 Hans de Goede
@ 2022-12-08 13:00 ` Andy Shevchenko
  2022-12-08 13:05   ` Andy Shevchenko
  2022-12-08 14:58   ` Hans de Goede
  0 siblings, 2 replies; 5+ messages in thread
From: Andy Shevchenko @ 2022-12-08 13:00 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Rafael J . Wysocki, Mark Gross, Andy Shevchenko, linux-acpi,
	platform-driver-x86

On Thu, Dec 8, 2022 at 1:02 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> The Medion Lifetab S10346 is a x86 tablet which ships with Android x86 as
> factory OS. The Android x86 kernel fork ignores I2C devices described in
> the DSDT, except for the PMIC and Audio codecs.
>
> As usual the Medion Lifetab S10346's DSDT contains a bunch of extra I2C
> devices which are not actually there, causing various resource conflicts.
> Add an ACPI_QUIRK_SKIP_I2C_CLIENTS quirk for the Medion Lifetab S10346 to
> the acpi_quirk_skip_dmi_ids table to woraround this.

workaround


Both look good to me,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Side note. We adding a lot of DMI matching information here and there
in the drivers and often it gets duplicated in handful of times, Maybe
at some point we can create a global enum and matching table, let's
say driver/platform/x86/dmi-platforms.c with
include/linux/platform_data/x86/platform.h with global enum of the
platforms?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 1/2] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346
  2022-12-08 13:00 ` Andy Shevchenko
@ 2022-12-08 13:05   ` Andy Shevchenko
  2022-12-08 14:58   ` Hans de Goede
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2022-12-08 13:05 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Rafael J . Wysocki, Mark Gross, Andy Shevchenko, linux-acpi,
	platform-driver-x86

On Thu, Dec 8, 2022 at 3:00 PM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, Dec 8, 2022 at 1:02 PM Hans de Goede <hdegoede@redhat.com> wrote:

...

> Side note. We adding a lot of DMI matching information here and there
> in the drivers and often it gets duplicated in handful of times, Maybe
> at some point we can create a global enum and matching table, let's
> say driver/platform/x86/dmi-platforms.c with
> include/linux/platform_data/x86/platform.h with global enum of the
> platforms?

Or even something close to vendor/device API, so you call like

/* h */
enum x86_microsoft_platforms ...;
int x86_dmi_match();

/* c */
enum x86_microsoft_platforms p;
int ret;

ret = x86_dmi_match("Microsoft" /* which is defined either as number
or string */);
if (ret < 0)
  not found
p = ret;

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH 1/2] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346
  2022-12-08 13:00 ` Andy Shevchenko
  2022-12-08 13:05   ` Andy Shevchenko
@ 2022-12-08 14:58   ` Hans de Goede
  2022-12-08 15:09     ` Rafael J. Wysocki
  1 sibling, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2022-12-08 14:58 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rafael J . Wysocki, Mark Gross, Andy Shevchenko, linux-acpi,
	platform-driver-x86

Hi,

On 12/8/22 14:00, Andy Shevchenko wrote:
> On Thu, Dec 8, 2022 at 1:02 PM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> The Medion Lifetab S10346 is a x86 tablet which ships with Android x86 as
>> factory OS. The Android x86 kernel fork ignores I2C devices described in
>> the DSDT, except for the PMIC and Audio codecs.
>>
>> As usual the Medion Lifetab S10346's DSDT contains a bunch of extra I2C
>> devices which are not actually there, causing various resource conflicts.
>> Add an ACPI_QUIRK_SKIP_I2C_CLIENTS quirk for the Medion Lifetab S10346 to
>> the acpi_quirk_skip_dmi_ids table to woraround this.
> 
> workaround
> 
> 
> Both look good to me,
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Thanks. I have merged 2/2 into my review-hans branch now.

> Side note. We adding a lot of DMI matching information here and there
> in the drivers and often it gets duplicated in handful of times, Maybe
> at some point we can create a global enum and matching table, let's
> say driver/platform/x86/dmi-platforms.c with
> include/linux/platform_data/x86/platform.h with global enum of the
> platforms?

Maybe, I'm not sure atm the table in x86-android-tablets.c is
__initconst so it gets free-ed. So resident code-size wise
it would not matter.

And it would require replacing the dmi_system_id table
in x86-android-tablets.c with another way to map the enum
values (replacing the DMI matches) to driver_data for
the specific models. Which at best would also be an
__initconst mapping table...

Regards,

Hans



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

* Re: [PATCH 1/2] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346
  2022-12-08 14:58   ` Hans de Goede
@ 2022-12-08 15:09     ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2022-12-08 15:09 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Andy Shevchenko, Rafael J . Wysocki, Mark Gross, Andy Shevchenko,
	linux-acpi, platform-driver-x86

On Thu, Dec 8, 2022 at 3:58 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 12/8/22 14:00, Andy Shevchenko wrote:
> > On Thu, Dec 8, 2022 at 1:02 PM Hans de Goede <hdegoede@redhat.com> wrote:
> >>
> >> The Medion Lifetab S10346 is a x86 tablet which ships with Android x86 as
> >> factory OS. The Android x86 kernel fork ignores I2C devices described in
> >> the DSDT, except for the PMIC and Audio codecs.
> >>
> >> As usual the Medion Lifetab S10346's DSDT contains a bunch of extra I2C
> >> devices which are not actually there, causing various resource conflicts.
> >> Add an ACPI_QUIRK_SKIP_I2C_CLIENTS quirk for the Medion Lifetab S10346 to
> >> the acpi_quirk_skip_dmi_ids table to woraround this.
> >
> > workaround
> >
> >
> > Both look good to me,
> > Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> Thanks. I have merged 2/2 into my review-hans branch now.

And I've applied the [1/2] as 6.2 material.

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

end of thread, other threads:[~2022-12-08 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-08 11:02 [PATCH 1/2] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346 Hans de Goede
2022-12-08 13:00 ` Andy Shevchenko
2022-12-08 13:05   ` Andy Shevchenko
2022-12-08 14:58   ` Hans de Goede
2022-12-08 15:09     ` Rafael J. Wysocki

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.