All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hwmon: (sch56xx-common) Add DMI override table
@ 2022-06-04 22:02 Armin Wolf
  2022-06-05 13:49 ` Hans de Goede
  2022-06-05 17:42 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Armin Wolf @ 2022-06-04 22:02 UTC (permalink / raw)
  To: hdegoede; +Cc: jdelvare, linux, linux-hwmon, linux-kernel

Some devices like the Fujitsu Celsius W380 do contain
a working sch56xx hardware monitoring device, but do
not contain the necessary DMI onboard device.

Do not check for the presence of an suitable onboard device
on these machines. The list of affected machines was created
using data collected by the Linux Hardware Project.

Tested on a Fujitsu Esprimo P720, but sadly not on a affected
machine.

Fixes: 393935baa45e (hwmon: (sch56xx-common) Add automatic module loading on supported devices)
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 drivers/hwmon/sch56xx-common.c | 44 ++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 10 deletions(-)

diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c
index 3ece53adabd6..de3a0886c2f7 100644
--- a/drivers/hwmon/sch56xx-common.c
+++ b/drivers/hwmon/sch56xx-common.c
@@ -523,6 +523,28 @@ static int __init sch56xx_device_add(int address, const char *name)
 	return PTR_ERR_OR_ZERO(sch56xx_pdev);
 }

+static const struct dmi_system_id sch56xx_dmi_override_table[] __initconst = {
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS W380"),
+		},
+	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO P710"),
+		},
+	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO E9900"),
+		},
+	},
+	{ }
+};
+
 /* For autoloading only */
 static const struct dmi_system_id sch56xx_dmi_table[] __initconst = {
 	{
@@ -543,16 +565,18 @@ static int __init sch56xx_init(void)
 		if (!dmi_check_system(sch56xx_dmi_table))
 			return -ENODEV;

-		/*
-		 * Some machines like the Esprimo P720 and Esprimo C700 have
-		 * onboard devices named " Antiope"/" Theseus" instead of
-		 * "Antiope"/"Theseus", so we need to check for both.
-		 */
-		if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) &&
-		    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) &&
-		    !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) &&
-		    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL))
-			return -ENODEV;
+		if (!dmi_check_system(sch56xx_dmi_override_table)) {
+			/*
+			 * Some machines like the Esprimo P720 and Esprimo C700 have
+			 * onboard devices named " Antiope"/" Theseus" instead of
+			 * "Antiope"/"Theseus", so we need to check for both.
+			 */
+			if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) &&
+			    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) &&
+			    !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) &&
+			    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL))
+				return -ENODEV;
+		}
 	}

 	/*
--
2.30.2


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

* Re: [PATCH] hwmon: (sch56xx-common) Add DMI override table
  2022-06-04 22:02 [PATCH] hwmon: (sch56xx-common) Add DMI override table Armin Wolf
@ 2022-06-05 13:49 ` Hans de Goede
  2022-06-05 17:42 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2022-06-05 13:49 UTC (permalink / raw)
  To: Armin Wolf; +Cc: jdelvare, linux, linux-hwmon, linux-kernel

Hi,

On 6/5/22 00:02, Armin Wolf wrote:
> Some devices like the Fujitsu Celsius W380 do contain
> a working sch56xx hardware monitoring device, but do
> not contain the necessary DMI onboard device.
> 
> Do not check for the presence of an suitable onboard device
> on these machines. The list of affected machines was created
> using data collected by the Linux Hardware Project.
> 
> Tested on a Fujitsu Esprimo P720, but sadly not on a affected
> machine.
> 
> Fixes: 393935baa45e (hwmon: (sch56xx-common) Add automatic module loading on supported devices)
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/hwmon/sch56xx-common.c | 44 ++++++++++++++++++++++++++--------
>  1 file changed, 34 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c
> index 3ece53adabd6..de3a0886c2f7 100644
> --- a/drivers/hwmon/sch56xx-common.c
> +++ b/drivers/hwmon/sch56xx-common.c
> @@ -523,6 +523,28 @@ static int __init sch56xx_device_add(int address, const char *name)
>  	return PTR_ERR_OR_ZERO(sch56xx_pdev);
>  }
> 
> +static const struct dmi_system_id sch56xx_dmi_override_table[] __initconst = {
> +	{
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS W380"),
> +		},
> +	},
> +	{
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO P710"),
> +		},
> +	},
> +	{
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO E9900"),
> +		},
> +	},
> +	{ }
> +};
> +
>  /* For autoloading only */
>  static const struct dmi_system_id sch56xx_dmi_table[] __initconst = {
>  	{
> @@ -543,16 +565,18 @@ static int __init sch56xx_init(void)
>  		if (!dmi_check_system(sch56xx_dmi_table))
>  			return -ENODEV;
> 
> -		/*
> -		 * Some machines like the Esprimo P720 and Esprimo C700 have
> -		 * onboard devices named " Antiope"/" Theseus" instead of
> -		 * "Antiope"/"Theseus", so we need to check for both.
> -		 */
> -		if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) &&
> -		    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) &&
> -		    !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) &&
> -		    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL))
> -			return -ENODEV;
> +		if (!dmi_check_system(sch56xx_dmi_override_table)) {
> +			/*
> +			 * Some machines like the Esprimo P720 and Esprimo C700 have
> +			 * onboard devices named " Antiope"/" Theseus" instead of
> +			 * "Antiope"/"Theseus", so we need to check for both.
> +			 */
> +			if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) &&
> +			    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) &&
> +			    !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) &&
> +			    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL))
> +				return -ENODEV;
> +		}
>  	}
> 
>  	/*
> --
> 2.30.2
> 


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

* Re: [PATCH] hwmon: (sch56xx-common) Add DMI override table
  2022-06-04 22:02 [PATCH] hwmon: (sch56xx-common) Add DMI override table Armin Wolf
  2022-06-05 13:49 ` Hans de Goede
@ 2022-06-05 17:42 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2022-06-05 17:42 UTC (permalink / raw)
  To: Armin Wolf; +Cc: hdegoede, jdelvare, linux-hwmon, linux-kernel

On Sun, Jun 05, 2022 at 12:02:00AM +0200, Armin Wolf wrote:
> Some devices like the Fujitsu Celsius W380 do contain
> a working sch56xx hardware monitoring device, but do
> not contain the necessary DMI onboard device.
> 
> Do not check for the presence of an suitable onboard device
> on these machines. The list of affected machines was created
> using data collected by the Linux Hardware Project.
> 
> Tested on a Fujitsu Esprimo P720, but sadly not on a affected
> machine.
> 
> Fixes: 393935baa45e (hwmon: (sch56xx-common) Add automatic module loading on supported devices)
> Signed-off-by: Armin Wolf <W_Armin@gmx.de>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Applied to hwmon-next.

Thanks,
Guenter

> ---
>  drivers/hwmon/sch56xx-common.c | 44 ++++++++++++++++++++++++++--------
>  1 file changed, 34 insertions(+), 10 deletions(-)
> 
> --
> 2.30.2
> 
> diff --git a/drivers/hwmon/sch56xx-common.c b/drivers/hwmon/sch56xx-common.c
> index 3ece53adabd6..de3a0886c2f7 100644
> --- a/drivers/hwmon/sch56xx-common.c
> +++ b/drivers/hwmon/sch56xx-common.c
> @@ -523,6 +523,28 @@ static int __init sch56xx_device_add(int address, const char *name)
>  	return PTR_ERR_OR_ZERO(sch56xx_pdev);
>  }
> 
> +static const struct dmi_system_id sch56xx_dmi_override_table[] __initconst = {
> +	{
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS W380"),
> +		},
> +	},
> +	{
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO P710"),
> +		},
> +	},
> +	{
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "ESPRIMO E9900"),
> +		},
> +	},
> +	{ }
> +};
> +
>  /* For autoloading only */
>  static const struct dmi_system_id sch56xx_dmi_table[] __initconst = {
>  	{
> @@ -543,16 +565,18 @@ static int __init sch56xx_init(void)
>  		if (!dmi_check_system(sch56xx_dmi_table))
>  			return -ENODEV;
> 
> -		/*
> -		 * Some machines like the Esprimo P720 and Esprimo C700 have
> -		 * onboard devices named " Antiope"/" Theseus" instead of
> -		 * "Antiope"/"Theseus", so we need to check for both.
> -		 */
> -		if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) &&
> -		    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) &&
> -		    !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) &&
> -		    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL))
> -			return -ENODEV;
> +		if (!dmi_check_system(sch56xx_dmi_override_table)) {
> +			/*
> +			 * Some machines like the Esprimo P720 and Esprimo C700 have
> +			 * onboard devices named " Antiope"/" Theseus" instead of
> +			 * "Antiope"/"Theseus", so we need to check for both.
> +			 */
> +			if (!dmi_find_device(DMI_DEV_TYPE_OTHER, "Antiope", NULL) &&
> +			    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Antiope", NULL) &&
> +			    !dmi_find_device(DMI_DEV_TYPE_OTHER, "Theseus", NULL) &&
> +			    !dmi_find_device(DMI_DEV_TYPE_OTHER, " Theseus", NULL))
> +				return -ENODEV;
> +		}
>  	}
> 
>  	/*

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

end of thread, other threads:[~2022-06-05 17:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-04 22:02 [PATCH] hwmon: (sch56xx-common) Add DMI override table Armin Wolf
2022-06-05 13:49 ` Hans de Goede
2022-06-05 17:42 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.