diff mbox series

[2/3] hwmon: (dell-smm) Add FW_BUG to SMM warning message

Message ID 20220821151713.11198-3-W_Armin@gmx.de (mailing list archive)
State Superseded
Headers show
Series hwmon: (dell-smm) Minor fixes | expand

Commit Message

Armin Wolf Aug. 21, 2022, 3:17 p.m. UTC
When a SMM call takes very long to execute, then it definitely
is a firmware bug which should be marked with FW_BUG.
Also add the number of the buggy SMM call to the warning message
so BIOS developers, etc immediately know which part of the SMM
interface is buggy.

Tested on a Dell Inspiron 3505.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 drivers/hwmon/dell-smm-hwmon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--
2.30.2

Comments

Pali Rohár Aug. 21, 2022, 3:43 p.m. UTC | #1
On Sunday 21 August 2022 17:17:12 Armin Wolf wrote:
> When a SMM call takes very long to execute, then it definitely
> is a firmware bug which should be marked with FW_BUG.
> Also add the number of the buggy SMM call to the warning message
> so BIOS developers, etc immediately know which part of the SMM
> interface is buggy.
> 
> Tested on a Dell Inspiron 3505.
> 
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>

Acked-by: Pali Rohár <pali@kernel.org>

Ideally this change should be CCed to Dell BIOS developers :D (hehe)

> ---
>  drivers/hwmon/dell-smm-hwmon.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index 1dab7591576a..f7bab1a91b93 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -26,6 +26,7 @@
>  #include <linux/module.h>
>  #include <linux/mutex.h>
>  #include <linux/platform_device.h>
> +#include <linux/printk.h>
>  #include <linux/proc_fs.h>
>  #include <linux/seq_file.h>
>  #include <linux/slab.h>
> @@ -198,7 +199,7 @@ static int i8k_smm_func(void *par)
>  		 eax, ebx, regs->eax & 0xffff, carry, duration);
> 
>  	if (duration > DELL_SMM_MAX_DURATION)
> -		pr_warn_once("SMM call took %lld usecs!\n", duration);
> +		pr_warn_once(FW_BUG "SMM call 0x%.4x took %lld usecs!\n", eax, duration);
> 
>  	if (carry || (regs->eax & 0xffff) == 0xffff || regs->eax == eax)
>  		return -EINVAL;
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index 1dab7591576a..f7bab1a91b93 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -26,6 +26,7 @@ 
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/platform_device.h>
+#include <linux/printk.h>
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
@@ -198,7 +199,7 @@  static int i8k_smm_func(void *par)
 		 eax, ebx, regs->eax & 0xffff, carry, duration);

 	if (duration > DELL_SMM_MAX_DURATION)
-		pr_warn_once("SMM call took %lld usecs!\n", duration);
+		pr_warn_once(FW_BUG "SMM call 0x%.4x took %lld usecs!\n", eax, duration);

 	if (carry || (regs->eax & 0xffff) == 0xffff || regs->eax == eax)
 		return -EINVAL;