Skip to contentSkip to conversation

platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid

PATCH Superseded Aaron Ma 2 participants 8 messages Jul 2, 2020 – Jul 10, 2020 x86 platform drivers

lore
Share & tools
lore

Aaron Ma

author
#0 lore raw

PATCH 1/1 platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid

When _BCL invalid, disable thinkpad_acpi backlight brightness control.

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

---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +5 -2
index ff7f0a4f2475..a52d6d457d6c 100644
@@ -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
Signature · 1 line
2.26.2
#1 lore raw
Quoted 6 lines · Aaron Ma

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?

...

Quoted 1 line

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

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

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#2 lore raw
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Aaron Ma

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.

Quoted 6 lines

...

Quoted 1 line

+ 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

#3 lore raw
Quoted 19 lines · Aaron Ma
Quoted 10 lines · Andy Shevchenko
Quoted 6 lines · Aaron Ma

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.

Quoted 4 lines

...

Quoted 1 line

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

Quoted 7 lines
Quoted 2 lines

'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!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#4 lore raw

PATCH v2 1/1 platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid

In reply to Aaron Ma

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.

---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +5 -2
index ff7f0a4f2475..a52d6d457d6c 100644
@@ -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
Signature · 1 line
2.26.2
#5 lore raw
Quoted 8 lines · Aaron Ma

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.

drivers/platform/x86/thinkpad_acpi.c static int __init brightness_init(struct ibm_init_struct *iibm) · line 6963

Quoted 6 lines
drivers/platform/x86/thinkpad_acpi.c +4 -0
+       } 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?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#6 lore raw

PATCH v3 1/1 platform/x86: thinkpad_acpi: not loading brightness_init when _BCL invalid

In reply to Aaron Ma

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.

---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +5 -2
index ff7f0a4f2475..2b36d5416a3b 100644
@@ -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
Signature · 1 line
2.26.2
#7 lore raw
Quoted 7 lines · Aaron Ma

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!

Quoted 28 lines
---
 drivers/platform/x86/thinkpad_acpi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/platform/x86/thinkpad_acpi.c +5 -3
index ff7f0a4f2475..2b36d5416a3b 100644
@@ -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

Signature · 2 lines
With Best Regards,
Andy Shevchenko