Re: [External]Re: [PATCH v2] platform/x86: think-lmi: add debug_cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans

On 2021-08-18 3:44 a.m., Hans de Goede wrote:
Hi,

On 8/17/21 2:15 AM, Mark Pearson wrote:
Many Lenovo BIOS's support the ability to send a debug command which
is useful for debugging and testing unreleased or early features.

Adding support for this feature as a module parameter.

Signed-off-by: Mark Pearson <markpearson@xxxxxxxxxx>
---
Changes in v2:
  - Updated to use debug_support parameter to enable feature
  - remove changes to pending_reboot as that was integrated separately

  .../testing/sysfs-class-firmware-attributes   | 11 +++
  drivers/platform/x86/think-lmi.c              | 80 +++++++++++++++++++
  drivers/platform/x86/think-lmi.h              |  1 +
  3 files changed, 92 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-class-firmware-attributes b/Documentation/ABI/testing/sysfs-class-firmware-attributes
index 0b43997b76e3..90fdf935aa5e 100644
--- a/Documentation/ABI/testing/sysfs-class-firmware-attributes
+++ b/Documentation/ABI/testing/sysfs-class-firmware-attributes
@@ -272,3 +272,14 @@ Description:
Note that any changes to this attribute requires a reboot
  		for changes to take effect.
+
+What:		/sys/class/firmware-attributes/*/attributes/debug_cmd
+Date:		July 2021
+KernelVersion:	5.14
+Contact:	Mark Pearson <markpearson@xxxxxxxxxx>
+Description:
+		This write only attribute can be used to send debug commands to the BIOS.
+		This should only be used when recommended by the BIOS vendor. Vendors may
+		use it to enable extra debug attributes or BIOS features for testing purposes.
+
+		Note that any changes to this attribute requires a reboot for changes to take effect.
diff --git a/drivers/platform/x86/think-lmi.c b/drivers/platform/x86/think-lmi.c
index 6cfed4427fb0..4d246bfe4907 100644
--- a/drivers/platform/x86/think-lmi.c
+++ b/drivers/platform/x86/think-lmi.c
@@ -20,6 +20,10 @@
  #include "firmware_attributes_class.h"
  #include "think-lmi.h"
+static bool debug_support;
+module_param(debug_support, bool, 0644);

0644 implies the setting can be changed at runtime, but it is checked
only at driver bind + unbind time, so this should be 0444.
Good catch - thanks!

Since the rest of the patch looks good, I've fixed this up while merging
the patch.
Awesome - thank you!

Mark



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux