linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid
@ 2020-07-02  8:55 Aaron Ma
  2020-07-02  9:30 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Aaron Ma @ 2020-07-02  8:55 UTC (permalink / raw)
  To: aaron.ma, mapengyu, ibm-acpi, dvhart, andy, ibm-acpi-devel,
	platform-driver-x86, linux-kernel

When _BCL invalid, disable thinkpad_acpi backlight brightness control.

brightness_enable is already checked at the beginning,
Always print notice when enabled brightness control.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index ff7f0a4f2475..a52d6d457d6c 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6955,10 +6955,13 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
 			pr_warn("Cannot enable backlight brightness support, ACPI is already handling it.  Refer to the acpi_backlight kernel parameter.\n");
 			return 1;
 		}
-	} else if (tp_features.bright_acpimode && brightness_enable > 1) {
-		pr_notice("Standard ACPI backlight interface not available, thinkpad_acpi native brightness control enabled\n");
+	} else if (!tp_features.bright_acpimode) {
+		pr_notice("thinkpad_acpi backlight interface not available\n");
+		return 1;
 	}
 
+	pr_notice("thinkpad_acpi native brightness control enabled\n");
+
 	/*
 	 * Check for module parameter bogosity, note that we
 	 * init brightness_mode to TPACPI_BRGHT_MODE_MAX in order to be
-- 
2.26.2


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

* Re: [PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid
  2020-07-02  8:55 [PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid Aaron Ma
@ 2020-07-02  9:30 ` Andy Shevchenko
  2020-07-02 10:51   ` Aaron Ma
  2020-07-02 11:07 ` [v2][PATCH] " Aaron Ma
  2020-07-10  1:56 ` [v3][PATCH] " Aaron Ma
  2 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2020-07-02  9:30 UTC (permalink / raw)
  To: Aaron Ma
  Cc: mapengyu, Henrique de Moraes Holschuh, Darren Hart,
	Andy Shevchenko, Thinkpad-acpi devel ML, Platform Driver,
	Linux Kernel Mailing List

On Thu, Jul 2, 2020 at 11:55 AM Aaron Ma <aaron.ma@canonical.com> wrote:
>
> When _BCL invalid, disable thinkpad_acpi backlight brightness control.
>
> brightness_enable is already checked at the beginning,

> Always print notice when enabled brightness control.

Why?

...

> +       pr_notice("thinkpad_acpi native brightness control enabled\n");

'notice' level is quite high, why do we spam users with this?

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid
  2020-07-02  9:30 ` Andy Shevchenko
@ 2020-07-02 10:51   ` Aaron Ma
  2020-07-02 10:59     ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Aaron Ma @ 2020-07-02 10:51 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: mapengyu, Henrique de Moraes Holschuh, Darren Hart,
	Andy Shevchenko, Thinkpad-acpi devel ML, Platform Driver,
	Linux Kernel Mailing List

On 7/2/20 5:30 PM, Andy Shevchenko wrote:
> On Thu, Jul 2, 2020 at 11:55 AM Aaron Ma <aaron.ma@canonical.com> wrote:
>>
>> When _BCL invalid, disable thinkpad_acpi backlight brightness control.
>>
>> brightness_enable is already checked at the beginning,
> 
>> Always print notice when enabled brightness control.
> 
> Why?
> 

Default brightness_enable = 2, so this message will always be printed as before
Actually no change here.

> ...
> 
>> +       pr_notice("thinkpad_acpi native brightness control enabled\n");
> 
> 'notice' level is quite high, why do we spam users with this?
> 

Like above.

Another reason is  most thinkpads are using native gpu driver to control
brightness, notice when thinkpad_acpi brightness is enabled.

Aaron

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

* Re: [PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid
  2020-07-02 10:51   ` Aaron Ma
@ 2020-07-02 10:59     ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2020-07-02 10:59 UTC (permalink / raw)
  To: Aaron Ma
  Cc: mapengyu, Henrique de Moraes Holschuh, Darren Hart,
	Andy Shevchenko, Thinkpad-acpi devel ML, Platform Driver,
	Linux Kernel Mailing List

On Thu, Jul 2, 2020 at 1:51 PM Aaron Ma <aaron.ma@canonical.com> wrote:
> On 7/2/20 5:30 PM, Andy Shevchenko wrote:
> > On Thu, Jul 2, 2020 at 11:55 AM Aaron Ma <aaron.ma@canonical.com> wrote:
> >>
> >> When _BCL invalid, disable thinkpad_acpi backlight brightness control.
> >>
> >> brightness_enable is already checked at the beginning,
> >
> >> Always print notice when enabled brightness control.
> >
> > Why?
> >
>
> Default brightness_enable = 2, so this message will always be printed as before
> Actually no change here.
>
> > ...
> >
> >> +       pr_notice("thinkpad_acpi native brightness control enabled\n");
> >
> > 'notice' level is quite high, why do we spam users with this?
> >
>
> Like above.
>
> Another reason is  most thinkpads are using native gpu driver to control
> brightness, notice when thinkpad_acpi brightness is enabled.

So, based on the above, please elaborate and explain all this in the
commit message of new version, thanks!

-- 
With Best Regards,
Andy Shevchenko

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

* [v2][PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid
  2020-07-02  8:55 [PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid Aaron Ma
  2020-07-02  9:30 ` Andy Shevchenko
@ 2020-07-02 11:07 ` Aaron Ma
  2020-07-09 18:31   ` Andy Shevchenko
  2020-07-10  1:56 ` [v3][PATCH] " Aaron Ma
  2 siblings, 1 reply; 8+ messages in thread
From: Aaron Ma @ 2020-07-02 11:07 UTC (permalink / raw)
  To: aaron.ma, mapengyu, ibm-acpi, dvhart, andy, ibm-acpi-devel,
	platform-driver-x86, linux-kernel

When _BCL invalid, disable thinkpad_acpi backlight brightness control.

brightness_enable is already checked at the beginning.
Most new thinkpads are using GPU driver to control brightness now,
print notice when enabled brightness control even when brightness_enable = 1.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index ff7f0a4f2475..a52d6d457d6c 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6955,10 +6955,13 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
 			pr_warn("Cannot enable backlight brightness support, ACPI is already handling it.  Refer to the acpi_backlight kernel parameter.\n");
 			return 1;
 		}
-	} else if (tp_features.bright_acpimode && brightness_enable > 1) {
-		pr_notice("Standard ACPI backlight interface not available, thinkpad_acpi native brightness control enabled\n");
+	} else if (!tp_features.bright_acpimode) {
+		pr_notice("thinkpad_acpi backlight interface not available\n");
+		return 1;
 	}
 
+	pr_notice("thinkpad_acpi native brightness control enabled\n");
+
 	/*
 	 * Check for module parameter bogosity, note that we
 	 * init brightness_mode to TPACPI_BRGHT_MODE_MAX in order to be
-- 
2.26.2


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

* Re: [v2][PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid
  2020-07-02 11:07 ` [v2][PATCH] " Aaron Ma
@ 2020-07-09 18:31   ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2020-07-09 18:31 UTC (permalink / raw)
  To: Aaron Ma
  Cc: mapengyu, Henrique de Moraes Holschuh, Darren Hart,
	Andy Shevchenko, Thinkpad-acpi devel ML, Platform Driver,
	Linux Kernel Mailing List

On Thu, Jul 2, 2020 at 2:07 PM Aaron Ma <aaron.ma@canonical.com> wrote:
>
> When _BCL invalid, disable thinkpad_acpi backlight brightness control.
>
> brightness_enable is already checked at the beginning.
> Most new thinkpads are using GPU driver to control brightness now,
> print notice when enabled brightness control even when brightness_enable = 1.


> +       } else if (!tp_features.bright_acpimode) {
> +               pr_notice("thinkpad_acpi backlight interface not available\n");
> +               return 1;
>         }
>
> +       pr_notice("thinkpad_acpi native brightness control enabled\n");

In both cases don't you see the duplication of module name in the messages?

-- 
With Best Regards,
Andy Shevchenko

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

* [v3][PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid
  2020-07-02  8:55 [PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid Aaron Ma
  2020-07-02  9:30 ` Andy Shevchenko
  2020-07-02 11:07 ` [v2][PATCH] " Aaron Ma
@ 2020-07-10  1:56 ` Aaron Ma
  2020-07-10 20:38   ` Andy Shevchenko
  2 siblings, 1 reply; 8+ messages in thread
From: Aaron Ma @ 2020-07-10  1:56 UTC (permalink / raw)
  To: aaron.ma, mapengyu, ibm-acpi, dvhart, andy, ibm-acpi-devel,
	platform-driver-x86, linux-kernel

When _BCL invalid, disable thinkpad_acpi backlight brightness control.

brightness_enable is already checked at the beginning.
Most new thinkpads are using GPU driver to control brightness now,
print notice when enabled brightness control even when brightness_enable = 1.

Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index ff7f0a4f2475..2b36d5416a3b 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -6955,10 +6955,13 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
 			pr_warn("Cannot enable backlight brightness support, ACPI is already handling it.  Refer to the acpi_backlight kernel parameter.\n");
 			return 1;
 		}
-	} else if (tp_features.bright_acpimode && brightness_enable > 1) {
-		pr_notice("Standard ACPI backlight interface not available, thinkpad_acpi native brightness control enabled\n");
+	} else if (!tp_features.bright_acpimode) {
+		pr_notice("ACPI backlight interface not available\n");
+		return 1;
 	}
 
+	pr_notice("ACPI native brightness control enabled\n");
+
 	/*
 	 * Check for module parameter bogosity, note that we
 	 * init brightness_mode to TPACPI_BRGHT_MODE_MAX in order to be
-- 
2.26.2


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

* Re: [v3][PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid
  2020-07-10  1:56 ` [v3][PATCH] " Aaron Ma
@ 2020-07-10 20:38   ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2020-07-10 20:38 UTC (permalink / raw)
  To: Aaron Ma
  Cc: mapengyu, Henrique de Moraes Holschuh, Darren Hart,
	Andy Shevchenko, Thinkpad-acpi devel ML, Platform Driver,
	Linux Kernel Mailing List

On Fri, Jul 10, 2020 at 4:56 AM Aaron Ma <aaron.ma@canonical.com> wrote:
>
> When _BCL invalid, disable thinkpad_acpi backlight brightness control.
>
> brightness_enable is already checked at the beginning.
> Most new thinkpads are using GPU driver to control brightness now,
> print notice when enabled brightness control even when brightness_enable = 1.
>

Pushed to my review and testing queue, thanks!

> Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
> ---
>  drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index ff7f0a4f2475..2b36d5416a3b 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -6955,10 +6955,13 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
>                         pr_warn("Cannot enable backlight brightness support, ACPI is already handling it.  Refer to the acpi_backlight kernel parameter.\n");
>                         return 1;
>                 }
> -       } else if (tp_features.bright_acpimode && brightness_enable > 1) {
> -               pr_notice("Standard ACPI backlight interface not available, thinkpad_acpi native brightness control enabled\n");
> +       } else if (!tp_features.bright_acpimode) {
> +               pr_notice("ACPI backlight interface not available\n");
> +               return 1;
>         }
>
> +       pr_notice("ACPI native brightness control enabled\n");
> +
>         /*
>          * Check for module parameter bogosity, note that we
>          * init brightness_mode to TPACPI_BRGHT_MODE_MAX in order to be
> --
> 2.26.2
>


-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2020-07-10 20:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-02  8:55 [PATCH] platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid Aaron Ma
2020-07-02  9:30 ` Andy Shevchenko
2020-07-02 10:51   ` Aaron Ma
2020-07-02 10:59     ` Andy Shevchenko
2020-07-02 11:07 ` [v2][PATCH] " Aaron Ma
2020-07-09 18:31   ` Andy Shevchenko
2020-07-10  1:56 ` [v3][PATCH] " Aaron Ma
2020-07-10 20:38   ` Andy Shevchenko

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