linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] platform/x86: dell-laptop: fix broken kbd backlight on Inspiron 10xx
  2019-09-25  8:21           ` Pali Rohár
@ 2019-09-11 22:07             ` Pacien TRAN-GIRARD
  2019-09-25 13:18               ` Mario.Limonciello
  2019-09-25 15:06               ` Andy Shevchenko
  0 siblings, 2 replies; 12+ messages in thread
From: Pacien TRAN-GIRARD @ 2019-09-11 22:07 UTC (permalink / raw)
  Cc: Pali Rohár, Mario Limonciello, Matthew Garrett, Darren Hart,
	Andy Shevchenko, Platform Driver, Linux Kernel Mailing List

This patch adds a quirk disabling keyboard backlight support for the
Dell Inspiron 1012 and 1018.

Those models wrongly report supporting keyboard backlight control
features (through SMBIOS tokens) even though they're not equipped with
a backlit keyboard. This led to broken controls being exposed
through sysfs by this driver which froze the system when used.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
---
 drivers/platform/x86/dell-laptop.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index d27be2836bc2..ffe5abbdadda 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -33,6 +33,7 @@
 
 struct quirk_entry {
 	bool touchpad_led;
+	bool kbd_broken_backlight;
 	bool kbd_led_levels_off_1;
 	bool kbd_missing_ac_tag;
 
@@ -73,6 +74,10 @@ static struct quirk_entry quirk_dell_latitude_e6410 = {
 	.kbd_led_levels_off_1 = true,
 };
 
+static struct quirk_entry quirk_dell_inspiron_1012 = {
+	.kbd_broken_backlight = true,
+};
+
 static struct platform_driver platform_driver = {
 	.driver = {
 		.name = "dell-laptop",
@@ -310,6 +315,24 @@ static const struct dmi_system_id dell_quirks[] __initconst = {
 		},
 		.driver_data = &quirk_dell_latitude_e6410,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inspiron 1012",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
+		},
+		.driver_data = &quirk_dell_inspiron_1012,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inspiron 1018",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1018"),
+		},
+		.driver_data = &quirk_dell_inspiron_1012,
+	},
 	{ }
 };
 
@@ -2040,6 +2063,9 @@ static int __init kbd_led_init(struct device *dev)
 {
 	int ret;
 
+	if (quirks && quirks->kbd_broken_backlight)
+		return -ENODEV;
+
 	kbd_init();
 	if (!kbd_led_present)
 		return -ENODEV;
-- 
2.19.2

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

* Re: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on Inspiron 10xx
       [not found] <156824368856.28378.14511879419677114177@WARFSTATION>
@ 2019-09-12  7:33 ` Pali Rohár
  2019-09-12 13:30   ` Andy Shevchenko
       [not found]   ` <156882055514.9370.16951540573597044820@WARFSTATION>
  0 siblings, 2 replies; 12+ messages in thread
From: Pali Rohár @ 2019-09-12  7:33 UTC (permalink / raw)
  To: Pacien TRAN-GIRARD
  Cc: Matthew Garrett, Darren Hart, Andy Shevchenko,
	platform-driver-x86, linux-kernel

On Thursday 12 September 2019 01:14:48 Pacien TRAN-GIRARD wrote:
> This patch registers a quirk disabling keyboard backlight support
> for the Dell Inspiron 1012 and 1018.
> 
> Those models wrongly report supporting the KBD_LED_OFF_TOKEN and
> KBD_LED_ON_TOKEN SMBIOS tokens, exposing keyboard brightness controls
> through sysfs which freeze the system when used.
> 
> The associated SMBIOS calls never return and cause the system to
> hang, notably at boot when systemd-backlight tries to restore
> previous brightness settings.

Hi! This sounds like a firmware bug. Have you already reported it to Dell?

> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
> Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on Inspiron 10xx
  2019-09-12  7:33 ` [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on Inspiron 10xx Pali Rohár
@ 2019-09-12 13:30   ` Andy Shevchenko
       [not found]   ` <156882055514.9370.16951540573597044820@WARFSTATION>
  1 sibling, 0 replies; 12+ messages in thread
From: Andy Shevchenko @ 2019-09-12 13:30 UTC (permalink / raw)
  To: Pali Rohár, Mario Limonciello
  Cc: Pacien TRAN-GIRARD, Matthew Garrett, Darren Hart,
	Andy Shevchenko, Platform Driver, Linux Kernel Mailing List

+Cc: Mario

On Thu, Sep 12, 2019 at 10:34 AM Pali Rohár <pali.rohar@gmail.com> wrote:
>
> On Thursday 12 September 2019 01:14:48 Pacien TRAN-GIRARD wrote:
> > This patch registers a quirk disabling keyboard backlight support
> > for the Dell Inspiron 1012 and 1018.
> >
> > Those models wrongly report supporting the KBD_LED_OFF_TOKEN and
> > KBD_LED_ON_TOKEN SMBIOS tokens, exposing keyboard brightness controls
> > through sysfs which freeze the system when used.
> >
> > The associated SMBIOS calls never return and cause the system to
> > hang, notably at boot when systemd-backlight tries to restore
> > previous brightness settings.
>
> Hi! This sounds like a firmware bug. Have you already reported it to Dell?
>
> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
> > Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
>
> --
> Pali Rohár
> pali.rohar@gmail.com



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on Inspiron 10xx
       [not found]   ` <156882055514.9370.16951540573597044820@WARFSTATION>
@ 2019-09-22 13:43     ` Pali Rohár
  2019-09-23 13:24       ` Mario.Limonciello
  0 siblings, 1 reply; 12+ messages in thread
From: Pali Rohár @ 2019-09-22 13:43 UTC (permalink / raw)
  To: Pacien TRAN-GIRARD
  Cc: Matthew Garrett, Darren Hart, Andy Shevchenko,
	platform-driver-x86, linux-kernel, mario.limonciello

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

On Wednesday 18 September 2019 17:29:15 Pacien TRAN-GIRARD wrote:
> Quoting Pali Rohár (2019-09-12 09:33:58)
> > On Thursday 12 September 2019 01:14:48 Pacien TRAN-GIRARD wrote:
> > > This patch registers a quirk disabling keyboard backlight support
> > > for the Dell Inspiron 1012 and 1018.
> > > 
> > > Those models wrongly report supporting the KBD_LED_OFF_TOKEN and
> > > KBD_LED_ON_TOKEN SMBIOS tokens, exposing keyboard brightness controls
> > > through sysfs which freeze the system when used.
> > > 
> > > The associated SMBIOS calls never return and cause the system to
> > > hang, notably at boot when systemd-backlight tries to restore
> > > previous brightness settings.
> > 
> > Hi! This sounds like a firmware bug. Have you already reported it to Dell?
> 
> Yes, the issue has been reported to Dell's technical support, which didn't
> provide a satisfying answer.

There were already some firmware problems with keyboard backlight and
Mario posted this comment about Linux support:
https://github.com/dell/libsmbios/issues/48#issuecomment-391328501

Can you try to use libsmbios tools and if they do not work too, report
problem also there?

> I'm not familiar with Dell's policy, but I doubt that they would issue a
> BIOS update for discontinued models from 2010.

We need to wait what Mario wrote about this particular problem.

> > 
> > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
> > > Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
> > 
> > -- 
> > Pali Rohr
> > pali.rohar@gmail.com
> 
> --
> Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>

-- 
Pali Rohár
pali.rohar@gmail.com

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

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

* RE: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on Inspiron 10xx
  2019-09-22 13:43     ` Pali Rohár
@ 2019-09-23 13:24       ` Mario.Limonciello
  2019-09-25  8:07         ` Andy Shevchenko
  0 siblings, 1 reply; 12+ messages in thread
From: Mario.Limonciello @ 2019-09-23 13:24 UTC (permalink / raw)
  To: pali.rohar, pacien.trangirard
  Cc: mjg59, dvhart, andy, platform-driver-x86, linux-kernel

> -----Original Message-----
> From: Pali Rohár <pali.rohar@gmail.com>
> Sent: Sunday, September 22, 2019 8:43 AM
> To: Pacien TRAN-GIRARD
> Cc: Matthew Garrett; Darren Hart; Andy Shevchenko; platform-driver-
> x86@vger.kernel.org; linux-kernel@vger.kernel.org; Limonciello, Mario
> Subject: Re: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on
> Inspiron 10xx
> 
> On Wednesday 18 September 2019 17:29:15 Pacien TRAN-GIRARD wrote:
> > Quoting Pali Rohár (2019-09-12 09:33:58)
> > > On Thursday 12 September 2019 01:14:48 Pacien TRAN-GIRARD wrote:
> > > > This patch registers a quirk disabling keyboard backlight support
> > > > for the Dell Inspiron 1012 and 1018.
> > > >
> > > > Those models wrongly report supporting the KBD_LED_OFF_TOKEN and
> > > > KBD_LED_ON_TOKEN SMBIOS tokens, exposing keyboard brightness
> > > > controls through sysfs which freeze the system when used.
> > > >
> > > > The associated SMBIOS calls never return and cause the system to
> > > > hang, notably at boot when systemd-backlight tries to restore
> > > > previous brightness settings.
> > >
> > > Hi! This sounds like a firmware bug. Have you already reported it to Dell?
> >
> > Yes, the issue has been reported to Dell's technical support, which
> > didn't provide a satisfying answer.
> 
> There were already some firmware problems with keyboard backlight and Mario
> posted this comment about Linux support:
> https://github.com/dell/libsmbios/issues/48#issuecomment-391328501
> 
> Can you try to use libsmbios tools and if they do not work too, report problem
> also there?
> 
> > I'm not familiar with Dell's policy, but I doubt that they would issue
> > a BIOS update for discontinued models from 2010.
> 
> We need to wait what Mario wrote about this particular problem.
> 

I agree an Inspiron is unlikely to be updated 9 years later.  I think the right thing
to do in this instance is to blacklist this particular platform in kernel driver.

> > >
> > > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
> > > > Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
> > >
> > > --
> > > Pali Rohr
> > > pali.rohar@gmail.com
> >
> > --
> > Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
> 
> --
> Pali Rohár
> pali.rohar@gmail.com

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

* Re: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on Inspiron 10xx
  2019-09-23 13:24       ` Mario.Limonciello
@ 2019-09-25  8:07         ` Andy Shevchenko
  2019-09-25  8:21           ` Pali Rohár
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2019-09-25  8:07 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: Pali Rohár, Pacien TRAN-GIRARD, Matthew Garrett,
	Darren Hart, Andy Shevchenko, Platform Driver,
	Linux Kernel Mailing List

On Mon, Sep 23, 2019 at 4:24 PM <Mario.Limonciello@dell.com> wrote:
> > From: Pali Rohár <pali.rohar@gmail.com>
> > Sent: Sunday, September 22, 2019 8:43 AM
> > To: Pacien TRAN-GIRARD
> > Cc: Matthew Garrett; Darren Hart; Andy Shevchenko; platform-driver-
> > x86@vger.kernel.org; linux-kernel@vger.kernel.org; Limonciello, Mario
> > Subject: Re: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on
> > Inspiron 10xx

> > We need to wait what Mario wrote about this particular problem.
> >
>
> I agree an Inspiron is unlikely to be updated 9 years later.  I think the right thing
> to do in this instance is to blacklist this particular platform in kernel driver.

Does it mean you are okay with the proposed patch? Can you give your tag then?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on Inspiron 10xx
  2019-09-25  8:07         ` Andy Shevchenko
@ 2019-09-25  8:21           ` Pali Rohár
  2019-09-11 22:07             ` [PATCH v2] platform/x86: dell-laptop: fix broken " Pacien TRAN-GIRARD
  0 siblings, 1 reply; 12+ messages in thread
From: Pali Rohár @ 2019-09-25  8:21 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Mario Limonciello, Pacien TRAN-GIRARD, Matthew Garrett,
	Darren Hart, Andy Shevchenko, Platform Driver,
	Linux Kernel Mailing List

On Wednesday 25 September 2019 11:07:35 Andy Shevchenko wrote:
> On Mon, Sep 23, 2019 at 4:24 PM <Mario.Limonciello@dell.com> wrote:
> > > From: Pali Rohár <pali.rohar@gmail.com>
> > > Sent: Sunday, September 22, 2019 8:43 AM
> > > To: Pacien TRAN-GIRARD
> > > Cc: Matthew Garrett; Darren Hart; Andy Shevchenko; platform-driver-
> > > x86@vger.kernel.org; linux-kernel@vger.kernel.org; Limonciello, Mario
> > > Subject: Re: [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on
> > > Inspiron 10xx
> 
> > > We need to wait what Mario wrote about this particular problem.
> > >
> >
> > I agree an Inspiron is unlikely to be updated 9 years later.  I think the right thing
> > to do in this instance is to blacklist this particular platform in kernel driver.
> 
> Does it mean you are okay with the proposed patch? Can you give your tag then?

I would rather use different name as kbd_phantom_backlight. E.g.
lbd_broken_backlight or something which indicates non-working / disabled
support.

Also in commit message is written that problem is with KBD_LED_OFF_TOKEN
and KBD_LED_ON_TOKEN tokens, but proposed patch does not blacklist these
tokens, but rather turn off whole kbd functionality. So proposed patch
does not patch commit message, nor explain it.

-- 
Pali Rohár
pali.rohar@gmail.com

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

* RE: [PATCH v2] platform/x86: dell-laptop: fix broken kbd backlight on Inspiron 10xx
  2019-09-11 22:07             ` [PATCH v2] platform/x86: dell-laptop: fix broken " Pacien TRAN-GIRARD
@ 2019-09-25 13:18               ` Mario.Limonciello
  2019-09-25 15:06               ` Andy Shevchenko
  1 sibling, 0 replies; 12+ messages in thread
From: Mario.Limonciello @ 2019-09-25 13:18 UTC (permalink / raw)
  To: pacien.trangirard
  Cc: pali.rohar, mjg59, dvhart, andy, platform-driver-x86, linux-kernel

> -----Original Message-----
> From: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
> Sent: Wednesday, September 25, 2019 4:48 AM
> Cc: Pali Rohár; Limonciello, Mario; Matthew Garrett; Darren Hart; Andy
> Shevchenko; Platform Driver; Linux Kernel Mailing List
> Subject: [PATCH v2] platform/x86: dell-laptop: fix broken kbd backlight on
> Inspiron 10xx
> 
> 
> [EXTERNAL EMAIL]
> 
> This patch adds a quirk disabling keyboard backlight support for the
> Dell Inspiron 1012 and 1018.
> 
> Those models wrongly report supporting keyboard backlight control
> features (through SMBIOS tokens) even though they're not equipped with
> a backlit keyboard. This led to broken controls being exposed
> through sysfs by this driver which froze the system when used.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
> Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
> ---
>  drivers/platform/x86/dell-laptop.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-
> laptop.c
> index d27be2836bc2..ffe5abbdadda 100644
> --- a/drivers/platform/x86/dell-laptop.c
> +++ b/drivers/platform/x86/dell-laptop.c
> @@ -33,6 +33,7 @@
> 
>  struct quirk_entry {
>  	bool touchpad_led;
> +	bool kbd_broken_backlight;
>  	bool kbd_led_levels_off_1;
>  	bool kbd_missing_ac_tag;
> 
> @@ -73,6 +74,10 @@ static struct quirk_entry quirk_dell_latitude_e6410 = {
>  	.kbd_led_levels_off_1 = true,
>  };
> 
> +static struct quirk_entry quirk_dell_inspiron_1012 = {
> +	.kbd_broken_backlight = true,
> +};
> +
>  static struct platform_driver platform_driver = {
>  	.driver = {
>  		.name = "dell-laptop",
> @@ -310,6 +315,24 @@ static const struct dmi_system_id dell_quirks[]
> __initconst = {
>  		},
>  		.driver_data = &quirk_dell_latitude_e6410,
>  	},
> +	{
> +		.callback = dmi_matched,
> +		.ident = "Dell Inspiron 1012",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
> +		},
> +		.driver_data = &quirk_dell_inspiron_1012,
> +	},
> +	{
> +		.callback = dmi_matched,
> +		.ident = "Dell Inspiron 1018",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1018"),
> +		},
> +		.driver_data = &quirk_dell_inspiron_1012,
> +	},
>  	{ }
>  };
> 
> @@ -2040,6 +2063,9 @@ static int __init kbd_led_init(struct device *dev)
>  {
>  	int ret;
> 
> +	if (quirks && quirks->kbd_broken_backlight)
> +		return -ENODEV;
> +
>  	kbd_init();
>  	if (!kbd_led_present)
>  		return -ENODEV;
> --
> 2.19.2

Looks fine to me, thanks.

Reviewed-by: Mario Limonciello <mario.limonciello@dell.com>


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

* Re: [PATCH v2] platform/x86: dell-laptop: fix broken kbd backlight on Inspiron 10xx
  2019-09-11 22:07             ` [PATCH v2] platform/x86: dell-laptop: fix broken " Pacien TRAN-GIRARD
  2019-09-25 13:18               ` Mario.Limonciello
@ 2019-09-25 15:06               ` Andy Shevchenko
  2019-09-26  8:11                 ` Pali Rohár
  1 sibling, 1 reply; 12+ messages in thread
From: Andy Shevchenko @ 2019-09-25 15:06 UTC (permalink / raw)
  To: Pacien TRAN-GIRARD
  Cc: Pali Rohár, Mario Limonciello, Matthew Garrett, Darren Hart,
	Andy Shevchenko, Platform Driver, Linux Kernel Mailing List

On Wed, Sep 25, 2019 at 12:48 PM Pacien TRAN-GIRARD
<pacien.trangirard@pacien.net> wrote:
>
> This patch adds a quirk disabling keyboard backlight support for the
> Dell Inspiron 1012 and 1018.
>
> Those models wrongly report supporting keyboard backlight control
> features (through SMBIOS tokens) even though they're not equipped with
> a backlit keyboard. This led to broken controls being exposed
> through sysfs by this driver which froze the system when used.
>

Pali, are you okay with this one?

> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
> Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
> ---
>  drivers/platform/x86/dell-laptop.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
> index d27be2836bc2..ffe5abbdadda 100644
> --- a/drivers/platform/x86/dell-laptop.c
> +++ b/drivers/platform/x86/dell-laptop.c
> @@ -33,6 +33,7 @@
>
>  struct quirk_entry {
>         bool touchpad_led;
> +       bool kbd_broken_backlight;
>         bool kbd_led_levels_off_1;
>         bool kbd_missing_ac_tag;
>
> @@ -73,6 +74,10 @@ static struct quirk_entry quirk_dell_latitude_e6410 = {
>         .kbd_led_levels_off_1 = true,
>  };
>
> +static struct quirk_entry quirk_dell_inspiron_1012 = {
> +       .kbd_broken_backlight = true,
> +};
> +
>  static struct platform_driver platform_driver = {
>         .driver = {
>                 .name = "dell-laptop",
> @@ -310,6 +315,24 @@ static const struct dmi_system_id dell_quirks[] __initconst = {
>                 },
>                 .driver_data = &quirk_dell_latitude_e6410,
>         },
> +       {
> +               .callback = dmi_matched,
> +               .ident = "Dell Inspiron 1012",
> +               .matches = {
> +                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +                       DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
> +               },
> +               .driver_data = &quirk_dell_inspiron_1012,
> +       },
> +       {
> +               .callback = dmi_matched,
> +               .ident = "Dell Inspiron 1018",
> +               .matches = {
> +                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +                       DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1018"),
> +               },
> +               .driver_data = &quirk_dell_inspiron_1012,
> +       },
>         { }
>  };
>
> @@ -2040,6 +2063,9 @@ static int __init kbd_led_init(struct device *dev)
>  {
>         int ret;
>
> +       if (quirks && quirks->kbd_broken_backlight)
> +               return -ENODEV;
> +
>         kbd_init();
>         if (!kbd_led_present)
>                 return -ENODEV;
> --
> 2.19.2



-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH v2] platform/x86: dell-laptop: fix broken kbd backlight on Inspiron 10xx
  2019-09-25 15:06               ` Andy Shevchenko
@ 2019-09-26  8:11                 ` Pali Rohár
  2019-09-27 21:19                   ` [PATCH v3] platform/x86: dell-laptop: disable " Pacien TRAN-GIRARD
  0 siblings, 1 reply; 12+ messages in thread
From: Pali Rohár @ 2019-09-26  8:11 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Pacien TRAN-GIRARD, Mario Limonciello, Matthew Garrett,
	Darren Hart, Andy Shevchenko, Platform Driver,
	Linux Kernel Mailing List

On Wednesday 25 September 2019 18:06:40 Andy Shevchenko wrote:
> On Wed, Sep 25, 2019 at 12:48 PM Pacien TRAN-GIRARD
> <pacien.trangirard@pacien.net> wrote:
> >
> > This patch adds a quirk disabling keyboard backlight support for the
> > Dell Inspiron 1012 and 1018.
> >
> > Those models wrongly report supporting keyboard backlight control
> > features (through SMBIOS tokens) even though they're not equipped with
> > a backlit keyboard. This led to broken controls being exposed
> > through sysfs by this driver which froze the system when used.
> >
> 
> Pali, are you okay with this one?

So the real problem is that kbd backlight is not broken, but rather
laptop is without backlight keyboard? I thought that just API was broken
and keyboard backlight needs to be configured somehow else (via
dedicated buttons, etc...).

If yes, then I guess that check for quirk should be in kbd_init()
function which do detection if keyboard backlight is present or not.
And better name for quirk could be "kbd_led_not_present"...

> > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
> > Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
> > ---
> >  drivers/platform/x86/dell-laptop.c | 26 ++++++++++++++++++++++++++
> >  1 file changed, 26 insertions(+)
> >
> > diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
> > index d27be2836bc2..ffe5abbdadda 100644
> > --- a/drivers/platform/x86/dell-laptop.c
> > +++ b/drivers/platform/x86/dell-laptop.c
> > @@ -33,6 +33,7 @@
> >
> >  struct quirk_entry {
> >         bool touchpad_led;
> > +       bool kbd_broken_backlight;
> >         bool kbd_led_levels_off_1;
> >         bool kbd_missing_ac_tag;
> >
> > @@ -73,6 +74,10 @@ static struct quirk_entry quirk_dell_latitude_e6410 = {
> >         .kbd_led_levels_off_1 = true,
> >  };
> >
> > +static struct quirk_entry quirk_dell_inspiron_1012 = {
> > +       .kbd_broken_backlight = true,
> > +};
> > +
> >  static struct platform_driver platform_driver = {
> >         .driver = {
> >                 .name = "dell-laptop",
> > @@ -310,6 +315,24 @@ static const struct dmi_system_id dell_quirks[] __initconst = {
> >                 },
> >                 .driver_data = &quirk_dell_latitude_e6410,
> >         },
> > +       {
> > +               .callback = dmi_matched,
> > +               .ident = "Dell Inspiron 1012",
> > +               .matches = {
> > +                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> > +                       DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
> > +               },
> > +               .driver_data = &quirk_dell_inspiron_1012,
> > +       },
> > +       {
> > +               .callback = dmi_matched,
> > +               .ident = "Dell Inspiron 1018",
> > +               .matches = {
> > +                       DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> > +                       DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1018"),
> > +               },
> > +               .driver_data = &quirk_dell_inspiron_1012,
> > +       },
> >         { }
> >  };
> >
> > @@ -2040,6 +2063,9 @@ static int __init kbd_led_init(struct device *dev)
> >  {
> >         int ret;
> >
> > +       if (quirks && quirks->kbd_broken_backlight)
> > +               return -ENODEV;
> > +
> >         kbd_init();
> >         if (!kbd_led_present)
> >                 return -ENODEV;
> > --
> > 2.19.2
> 
> 
> 

-- 
Pali Rohár
pali.rohar@gmail.com

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

* [PATCH v3] platform/x86: dell-laptop: disable kbd backlight on Inspiron 10xx
  2019-09-26  8:11                 ` Pali Rohár
@ 2019-09-27 21:19                   ` Pacien TRAN-GIRARD
  2019-09-27 21:58                     ` Pali Rohár
  0 siblings, 1 reply; 12+ messages in thread
From: Pacien TRAN-GIRARD @ 2019-09-27 21:19 UTC (permalink / raw)
  To: Pali Rohar, Andy Shevchenko
  Cc: Mario Limonciello, Matthew Garrett, Darren Hart, Andy Shevchenko,
	Platform Driver, Linux Kernel Mailing List

This patch adds a quirk disabling keyboard backlight support for the
Dell Inspiron 1012 and 1018.

Those models wrongly report supporting keyboard backlight control
features (through SMBIOS tokens) even though they're not equipped with
a backlit keyboard. This led to broken controls being exposed
through sysfs by this driver which froze the system when used.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
---
 drivers/platform/x86/dell-laptop.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index d27be2836bc2..74e988f839e8 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -33,6 +33,7 @@
 
 struct quirk_entry {
 	bool touchpad_led;
+	bool kbd_led_not_present;
 	bool kbd_led_levels_off_1;
 	bool kbd_missing_ac_tag;
 
@@ -73,6 +74,10 @@ static struct quirk_entry quirk_dell_latitude_e6410 = {
 	.kbd_led_levels_off_1 = true,
 };
 
+static struct quirk_entry quirk_dell_inspiron_1012 = {
+	.kbd_led_not_present = true,
+};
+
 static struct platform_driver platform_driver = {
 	.driver = {
 		.name = "dell-laptop",
@@ -310,6 +315,24 @@ static const struct dmi_system_id dell_quirks[] __initconst = {
 		},
 		.driver_data = &quirk_dell_latitude_e6410,
 	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inspiron 1012",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
+		},
+		.driver_data = &quirk_dell_inspiron_1012,
+	},
+	{
+		.callback = dmi_matched,
+		.ident = "Dell Inspiron 1018",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1018"),
+		},
+		.driver_data = &quirk_dell_inspiron_1012,
+	},
 	{ }
 };
 
@@ -1493,6 +1516,9 @@ static void kbd_init(void)
 {
 	int ret;
 
+	if (quirks && quirks->kbd_led_not_present)
+		return;
+
 	ret = kbd_init_info();
 	kbd_init_tokens();
 
-- 
2.19.2

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

* Re: [PATCH v3] platform/x86: dell-laptop: disable kbd backlight on Inspiron 10xx
  2019-09-27 21:19                   ` [PATCH v3] platform/x86: dell-laptop: disable " Pacien TRAN-GIRARD
@ 2019-09-27 21:58                     ` Pali Rohár
  0 siblings, 0 replies; 12+ messages in thread
From: Pali Rohár @ 2019-09-27 21:58 UTC (permalink / raw)
  To: Pacien TRAN-GIRARD
  Cc: Andy Shevchenko, Mario Limonciello, Matthew Garrett, Darren Hart,
	Andy Shevchenko, Platform Driver, Linux Kernel Mailing List

On Friday 27 September 2019 23:19:03 Pacien TRAN-GIRARD wrote:
> This patch adds a quirk disabling keyboard backlight support for the
> Dell Inspiron 1012 and 1018.
> 
> Those models wrongly report supporting keyboard backlight control
> features (through SMBIOS tokens) even though they're not equipped with
> a backlit keyboard. This led to broken controls being exposed
> through sysfs by this driver which froze the system when used.
> 
> Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=107651
> Signed-off-by: Pacien TRAN-GIRARD <pacien.trangirard@pacien.net>
> ---

Thank you for update! Now it is clear what is the problem
and you can add my

Reviewed-by: Pali Rohár <pali.rohar@gmail.com>

>  drivers/platform/x86/dell-laptop.c | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
> index d27be2836bc2..74e988f839e8 100644
> --- a/drivers/platform/x86/dell-laptop.c
> +++ b/drivers/platform/x86/dell-laptop.c
> @@ -33,6 +33,7 @@
>  
>  struct quirk_entry {
>  	bool touchpad_led;
> +	bool kbd_led_not_present;
>  	bool kbd_led_levels_off_1;
>  	bool kbd_missing_ac_tag;
>  
> @@ -73,6 +74,10 @@ static struct quirk_entry quirk_dell_latitude_e6410 = {
>  	.kbd_led_levels_off_1 = true,
>  };
>  
> +static struct quirk_entry quirk_dell_inspiron_1012 = {
> +	.kbd_led_not_present = true,
> +};
> +
>  static struct platform_driver platform_driver = {
>  	.driver = {
>  		.name = "dell-laptop",
> @@ -310,6 +315,24 @@ static const struct dmi_system_id dell_quirks[] __initconst = {
>  		},
>  		.driver_data = &quirk_dell_latitude_e6410,
>  	},
> +	{
> +		.callback = dmi_matched,
> +		.ident = "Dell Inspiron 1012",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1012"),
> +		},
> +		.driver_data = &quirk_dell_inspiron_1012,
> +	},
> +	{
> +		.callback = dmi_matched,
> +		.ident = "Dell Inspiron 1018",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 1018"),
> +		},
> +		.driver_data = &quirk_dell_inspiron_1012,
> +	},
>  	{ }
>  };
>  
> @@ -1493,6 +1516,9 @@ static void kbd_init(void)
>  {
>  	int ret;
>  
> +	if (quirks && quirks->kbd_led_not_present)
> +		return;
> +
>  	ret = kbd_init_info();
>  	kbd_init_tokens();
>  

-- 
Pali Rohár
pali.rohar@gmail.com

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

end of thread, other threads:[~2019-09-27 21:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <156824368856.28378.14511879419677114177@WARFSTATION>
2019-09-12  7:33 ` [PATCH] platform/x86: dell-laptop: fix phantom kbd backlight on Inspiron 10xx Pali Rohár
2019-09-12 13:30   ` Andy Shevchenko
     [not found]   ` <156882055514.9370.16951540573597044820@WARFSTATION>
2019-09-22 13:43     ` Pali Rohár
2019-09-23 13:24       ` Mario.Limonciello
2019-09-25  8:07         ` Andy Shevchenko
2019-09-25  8:21           ` Pali Rohár
2019-09-11 22:07             ` [PATCH v2] platform/x86: dell-laptop: fix broken " Pacien TRAN-GIRARD
2019-09-25 13:18               ` Mario.Limonciello
2019-09-25 15:06               ` Andy Shevchenko
2019-09-26  8:11                 ` Pali Rohár
2019-09-27 21:19                   ` [PATCH v3] platform/x86: dell-laptop: disable " Pacien TRAN-GIRARD
2019-09-27 21:58                     ` Pali Rohár

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