linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] dell-smm-hwmon fixes
@ 2016-06-17 22:54 Pali Rohár
  2016-06-17 22:54 ` [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number Pali Rohár
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Pali Rohár @ 2016-06-17 22:54 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel, Pali Rohár

I'm sending all my dell-smm-hwmon patches in one series, because due to
changes in code other patches depends on previous.

First two patches fixes problem with old /proc/i8k file. Second is security
fix and should be backported to all stable kernels (that problem was there
always). I tested i8kctl tool (from i8kutils package) that it still works
with these patches. Without root access for those security operations just
showes '?' or '-1'.

Third and fourth patches try to fix problem on machines with broken
SMM/BIOS when calling function fan_type().

Fifth is new feature and last sixth useful for debugging.

Pali Rohár (6):
  hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is
    not a number
  hwmon: (dell-smm) Restrict fan control and serial number to
    CAP_SYS_ADMIN by default
  hwmon: (dell-smm) Disallow fan_type() calls on broken machines
  hwmon: (dell-smm) Cache fan_type() calls and change fan detection
  hwmon: (dell-smm) Detect fan with index=2
  hwmon: (dell-smm) In debug mode log duration of SMM calls

 drivers/hwmon/dell-smm-hwmon.c |  122 ++++++++++++++++++++++++++++++++--------
 1 file changed, 99 insertions(+), 23 deletions(-)

-- 
1.7.9.5

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

* [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
@ 2016-06-17 22:54 ` Pali Rohár
  2016-06-18 20:00   ` Guenter Roeck
  2016-06-17 22:54 ` [PATCH 2/6] hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default Pali Rohár
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-17 22:54 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel, Pali Rohár

ABI of I8K_BIOS_VERSION ioctl can return only number. But new BIOS versions
contain also other characters, which does not fit into that ABI. So in case
of non digit values return -EINVAL.

Reported-by: Mario Limonciello <Mario_Limonciello@dell.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 drivers/hwmon/dell-smm-hwmon.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index c43318d..480b2fa 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -35,6 +35,7 @@
 #include <linux/uaccess.h>
 #include <linux/io.h>
 #include <linux/sched.h>
+#include <linux/ctype.h>
 
 #include <linux/i8k.h>
 
@@ -387,6 +388,10 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
 
 	switch (cmd) {
 	case I8K_BIOS_VERSION:
+		if (!isdigit(bios_version[0]) || !isdigit(bios_version[1]) ||
+		    !isdigit(bios_version[2]))
+			return -EINVAL;
+
 		val = (bios_version[0] << 16) |
 				(bios_version[1] << 8) | bios_version[2];
 		break;
-- 
1.7.9.5

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

* [PATCH 2/6] hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
  2016-06-17 22:54 ` [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number Pali Rohár
@ 2016-06-17 22:54 ` Pali Rohár
  2016-06-18 20:00   ` Guenter Roeck
  2016-06-17 22:54 ` [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines Pali Rohár
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-17 22:54 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel, Pali Rohár

For security reasons ordinary user must not be able to control fan speed
via /proc/i8k by default. Some malicious software running under "nobody"
user could be able to turn fan off and cause HW problems. So this patch
changes default value of "restricted" parameter to 1.

Also restrict reading of DMI_PRODUCT_SERIAL from /proc/i8k via "restricted"
parameter. It is because non root user cannot read DMI_PRODUCT_SERIAL from
sysfs file /sys/class/dmi/id/product_serial.

Old non secure behaviour of file /proc/i8k can be achieved by loading this
module with "restricted" parameter set to 0.

Note that this patch has effects only for kernels compiled with CONFIG_I8K
and only for file /proc/i8k. Hwmon interface provided by this driver was
not changed and root access for setting fan speed was needed also before.

Reported-by: Mario Limonciello <Mario_Limonciello@dell.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Cc: stable@vger.kernel.org # will need backport
---
 drivers/hwmon/dell-smm-hwmon.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index 480b2fa..c8bd3fdd 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -67,6 +67,7 @@
 
 static DEFINE_MUTEX(i8k_mutex);
 static char bios_version[4];
+static char bios_machineid[16];
 static struct device *i8k_hwmon_dev;
 static u32 i8k_hwmon_flags;
 static uint i8k_fan_mult = I8K_FAN_MULT;
@@ -95,13 +96,13 @@ module_param(ignore_dmi, bool, 0);
 MODULE_PARM_DESC(ignore_dmi, "Continue probing hardware even if DMI data does not match");
 
 #if IS_ENABLED(CONFIG_I8K)
-static bool restricted;
+static bool restricted = true;
 module_param(restricted, bool, 0);
-MODULE_PARM_DESC(restricted, "Allow fan control if SYS_ADMIN capability set");
+MODULE_PARM_DESC(restricted, "Restrict fan control and serial number to CAP_SYS_ADMIN (default: 1)");
 
 static bool power_status;
 module_param(power_status, bool, 0600);
-MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
+MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k (default: 0)");
 #endif
 
 static uint fan_mult;
@@ -397,9 +398,11 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
 		break;
 
 	case I8K_MACHINE_ID:
-		memset(buff, 0, 16);
-		strlcpy(buff, i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
-			sizeof(buff));
+		if (restricted && !capable(CAP_SYS_ADMIN))
+			return -EPERM;
+
+		memset(buff, 0, sizeof(buff));
+		strlcpy(buff, bios_machineid, sizeof(buff));
 		break;
 
 	case I8K_FN_STATUS:
@@ -516,7 +519,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
 	seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n",
 		   I8K_PROC_FMT,
 		   bios_version,
-		   i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
+		   (restricted && !capable(CAP_SYS_ADMIN)) ? "-1" : bios_machineid,
 		   cpu_temp,
 		   left_fan, right_fan, left_speed, right_speed,
 		   ac_power, fn_key);
@@ -985,6 +988,8 @@ static int __init i8k_probe(void)
 
 	strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION),
 		sizeof(bios_version));
+	strlcpy(bios_machineid, i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
+		sizeof(bios_machineid));
 
 	/*
 	 * Get SMM Dell signature
-- 
1.7.9.5

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

* [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
  2016-06-17 22:54 ` [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number Pali Rohár
  2016-06-17 22:54 ` [PATCH 2/6] hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default Pali Rohár
@ 2016-06-17 22:54 ` Pali Rohár
  2016-06-18 20:08   ` Guenter Roeck
  2016-06-17 22:54 ` [PATCH 4/6] hwmon: (dell-smm) Cache fan_type() calls and change fan detection Pali Rohár
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-17 22:54 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel, Pali Rohár

Some Dell machines have especially broken SMM or BIOS which cause that once
fan_type() is called then CPU fan speed going randomly up and down. And for
fixing this behaviour reboot is required.

So this patch creates fan_type blacklist of affected Dell machines and
disallow fan_type() call on them to prevent that erratic behaviour.

Old blacklist which disabled loading driver on some machines added in
commits a4b45b25f18d ("hwmon: (dell-smm) Blacklist Dell Studio XPS 8100")
and 6220f4ebd7b4 ("hwmon: (dell-smm) Blacklist Dell Studio XPS 8000") were
moved to FAN_TYPE blacklist.

Reported-by: Jan C Peters <jcpeters89@gmail.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=100121
Cc: stable@vger.kernel.org # v4.0+, will need backport
---
 drivers/hwmon/dell-smm-hwmon.c |   36 +++++++++++++++++++++++++-----------
 1 file changed, 25 insertions(+), 11 deletions(-)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index c8bd3fdd..4bbc587 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -73,6 +73,7 @@ static u32 i8k_hwmon_flags;
 static uint i8k_fan_mult = I8K_FAN_MULT;
 static uint i8k_pwm_mult;
 static uint i8k_fan_max = I8K_FAN_HIGH;
+static bool disallow_fan_type_call;
 
 #define I8K_HWMON_HAVE_TEMP1	(1 << 0)
 #define I8K_HWMON_HAVE_TEMP2	(1 << 1)
@@ -241,6 +242,9 @@ static int i8k_get_fan_type(int fan)
 {
 	struct smm_regs regs = { .eax = I8K_SMM_GET_FAN_TYPE, };
 
+	if (disallow_fan_type_call)
+		return -EINVAL;
+
 	regs.ebx = fan & 0xff;
 	return i8k_smm(&regs) ? : regs.eax & 0xff;
 }
@@ -726,6 +730,9 @@ static struct attribute *i8k_attrs[] = {
 static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
 			      int index)
 {
+	if (disallow_fan_type_call &&
+	    (index == 9 || index == 12))
+		return 0;
 	if (index >= 0 && index <= 1 &&
 	    !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
 		return 0;
@@ -937,12 +944,14 @@ static struct dmi_system_id i8k_dmi_table[] __initdata = {
 
 MODULE_DEVICE_TABLE(dmi, i8k_dmi_table);
 
-static struct dmi_system_id i8k_blacklist_dmi_table[] __initdata = {
+/*
+ * On some machines once I8K_SMM_GET_FAN_TYPE is issued then CPU fan speed
+ * randomly going up and down due to bug in Dell SMM or BIOS. Here is blacklist
+ * of affected Dell machines for which we disallow I8K_SMM_GET_FAN_TYPE call.
+ * See bug: https://bugzilla.kernel.org/show_bug.cgi?id=100121
+ */
+static struct dmi_system_id i8k_blacklist_fan_type_dmi_table[] __initdata = {
 	{
-		/*
-		 * CPU fan speed going up and down on Dell Studio XPS 8000
-		 * for unknown reasons.
-		 */
 		.ident = "Dell Studio XPS 8000",
 		.matches = {
 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
@@ -950,16 +959,19 @@ static struct dmi_system_id i8k_blacklist_dmi_table[] __initdata = {
 		},
 	},
 	{
-		/*
-		 * CPU fan speed going up and down on Dell Studio XPS 8100
-		 * for unknown reasons.
-		 */
 		.ident = "Dell Studio XPS 8100",
 		.matches = {
 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Studio XPS 8100"),
 		},
 	},
+	{
+		.ident = "Dell Inspiron 580",
+		.matches = {
+			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Inspiron 580 "),
+		},
+	},
 	{ }
 };
 
@@ -974,8 +986,7 @@ static int __init i8k_probe(void)
 	/*
 	 * Get DMI information
 	 */
-	if (!dmi_check_system(i8k_dmi_table) ||
-	    dmi_check_system(i8k_blacklist_dmi_table)) {
+	if (!dmi_check_system(i8k_dmi_table)) {
 		if (!ignore_dmi && !force)
 			return -ENODEV;
 
@@ -986,6 +997,9 @@ static int __init i8k_probe(void)
 			i8k_get_dmi_data(DMI_BIOS_VERSION));
 	}
 
+	if (dmi_check_system(i8k_blacklist_fan_type_dmi_table))
+		disallow_fan_type_call = true;
+
 	strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION),
 		sizeof(bios_version));
 	strlcpy(bios_machineid, i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
-- 
1.7.9.5

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

* [PATCH 4/6] hwmon: (dell-smm) Cache fan_type() calls and change fan detection
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
                   ` (2 preceding siblings ...)
  2016-06-17 22:54 ` [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines Pali Rohár
@ 2016-06-17 22:54 ` Pali Rohár
  2016-06-19  0:01   ` Tolga Cakir
  2016-06-17 22:54 ` [PATCH 5/6] hwmon: (dell-smm) Detect fan with index=2 Pali Rohár
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-17 22:54 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel, Pali Rohár

On more Dell machines (e.g. Dell Precision M3800) fan_type() call is too
expensive (CPU is too long in SMM mode) and cause kernel to hang. This is
bug in Dell SMM or BIOS.

This patch caches type for each fan (as it should not change) and changes
the way how fan presense is detected. First it try function fan_status()
as was before commit f989e55452c7 ("i8k: Add support for fan labels"). And
if that fails fallback to fan_type(). *_status() functions can fail in case
fan is not currently accessible (e.g. present on GPU which is currently
turned off).

Reported-by: Tolga Cakir <cevelnet@gmail.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=112021
Cc: stable@vger.kernel.org # v4.0+, will need backport
---
 drivers/hwmon/dell-smm-hwmon.c |   25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index 4bbc587..2ac87d5 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -238,7 +238,7 @@ static int i8k_get_fan_speed(int fan)
 /*
  * Read the fan type.
  */
-static int i8k_get_fan_type(int fan)
+static int _i8k_get_fan_type(int fan)
 {
 	struct smm_regs regs = { .eax = I8K_SMM_GET_FAN_TYPE, };
 
@@ -249,6 +249,17 @@ static int i8k_get_fan_type(int fan)
 	return i8k_smm(&regs) ? : regs.eax & 0xff;
 }
 
+static int i8k_get_fan_type(int fan)
+{
+	/* I8K_SMM_GET_FAN_TYPE SMM call is expensive, so cache values */
+	static int types[2] = { INT_MIN, INT_MIN };
+
+	if (types[fan] == INT_MIN)
+		types[fan] = _i8k_get_fan_type(fan);
+
+	return types[fan];
+}
+
 /*
  * Read the fan nominal rpm for specific fan speed.
  */
@@ -782,13 +793,17 @@ static int __init i8k_init_hwmon(void)
 	if (err >= 0)
 		i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP4;
 
-	/* First fan attributes, if fan type is OK */
-	err = i8k_get_fan_type(0);
+	/* First fan attributes, if fan status or type is OK */
+	err = i8k_get_fan_status(0);
+	if (err < 0)
+		err = i8k_get_fan_type(0);
 	if (err >= 0)
 		i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN1;
 
-	/* Second fan attributes, if fan type is OK */
-	err = i8k_get_fan_type(1);
+	/* Second fan attributes, if fan status or type is OK */
+	err = i8k_get_fan_status(1);
+	if (err < 0)
+		err = i8k_get_fan_type(1);
 	if (err >= 0)
 		i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN2;
 
-- 
1.7.9.5

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

* [PATCH 5/6] hwmon: (dell-smm) Detect fan with index=2
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
                   ` (3 preceding siblings ...)
  2016-06-17 22:54 ` [PATCH 4/6] hwmon: (dell-smm) Cache fan_type() calls and change fan detection Pali Rohár
@ 2016-06-17 22:54 ` Pali Rohár
  2016-06-19  0:02   ` Tolga Cakir
  2016-06-17 22:54 ` [PATCH 6/6] hwmon: (dell-smm) In debug mode log duration of SMM calls Pali Rohár
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-17 22:54 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel, Pali Rohár

Some Dell machines (e.g. Dell Precision M3800) have two fans, first with
index=0 and second with index=2. So export also attributes for third fan
device with index=2.

Reported-by: Tolga Cakir <cevelnet@gmail.com>
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 drivers/hwmon/dell-smm-hwmon.c |   24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index 2ac87d5..571d498 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -81,6 +81,7 @@ static bool disallow_fan_type_call;
 #define I8K_HWMON_HAVE_TEMP4	(1 << 3)
 #define I8K_HWMON_HAVE_FAN1	(1 << 4)
 #define I8K_HWMON_HAVE_FAN2	(1 << 5)
+#define I8K_HWMON_HAVE_FAN3	(1 << 6)
 
 MODULE_AUTHOR("Massimo Dal Zotto (dz@debian.org)");
 MODULE_AUTHOR("Pali Rohár <pali.rohar@gmail.com>");
@@ -252,7 +253,7 @@ static int _i8k_get_fan_type(int fan)
 static int i8k_get_fan_type(int fan)
 {
 	/* I8K_SMM_GET_FAN_TYPE SMM call is expensive, so cache values */
-	static int types[2] = { INT_MIN, INT_MIN };
+	static int types[3] = { INT_MIN, INT_MIN, INT_MIN };
 
 	if (types[fan] == INT_MIN)
 		types[fan] = _i8k_get_fan_type(fan);
@@ -719,6 +720,12 @@ static SENSOR_DEVICE_ATTR(fan2_label, S_IRUGO, i8k_hwmon_show_fan_label, NULL,
 			  1);
 static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, i8k_hwmon_show_pwm,
 			  i8k_hwmon_set_pwm, 1);
+static SENSOR_DEVICE_ATTR(fan3_input, S_IRUGO, i8k_hwmon_show_fan, NULL,
+			  2);
+static SENSOR_DEVICE_ATTR(fan3_label, S_IRUGO, i8k_hwmon_show_fan_label, NULL,
+			  2);
+static SENSOR_DEVICE_ATTR(pwm3, S_IRUGO | S_IWUSR, i8k_hwmon_show_pwm,
+			  i8k_hwmon_set_pwm, 2);
 
 static struct attribute *i8k_attrs[] = {
 	&sensor_dev_attr_temp1_input.dev_attr.attr,	/* 0 */
@@ -735,6 +742,9 @@ static struct attribute *i8k_attrs[] = {
 	&sensor_dev_attr_fan2_input.dev_attr.attr,	/* 11 */
 	&sensor_dev_attr_fan2_label.dev_attr.attr,	/* 12 */
 	&sensor_dev_attr_pwm2.dev_attr.attr,		/* 13 */
+	&sensor_dev_attr_fan3_input.dev_attr.attr,	/* 14 */
+	&sensor_dev_attr_fan3_label.dev_attr.attr,	/* 15 */
+	&sensor_dev_attr_pwm3.dev_attr.attr,		/* 16 */
 	NULL
 };
 
@@ -742,7 +752,7 @@ static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
 			      int index)
 {
 	if (disallow_fan_type_call &&
-	    (index == 9 || index == 12))
+	    (index == 9 || index == 12 || index == 15))
 		return 0;
 	if (index >= 0 && index <= 1 &&
 	    !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
@@ -762,6 +772,9 @@ static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
 	if (index >= 11 && index <= 13 &&
 	    !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN2))
 		return 0;
+	if (index >= 14 && index <= 16 &&
+	    !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN3))
+		return 0;
 
 	return attr->mode;
 }
@@ -807,6 +820,13 @@ static int __init i8k_init_hwmon(void)
 	if (err >= 0)
 		i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN2;
 
+	/* Third fan attributes, if fan status or type is OK */
+	err = i8k_get_fan_status(2);
+	if (err < 0)
+		err = i8k_get_fan_type(2);
+	if (err >= 0)
+		i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN3;
+
 	i8k_hwmon_dev = hwmon_device_register_with_groups(NULL, "dell_smm",
 							  NULL, i8k_groups);
 	if (IS_ERR(i8k_hwmon_dev)) {
-- 
1.7.9.5

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

* [PATCH 6/6] hwmon: (dell-smm) In debug mode log duration of SMM calls
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
                   ` (4 preceding siblings ...)
  2016-06-17 22:54 ` [PATCH 5/6] hwmon: (dell-smm) Detect fan with index=2 Pali Rohár
@ 2016-06-17 22:54 ` Pali Rohár
  2016-06-18 12:21 ` [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 24+ messages in thread
From: Pali Rohár @ 2016-06-17 22:54 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel, Pali Rohár

This allow us to debug how long take each SMM call and how long is system
frozen in SMM handler.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 drivers/hwmon/dell-smm-hwmon.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
index 571d498..acf9c03 100644
--- a/drivers/hwmon/dell-smm-hwmon.c
+++ b/drivers/hwmon/dell-smm-hwmon.c
@@ -140,6 +140,14 @@ static int i8k_smm(struct smm_regs *regs)
 	int eax = regs->eax;
 	cpumask_var_t old_mask;
 
+#ifdef DEBUG
+	int ebx = regs->ebx;
+	unsigned long duration;
+	ktime_t calltime, delta, rettime;
+
+	calltime = ktime_get();
+#endif
+
 	/* SMM requires CPU 0 */
 	if (!alloc_cpumask_var(&old_mask, GFP_KERNEL))
 		return -ENOMEM;
@@ -211,6 +219,15 @@ static int i8k_smm(struct smm_regs *regs)
 out:
 	set_cpus_allowed_ptr(current, old_mask);
 	free_cpumask_var(old_mask);
+
+#ifdef DEBUG
+	rettime = ktime_get();
+	delta = ktime_sub(rettime, calltime);
+	duration = ktime_to_ns(delta) >> 10;
+	pr_debug("smm(0x%.4x 0x%.4x) = 0x%.4x  (took %7lu usecs)\n", eax, ebx,
+		(rc ? 0xffff : regs->eax & 0xffff), duration);
+#endif
+
 	return rc;
 }
 
-- 
1.7.9.5

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
                   ` (5 preceding siblings ...)
  2016-06-17 22:54 ` [PATCH 6/6] hwmon: (dell-smm) In debug mode log duration of SMM calls Pali Rohár
@ 2016-06-18 12:21 ` Pali Rohár
  2016-06-18 15:13 ` Guenter Roeck
  2016-06-22  8:02 ` Michał Kępień
  8 siblings, 0 replies; 24+ messages in thread
From: Pali Rohár @ 2016-06-18 12:21 UTC (permalink / raw)
  To: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel

On Saturday 18 June 2016 00:54:43 Pali Rohár wrote:
> I'm sending all my dell-smm-hwmon patches in one series, because due to
> changes in code other patches depends on previous.
> 
> First two patches fixes problem with old /proc/i8k file. Second is security
> fix and should be backported to all stable kernels (that problem was there
> always). I tested i8kctl tool (from i8kutils package) that it still works
> with these patches. Without root access for those security operations just
> showes '?' or '-1'.
> 
> Third and fourth patches try to fix problem on machines with broken
> SMM/BIOS when calling function fan_type().
> 
> Fifth is new feature and last sixth useful for debugging.
> 
> Pali Rohár (6):
>   hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is
>     not a number
>   hwmon: (dell-smm) Restrict fan control and serial number to
>     CAP_SYS_ADMIN by default
>   hwmon: (dell-smm) Disallow fan_type() calls on broken machines
>   hwmon: (dell-smm) Cache fan_type() calls and change fan detection
>   hwmon: (dell-smm) Detect fan with index=2
>   hwmon: (dell-smm) In debug mode log duration of SMM calls
> 
>  drivers/hwmon/dell-smm-hwmon.c |  122 ++++++++++++++++++++++++++++++++--------
>  1 file changed, 99 insertions(+), 23 deletions(-)
> 

Hi, can you test this patch series on affected Dell Studio XPS and
Inspiron 580 machines? Also on affected Precision machines?

I believe it finally fix those freeze and cpu fan speed problems, but
needs testing...

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
                   ` (6 preceding siblings ...)
  2016-06-18 12:21 ` [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
@ 2016-06-18 15:13 ` Guenter Roeck
  2016-06-18 15:26   ` Pali Rohár
  2016-06-22  8:02 ` Michał Kępień
  8 siblings, 1 reply; 24+ messages in thread
From: Guenter Roeck @ 2016-06-18 15:13 UTC (permalink / raw)
  To: Pali Rohár, Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel

On 06/17/2016 03:54 PM, Pali Rohár wrote:
> I'm sending all my dell-smm-hwmon patches in one series, because due to
> changes in code other patches depends on previous.
>
> First two patches fixes problem with old /proc/i8k file. Second is security
> fix and should be backported to all stable kernels (that problem was there
> always). I tested i8kctl tool (from i8kutils package) that it still works
> with these patches. Without root access for those security operations just
> showes '?' or '-1'.
>
> Third and fourth patches try to fix problem on machines with broken
> SMM/BIOS when calling function fan_type().
>
> Fifth is new feature and last sixth useful for debugging.
>
> Pali Rohár (6):
>    hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is
>      not a number
>    hwmon: (dell-smm) Restrict fan control and serial number to
>      CAP_SYS_ADMIN by default
>    hwmon: (dell-smm) Disallow fan_type() calls on broken machines
>    hwmon: (dell-smm) Cache fan_type() calls and change fan detection
>    hwmon: (dell-smm) Detect fan with index=2
>    hwmon: (dell-smm) In debug mode log duration of SMM calls
>
>   drivers/hwmon/dell-smm-hwmon.c |  122 ++++++++++++++++++++++++++++++++--------
>   1 file changed, 99 insertions(+), 23 deletions(-)
>

Pali,

You asked for additional testing, so I am not sure what you expect me to do.

Which of the patches can/should I apply now ?

Guenter

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-18 15:13 ` Guenter Roeck
@ 2016-06-18 15:26   ` Pali Rohár
  2016-06-18 16:54     ` Guenter Roeck
  0 siblings, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-18 15:26 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 1998 bytes --]

On Saturday 18 June 2016 17:13:59 Guenter Roeck wrote:
> On 06/17/2016 03:54 PM, Pali Rohár wrote:
> > I'm sending all my dell-smm-hwmon patches in one series, because
> > due to changes in code other patches depends on previous.
> > 
> > First two patches fixes problem with old /proc/i8k file. Second is
> > security fix and should be backported to all stable kernels (that
> > problem was there always). I tested i8kctl tool (from i8kutils
> > package) that it still works with these patches. Without root
> > access for those security operations just showes '?' or '-1'.
> > 
> > Third and fourth patches try to fix problem on machines with broken
> > SMM/BIOS when calling function fan_type().
> > 
> > Fifth is new feature and last sixth useful for debugging.
> > 
> > Pali Rohár (6):
> >    hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios
> >    version is
> >    
> >      not a number
> >    
> >    hwmon: (dell-smm) Restrict fan control and serial number to
> >    
> >      CAP_SYS_ADMIN by default
> >    
> >    hwmon: (dell-smm) Disallow fan_type() calls on broken machines
> >    hwmon: (dell-smm) Cache fan_type() calls and change fan
> >    detection hwmon: (dell-smm) Detect fan with index=2
> >    hwmon: (dell-smm) In debug mode log duration of SMM calls
> >   
> >   drivers/hwmon/dell-smm-hwmon.c |  122
> >   ++++++++++++++++++++++++++++++++-------- 1 file changed, 99
> >   insertions(+), 23 deletions(-)
> 
> Pali,
> 
> You asked for additional testing, so I am not sure what you expect me
> to do.
> 
> Which of the patches can/should I apply now ?
> 
> Guenter

Test 3/6 and 4/6 patches on affected Dell machines. I CCed all people 
who tried to debug those bugs, so need confirmation from them that after 
applying 3/6 and 4/6 patches, erratic fan behaviour is not there...

But because those two patches depends on previous, it is needed to test 
whole series...

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-18 15:26   ` Pali Rohár
@ 2016-06-18 16:54     ` Guenter Roeck
  2016-06-18 22:39       ` Pali Rohár
       [not found]       ` <CA+vQ2zCoGhLT2PUUhcuggJ3oE9Z6vfUW=Z1wgm8Ozz3XdnQoxA@mail.gmail.com>
  0 siblings, 2 replies; 24+ messages in thread
From: Guenter Roeck @ 2016-06-18 16:54 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

On 06/18/2016 08:26 AM, Pali Rohár wrote:
> On Saturday 18 June 2016 17:13:59 Guenter Roeck wrote:
>> On 06/17/2016 03:54 PM, Pali Rohár wrote:
>>> I'm sending all my dell-smm-hwmon patches in one series, because
>>> due to changes in code other patches depends on previous.
>>>
>>> First two patches fixes problem with old /proc/i8k file. Second is
>>> security fix and should be backported to all stable kernels (that
>>> problem was there always). I tested i8kctl tool (from i8kutils
>>> package) that it still works with these patches. Without root
>>> access for those security operations just showes '?' or '-1'.
>>>
>>> Third and fourth patches try to fix problem on machines with broken
>>> SMM/BIOS when calling function fan_type().
>>>
>>> Fifth is new feature and last sixth useful for debugging.
>>>
>>> Pali Rohár (6):
>>>     hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios
>>>     version is
>>>
>>>       not a number
>>>
>>>     hwmon: (dell-smm) Restrict fan control and serial number to
>>>
>>>       CAP_SYS_ADMIN by default
>>>
>>>     hwmon: (dell-smm) Disallow fan_type() calls on broken machines
>>>     hwmon: (dell-smm) Cache fan_type() calls and change fan
>>>     detection hwmon: (dell-smm) Detect fan with index=2
>>>     hwmon: (dell-smm) In debug mode log duration of SMM calls
>>>
>>>    drivers/hwmon/dell-smm-hwmon.c |  122
>>>    ++++++++++++++++++++++++++++++++-------- 1 file changed, 99
>>>    insertions(+), 23 deletions(-)
>>
>> Pali,
>>
>> You asked for additional testing, so I am not sure what you expect me
>> to do.
>>
>> Which of the patches can/should I apply now ?
>>
>> Guenter
>
> Test 3/6 and 4/6 patches on affected Dell machines. I CCed all people
> who tried to debug those bugs, so need confirmation from them that after
> applying 3/6 and 4/6 patches, erratic fan behaviour is not there...
>
> But because those two patches depends on previous, it is needed to test
> whole series...
>
This doesn't tell me which patches to apply now. The first two ?

Guenter

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

* Re: [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number
  2016-06-17 22:54 ` [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number Pali Rohár
@ 2016-06-18 20:00   ` Guenter Roeck
  0 siblings, 0 replies; 24+ messages in thread
From: Guenter Roeck @ 2016-06-18 20:00 UTC (permalink / raw)
  To: Pali Rohár, Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel

On 06/17/2016 03:54 PM, Pali Rohár wrote:
> ABI of I8K_BIOS_VERSION ioctl can return only number. But new BIOS versions
> contain also other characters, which does not fit into that ABI. So in case
> of non digit values return -EINVAL.
>
> Reported-by: Mario Limonciello <Mario_Limonciello@dell.com>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>

Applied.

Guenter

> ---
>   drivers/hwmon/dell-smm-hwmon.c |    5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index c43318d..480b2fa 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -35,6 +35,7 @@
>   #include <linux/uaccess.h>
>   #include <linux/io.h>
>   #include <linux/sched.h>
> +#include <linux/ctype.h>
>
>   #include <linux/i8k.h>
>
> @@ -387,6 +388,10 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
>
>   	switch (cmd) {
>   	case I8K_BIOS_VERSION:
> +		if (!isdigit(bios_version[0]) || !isdigit(bios_version[1]) ||
> +		    !isdigit(bios_version[2]))
> +			return -EINVAL;
> +
>   		val = (bios_version[0] << 16) |
>   				(bios_version[1] << 8) | bios_version[2];
>   		break;
>

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

* Re: [PATCH 2/6] hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default
  2016-06-17 22:54 ` [PATCH 2/6] hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default Pali Rohár
@ 2016-06-18 20:00   ` Guenter Roeck
  0 siblings, 0 replies; 24+ messages in thread
From: Guenter Roeck @ 2016-06-18 20:00 UTC (permalink / raw)
  To: Pali Rohár, Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel

On 06/17/2016 03:54 PM, Pali Rohár wrote:
> For security reasons ordinary user must not be able to control fan speed
> via /proc/i8k by default. Some malicious software running under "nobody"
> user could be able to turn fan off and cause HW problems. So this patch
> changes default value of "restricted" parameter to 1.
>
> Also restrict reading of DMI_PRODUCT_SERIAL from /proc/i8k via "restricted"
> parameter. It is because non root user cannot read DMI_PRODUCT_SERIAL from
> sysfs file /sys/class/dmi/id/product_serial.
>
> Old non secure behaviour of file /proc/i8k can be achieved by loading this
> module with "restricted" parameter set to 0.
>
> Note that this patch has effects only for kernels compiled with CONFIG_I8K
> and only for file /proc/i8k. Hwmon interface provided by this driver was
> not changed and root access for setting fan speed was needed also before.
>
> Reported-by: Mario Limonciello <Mario_Limonciello@dell.com>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> Cc: stable@vger.kernel.org # will need backport

Applied.

Guenter

> ---
>   drivers/hwmon/dell-smm-hwmon.c |   19 ++++++++++++-------
>   1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index 480b2fa..c8bd3fdd 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -67,6 +67,7 @@
>
>   static DEFINE_MUTEX(i8k_mutex);
>   static char bios_version[4];
> +static char bios_machineid[16];
>   static struct device *i8k_hwmon_dev;
>   static u32 i8k_hwmon_flags;
>   static uint i8k_fan_mult = I8K_FAN_MULT;
> @@ -95,13 +96,13 @@ module_param(ignore_dmi, bool, 0);
>   MODULE_PARM_DESC(ignore_dmi, "Continue probing hardware even if DMI data does not match");
>
>   #if IS_ENABLED(CONFIG_I8K)
> -static bool restricted;
> +static bool restricted = true;
>   module_param(restricted, bool, 0);
> -MODULE_PARM_DESC(restricted, "Allow fan control if SYS_ADMIN capability set");
> +MODULE_PARM_DESC(restricted, "Restrict fan control and serial number to CAP_SYS_ADMIN (default: 1)");
>
>   static bool power_status;
>   module_param(power_status, bool, 0600);
> -MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k");
> +MODULE_PARM_DESC(power_status, "Report power status in /proc/i8k (default: 0)");
>   #endif
>
>   static uint fan_mult;
> @@ -397,9 +398,11 @@ i8k_ioctl_unlocked(struct file *fp, unsigned int cmd, unsigned long arg)
>   		break;
>
>   	case I8K_MACHINE_ID:
> -		memset(buff, 0, 16);
> -		strlcpy(buff, i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
> -			sizeof(buff));
> +		if (restricted && !capable(CAP_SYS_ADMIN))
> +			return -EPERM;
> +
> +		memset(buff, 0, sizeof(buff));
> +		strlcpy(buff, bios_machineid, sizeof(buff));
>   		break;
>
>   	case I8K_FN_STATUS:
> @@ -516,7 +519,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)
>   	seq_printf(seq, "%s %s %s %d %d %d %d %d %d %d\n",
>   		   I8K_PROC_FMT,
>   		   bios_version,
> -		   i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
> +		   (restricted && !capable(CAP_SYS_ADMIN)) ? "-1" : bios_machineid,
>   		   cpu_temp,
>   		   left_fan, right_fan, left_speed, right_speed,
>   		   ac_power, fn_key);
> @@ -985,6 +988,8 @@ static int __init i8k_probe(void)
>
>   	strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION),
>   		sizeof(bios_version));
> +	strlcpy(bios_machineid, i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
> +		sizeof(bios_machineid));
>
>   	/*
>   	 * Get SMM Dell signature
>

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

* Re: [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines
  2016-06-17 22:54 ` [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines Pali Rohár
@ 2016-06-18 20:08   ` Guenter Roeck
  2016-06-18 22:46     ` Pali Rohár
  0 siblings, 1 reply; 24+ messages in thread
From: Guenter Roeck @ 2016-06-18 20:08 UTC (permalink / raw)
  To: Pali Rohár, Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu
  Cc: linux-hwmon, linux-kernel

On 06/17/2016 03:54 PM, Pali Rohár wrote:
> Some Dell machines have especially broken SMM or BIOS which cause that once
> fan_type() is called then CPU fan speed going randomly up and down. And for
> fixing this behaviour reboot is required.
>
> So this patch creates fan_type blacklist of affected Dell machines and
> disallow fan_type() call on them to prevent that erratic behaviour.
>
> Old blacklist which disabled loading driver on some machines added in
> commits a4b45b25f18d ("hwmon: (dell-smm) Blacklist Dell Studio XPS 8100")
> and 6220f4ebd7b4 ("hwmon: (dell-smm) Blacklist Dell Studio XPS 8000") were
> moved to FAN_TYPE blacklist.
>
> Reported-by: Jan C Peters <jcpeters89@gmail.com>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=100121
> Cc: stable@vger.kernel.org # v4.0+, will need backport

Applied.

It seemed worthwhile to apply this patch now, without waiting for further test
feedback, since it at least reduces the impact of the observed problems.
If follow-up changes are necessary, those will have to be applied in separate
patches.

Guenter

> ---
>   drivers/hwmon/dell-smm-hwmon.c |   36 +++++++++++++++++++++++++-----------
>   1 file changed, 25 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index c8bd3fdd..4bbc587 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -73,6 +73,7 @@ static u32 i8k_hwmon_flags;
>   static uint i8k_fan_mult = I8K_FAN_MULT;
>   static uint i8k_pwm_mult;
>   static uint i8k_fan_max = I8K_FAN_HIGH;
> +static bool disallow_fan_type_call;
>
>   #define I8K_HWMON_HAVE_TEMP1	(1 << 0)
>   #define I8K_HWMON_HAVE_TEMP2	(1 << 1)
> @@ -241,6 +242,9 @@ static int i8k_get_fan_type(int fan)
>   {
>   	struct smm_regs regs = { .eax = I8K_SMM_GET_FAN_TYPE, };
>
> +	if (disallow_fan_type_call)
> +		return -EINVAL;
> +
>   	regs.ebx = fan & 0xff;
>   	return i8k_smm(&regs) ? : regs.eax & 0xff;
>   }
> @@ -726,6 +730,9 @@ static struct attribute *i8k_attrs[] = {
>   static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
>   			      int index)
>   {
> +	if (disallow_fan_type_call &&
> +	    (index == 9 || index == 12))
> +		return 0;
>   	if (index >= 0 && index <= 1 &&
>   	    !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
>   		return 0;
> @@ -937,12 +944,14 @@ static struct dmi_system_id i8k_dmi_table[] __initdata = {
>
>   MODULE_DEVICE_TABLE(dmi, i8k_dmi_table);
>
> -static struct dmi_system_id i8k_blacklist_dmi_table[] __initdata = {
> +/*
> + * On some machines once I8K_SMM_GET_FAN_TYPE is issued then CPU fan speed
> + * randomly going up and down due to bug in Dell SMM or BIOS. Here is blacklist
> + * of affected Dell machines for which we disallow I8K_SMM_GET_FAN_TYPE call.
> + * See bug: https://bugzilla.kernel.org/show_bug.cgi?id=100121
> + */
> +static struct dmi_system_id i8k_blacklist_fan_type_dmi_table[] __initdata = {
>   	{
> -		/*
> -		 * CPU fan speed going up and down on Dell Studio XPS 8000
> -		 * for unknown reasons.
> -		 */
>   		.ident = "Dell Studio XPS 8000",
>   		.matches = {
>   			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> @@ -950,16 +959,19 @@ static struct dmi_system_id i8k_blacklist_dmi_table[] __initdata = {
>   		},
>   	},
>   	{
> -		/*
> -		 * CPU fan speed going up and down on Dell Studio XPS 8100
> -		 * for unknown reasons.
> -		 */
>   		.ident = "Dell Studio XPS 8100",
>   		.matches = {
>   			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
>   			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Studio XPS 8100"),
>   		},
>   	},
> +	{
> +		.ident = "Dell Inspiron 580",
> +		.matches = {
> +			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> +			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Inspiron 580 "),
> +		},
> +	},
>   	{ }
>   };
>
> @@ -974,8 +986,7 @@ static int __init i8k_probe(void)
>   	/*
>   	 * Get DMI information
>   	 */
> -	if (!dmi_check_system(i8k_dmi_table) ||
> -	    dmi_check_system(i8k_blacklist_dmi_table)) {
> +	if (!dmi_check_system(i8k_dmi_table)) {
>   		if (!ignore_dmi && !force)
>   			return -ENODEV;
>
> @@ -986,6 +997,9 @@ static int __init i8k_probe(void)
>   			i8k_get_dmi_data(DMI_BIOS_VERSION));
>   	}
>
> +	if (dmi_check_system(i8k_blacklist_fan_type_dmi_table))
> +		disallow_fan_type_call = true;
> +
>   	strlcpy(bios_version, i8k_get_dmi_data(DMI_BIOS_VERSION),
>   		sizeof(bios_version));
>   	strlcpy(bios_machineid, i8k_get_dmi_data(DMI_PRODUCT_SERIAL),
>

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-18 16:54     ` Guenter Roeck
@ 2016-06-18 22:39       ` Pali Rohár
  2016-06-20  9:12         ` Pali Rohár
       [not found]       ` <CA+vQ2zCoGhLT2PUUhcuggJ3oE9Z6vfUW=Z1wgm8Ozz3XdnQoxA@mail.gmail.com>
  1 sibling, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-18 22:39 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 2352 bytes --]

On Saturday 18 June 2016 18:54:58 Guenter Roeck wrote:
> On 06/18/2016 08:26 AM, Pali Rohár wrote:
> > On Saturday 18 June 2016 17:13:59 Guenter Roeck wrote:
> >> On 06/17/2016 03:54 PM, Pali Rohár wrote:
> >>> I'm sending all my dell-smm-hwmon patches in one series, because
> >>> due to changes in code other patches depends on previous.
> >>> 
> >>> First two patches fixes problem with old /proc/i8k file. Second
> >>> is security fix and should be backported to all stable kernels
> >>> (that problem was there always). I tested i8kctl tool (from
> >>> i8kutils package) that it still works with these patches.
> >>> Without root access for those security operations just showes
> >>> '?' or '-1'.
> >>> 
> >>> Third and fourth patches try to fix problem on machines with
> >>> broken SMM/BIOS when calling function fan_type().
> >>> 
> >>> Fifth is new feature and last sixth useful for debugging.
> >>> 
> >>> Pali Rohár (6):
> >>>     hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios
> >>>     version is
> >>>     
> >>>       not a number
> >>>     
> >>>     hwmon: (dell-smm) Restrict fan control and serial number to
> >>>     
> >>>       CAP_SYS_ADMIN by default
> >>>     
> >>>     hwmon: (dell-smm) Disallow fan_type() calls on broken
> >>>     machines hwmon: (dell-smm) Cache fan_type() calls and change
> >>>     fan detection hwmon: (dell-smm) Detect fan with index=2
> >>>     hwmon: (dell-smm) In debug mode log duration of SMM calls
> >>>    
> >>>    drivers/hwmon/dell-smm-hwmon.c |  122
> >>>    ++++++++++++++++++++++++++++++++-------- 1 file changed, 99
> >>>    insertions(+), 23 deletions(-)
> >> 
> >> Pali,
> >> 
> >> You asked for additional testing, so I am not sure what you expect
> >> me to do.
> >> 
> >> Which of the patches can/should I apply now ?
> >> 
> >> Guenter
> > 
> > Test 3/6 and 4/6 patches on affected Dell machines. I CCed all
> > people who tried to debug those bugs, so need confirmation from
> > them that after applying 3/6 and 4/6 patches, erratic fan
> > behaviour is not there...
> > 
> > But because those two patches depends on previous, it is needed to
> > test whole series...
> 
> This doesn't tell me which patches to apply now. The first two ?

Yes, 1/6 and 2/6 are OK.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
       [not found]       ` <CA+vQ2zCoGhLT2PUUhcuggJ3oE9Z6vfUW=Z1wgm8Ozz3XdnQoxA@mail.gmail.com>
@ 2016-06-18 22:44         ` Pali Rohár
  0 siblings, 0 replies; 24+ messages in thread
From: Pali Rohár @ 2016-06-18 22:44 UTC (permalink / raw)
  To: Leon Yu
  Cc: Guenter Roeck, Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, linux-hwmon, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 2765 bytes --]

Thanks for testing! It took too long, but bugs in vendor SMM code are 
hard to detect and probably impossible to fix. So I would call this 
patch just as "workaround" and not proper bug fix...

On Saturday 18 June 2016 23:58:19 Leon Yu wrote:
> Just installed on "Inspiron 580", appears to have fixed the problem.
> 
> On Sat, Jun 18, 2016 at 12:54 PM, Guenter Roeck <linux@roeck-us.net>
> wrote:
> > On 06/18/2016 08:26 AM, Pali Rohár wrote:
> >> On Saturday 18 June 2016 17:13:59 Guenter Roeck wrote:
> >>> On 06/17/2016 03:54 PM, Pali Rohár wrote:
> >>>> I'm sending all my dell-smm-hwmon patches in one series, because
> >>>> due to changes in code other patches depends on previous.
> >>>> 
> >>>> First two patches fixes problem with old /proc/i8k file. Second
> >>>> is security fix and should be backported to all stable kernels
> >>>> (that problem was there always). I tested i8kctl tool (from
> >>>> i8kutils package) that it still works with these patches.
> >>>> Without root access for those security operations just showes
> >>>> '?' or '-1'.
> >>>> 
> >>>> Third and fourth patches try to fix problem on machines with
> >>>> broken SMM/BIOS when calling function fan_type().
> >>>> 
> >>>> Fifth is new feature and last sixth useful for debugging.
> >>>> 
> >>>> Pali Rohár (6):
> >>>>     hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios
> >>>>     version is
> >>>>     
> >>>>       not a number
> >>>>     
> >>>>     hwmon: (dell-smm) Restrict fan control and serial number to
> >>>>     
> >>>>       CAP_SYS_ADMIN by default
> >>>>     
> >>>>     hwmon: (dell-smm) Disallow fan_type() calls on broken
> >>>>     machines hwmon: (dell-smm) Cache fan_type() calls and
> >>>>     change fan detection hwmon: (dell-smm) Detect fan with
> >>>>     index=2 hwmon: (dell-smm) In debug mode log duration of SMM
> >>>>     calls
> >>>>    
> >>>>    drivers/hwmon/dell-smm-hwmon.c |  122
> >>>>    ++++++++++++++++++++++++++++++++-------- 1 file changed, 99
> >>>>    insertions(+), 23 deletions(-)
> >>> 
> >>> Pali,
> >>> 
> >>> You asked for additional testing, so I am not sure what you
> >>> expect me to do.
> >>> 
> >>> Which of the patches can/should I apply now ?
> >>> 
> >>> Guenter
> >> 
> >> Test 3/6 and 4/6 patches on affected Dell machines. I CCed all
> >> people who tried to debug those bugs, so need confirmation from
> >> them that after applying 3/6 and 4/6 patches, erratic fan
> >> behaviour is not there...
> >> 
> >> But because those two patches depends on previous, it is needed to
> >> test whole series...
> >> 
> >> This doesn't tell me which patches to apply now. The first two ?
> > 
> > Guenter

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines
  2016-06-18 20:08   ` Guenter Roeck
@ 2016-06-18 22:46     ` Pali Rohár
  0 siblings, 0 replies; 24+ messages in thread
From: Pali Rohár @ 2016-06-18 22:46 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 1414 bytes --]

On Saturday 18 June 2016 22:08:17 Guenter Roeck wrote:
> On 06/17/2016 03:54 PM, Pali Rohár wrote:
> > Some Dell machines have especially broken SMM or BIOS which cause
> > that once fan_type() is called then CPU fan speed going randomly
> > up and down. And for fixing this behaviour reboot is required.
> > 
> > So this patch creates fan_type blacklist of affected Dell machines
> > and disallow fan_type() call on them to prevent that erratic
> > behaviour.
> > 
> > Old blacklist which disabled loading driver on some machines added
> > in commits a4b45b25f18d ("hwmon: (dell-smm) Blacklist Dell Studio
> > XPS 8100") and 6220f4ebd7b4 ("hwmon: (dell-smm) Blacklist Dell
> > Studio XPS 8000") were moved to FAN_TYPE blacklist.
> > 
> > Reported-by: Jan C Peters <jcpeters89@gmail.com>
> > Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> > Link: https://bugzilla.kernel.org/show_bug.cgi?id=100121
> > Cc: stable@vger.kernel.org # v4.0+, will need backport
> 
> Applied.
> 
> It seemed worthwhile to apply this patch now, without waiting for
> further test feedback, since it at least reduces the impact of the
> observed problems. If follow-up changes are necessary, those will
> have to be applied in separate patches.
> 
> Guenter

Ok. Meanwhile patch was tested on Inspiron 580, so maybe it could be 
appended into commit message.

-- 
Pali Rohár
pali.rohar@gmail.com

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH 4/6] hwmon: (dell-smm) Cache fan_type() calls and change fan detection
  2016-06-17 22:54 ` [PATCH 4/6] hwmon: (dell-smm) Cache fan_type() calls and change fan detection Pali Rohár
@ 2016-06-19  0:01   ` Tolga Cakir
  0 siblings, 0 replies; 24+ messages in thread
From: Tolga Cakir @ 2016-06-19  0:01 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

Tested on a Dell Precision M3800. After applying this patch, the
machine doesn't freeze for a couple of seconds on module load and on
each sensors (lm_sensors) call anymore. It now just freezes once, when
running sensors for the first time, and that's it. It was not possible
to read correct RPM values using sensors before, because the fans were
running at maximum speed, when the freeze occured. I can now read RPM
values correctly and the machine doesn't annoy me with freezing up on
boot anymore.

Tested-by: Tolga Cakir <cevelnet@gmail.com>


2016-06-18 0:54 GMT+02:00 Pali Rohár <pali.rohar@gmail.com>:
> On more Dell machines (e.g. Dell Precision M3800) fan_type() call is too
> expensive (CPU is too long in SMM mode) and cause kernel to hang. This is
> bug in Dell SMM or BIOS.
>
> This patch caches type for each fan (as it should not change) and changes
> the way how fan presense is detected. First it try function fan_status()
> as was before commit f989e55452c7 ("i8k: Add support for fan labels"). And
> if that fails fallback to fan_type(). *_status() functions can fail in case
> fan is not currently accessible (e.g. present on GPU which is currently
> turned off).
>
> Reported-by: Tolga Cakir <cevelnet@gmail.com>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=112021
> Cc: stable@vger.kernel.org # v4.0+, will need backport
> ---
>  drivers/hwmon/dell-smm-hwmon.c |   25 ++++++++++++++++++++-----
>  1 file changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index 4bbc587..2ac87d5 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -238,7 +238,7 @@ static int i8k_get_fan_speed(int fan)
>  /*
>   * Read the fan type.
>   */
> -static int i8k_get_fan_type(int fan)
> +static int _i8k_get_fan_type(int fan)
>  {
>         struct smm_regs regs = { .eax = I8K_SMM_GET_FAN_TYPE, };
>
> @@ -249,6 +249,17 @@ static int i8k_get_fan_type(int fan)
>         return i8k_smm(&regs) ? : regs.eax & 0xff;
>  }
>
> +static int i8k_get_fan_type(int fan)
> +{
> +       /* I8K_SMM_GET_FAN_TYPE SMM call is expensive, so cache values */
> +       static int types[2] = { INT_MIN, INT_MIN };
> +
> +       if (types[fan] == INT_MIN)
> +               types[fan] = _i8k_get_fan_type(fan);
> +
> +       return types[fan];
> +}
> +
>  /*
>   * Read the fan nominal rpm for specific fan speed.
>   */
> @@ -782,13 +793,17 @@ static int __init i8k_init_hwmon(void)
>         if (err >= 0)
>                 i8k_hwmon_flags |= I8K_HWMON_HAVE_TEMP4;
>
> -       /* First fan attributes, if fan type is OK */
> -       err = i8k_get_fan_type(0);
> +       /* First fan attributes, if fan status or type is OK */
> +       err = i8k_get_fan_status(0);
> +       if (err < 0)
> +               err = i8k_get_fan_type(0);
>         if (err >= 0)
>                 i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN1;
>
> -       /* Second fan attributes, if fan type is OK */
> -       err = i8k_get_fan_type(1);
> +       /* Second fan attributes, if fan status or type is OK */
> +       err = i8k_get_fan_status(1);
> +       if (err < 0)
> +               err = i8k_get_fan_type(1);
>         if (err >= 0)
>                 i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN2;
>
> --
> 1.7.9.5
>

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

* Re: [PATCH 5/6] hwmon: (dell-smm) Detect fan with index=2
  2016-06-17 22:54 ` [PATCH 5/6] hwmon: (dell-smm) Detect fan with index=2 Pali Rohár
@ 2016-06-19  0:02   ` Tolga Cakir
  0 siblings, 0 replies; 24+ messages in thread
From: Tolga Cakir @ 2016-06-19  0:02 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

Tested on Dell Precision M3800. It now correctly detects 2 fans for my
machine, one cpu fan and one gpu fan. The reported fan type and fan
speeds look correct. I'm getting unique fan speeds for each fan. I've
also noticed the freeze, which happends on my machine upon
I8K_SMM_GET_FAN_TYPE call, is now doubled to around 4 - 5 seconds due
to detecting 2 fans.

Tested-by: Tolga Cakir <cevelnet@gmail.com>

2016-06-18 0:54 GMT+02:00 Pali Rohár <pali.rohar@gmail.com>:
> Some Dell machines (e.g. Dell Precision M3800) have two fans, first with
> index=0 and second with index=2. So export also attributes for third fan
> device with index=2.
>
> Reported-by: Tolga Cakir <cevelnet@gmail.com>
> Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
> ---
>  drivers/hwmon/dell-smm-hwmon.c |   24 ++++++++++++++++++++++--
>  1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
> index 2ac87d5..571d498 100644
> --- a/drivers/hwmon/dell-smm-hwmon.c
> +++ b/drivers/hwmon/dell-smm-hwmon.c
> @@ -81,6 +81,7 @@ static bool disallow_fan_type_call;
>  #define I8K_HWMON_HAVE_TEMP4   (1 << 3)
>  #define I8K_HWMON_HAVE_FAN1    (1 << 4)
>  #define I8K_HWMON_HAVE_FAN2    (1 << 5)
> +#define I8K_HWMON_HAVE_FAN3    (1 << 6)
>
>  MODULE_AUTHOR("Massimo Dal Zotto (dz@debian.org)");
>  MODULE_AUTHOR("Pali Rohár <pali.rohar@gmail.com>");
> @@ -252,7 +253,7 @@ static int _i8k_get_fan_type(int fan)
>  static int i8k_get_fan_type(int fan)
>  {
>         /* I8K_SMM_GET_FAN_TYPE SMM call is expensive, so cache values */
> -       static int types[2] = { INT_MIN, INT_MIN };
> +       static int types[3] = { INT_MIN, INT_MIN, INT_MIN };
>
>         if (types[fan] == INT_MIN)
>                 types[fan] = _i8k_get_fan_type(fan);
> @@ -719,6 +720,12 @@ static SENSOR_DEVICE_ATTR(fan2_label, S_IRUGO, i8k_hwmon_show_fan_label, NULL,
>                           1);
>  static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, i8k_hwmon_show_pwm,
>                           i8k_hwmon_set_pwm, 1);
> +static SENSOR_DEVICE_ATTR(fan3_input, S_IRUGO, i8k_hwmon_show_fan, NULL,
> +                         2);
> +static SENSOR_DEVICE_ATTR(fan3_label, S_IRUGO, i8k_hwmon_show_fan_label, NULL,
> +                         2);
> +static SENSOR_DEVICE_ATTR(pwm3, S_IRUGO | S_IWUSR, i8k_hwmon_show_pwm,
> +                         i8k_hwmon_set_pwm, 2);
>
>  static struct attribute *i8k_attrs[] = {
>         &sensor_dev_attr_temp1_input.dev_attr.attr,     /* 0 */
> @@ -735,6 +742,9 @@ static struct attribute *i8k_attrs[] = {
>         &sensor_dev_attr_fan2_input.dev_attr.attr,      /* 11 */
>         &sensor_dev_attr_fan2_label.dev_attr.attr,      /* 12 */
>         &sensor_dev_attr_pwm2.dev_attr.attr,            /* 13 */
> +       &sensor_dev_attr_fan3_input.dev_attr.attr,      /* 14 */
> +       &sensor_dev_attr_fan3_label.dev_attr.attr,      /* 15 */
> +       &sensor_dev_attr_pwm3.dev_attr.attr,            /* 16 */
>         NULL
>  };
>
> @@ -742,7 +752,7 @@ static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
>                               int index)
>  {
>         if (disallow_fan_type_call &&
> -           (index == 9 || index == 12))
> +           (index == 9 || index == 12 || index == 15))
>                 return 0;
>         if (index >= 0 && index <= 1 &&
>             !(i8k_hwmon_flags & I8K_HWMON_HAVE_TEMP1))
> @@ -762,6 +772,9 @@ static umode_t i8k_is_visible(struct kobject *kobj, struct attribute *attr,
>         if (index >= 11 && index <= 13 &&
>             !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN2))
>                 return 0;
> +       if (index >= 14 && index <= 16 &&
> +           !(i8k_hwmon_flags & I8K_HWMON_HAVE_FAN3))
> +               return 0;
>
>         return attr->mode;
>  }
> @@ -807,6 +820,13 @@ static int __init i8k_init_hwmon(void)
>         if (err >= 0)
>                 i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN2;
>
> +       /* Third fan attributes, if fan status or type is OK */
> +       err = i8k_get_fan_status(2);
> +       if (err < 0)
> +               err = i8k_get_fan_type(2);
> +       if (err >= 0)
> +               i8k_hwmon_flags |= I8K_HWMON_HAVE_FAN3;
> +
>         i8k_hwmon_dev = hwmon_device_register_with_groups(NULL, "dell_smm",
>                                                           NULL, i8k_groups);
>         if (IS_ERR(i8k_hwmon_dev)) {
> --
> 1.7.9.5
>

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-18 22:39       ` Pali Rohár
@ 2016-06-20  9:12         ` Pali Rohár
  2016-06-20 13:24           ` Guenter Roeck
  0 siblings, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-20  9:12 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

On Sunday 19 June 2016 00:39:47 Pali Rohár wrote:
> On Saturday 18 June 2016 18:54:58 Guenter Roeck wrote:
> > On 06/18/2016 08:26 AM, Pali Rohár wrote:
> > > On Saturday 18 June 2016 17:13:59 Guenter Roeck wrote:
> > >> On 06/17/2016 03:54 PM, Pali Rohár wrote:
> > >>> I'm sending all my dell-smm-hwmon patches in one series, because
> > >>> due to changes in code other patches depends on previous.
> > >>> 
> > >>> First two patches fixes problem with old /proc/i8k file. Second
> > >>> is security fix and should be backported to all stable kernels
> > >>> (that problem was there always). I tested i8kctl tool (from
> > >>> i8kutils package) that it still works with these patches.
> > >>> Without root access for those security operations just showes
> > >>> '?' or '-1'.
> > >>> 
> > >>> Third and fourth patches try to fix problem on machines with
> > >>> broken SMM/BIOS when calling function fan_type().
> > >>> 
> > >>> Fifth is new feature and last sixth useful for debugging.
> > >>> 
> > >>> Pali Rohár (6):
> > >>>     hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios
> > >>>     version is
> > >>>     
> > >>>       not a number
> > >>>     
> > >>>     hwmon: (dell-smm) Restrict fan control and serial number to
> > >>>     
> > >>>       CAP_SYS_ADMIN by default
> > >>>     
> > >>>     hwmon: (dell-smm) Disallow fan_type() calls on broken
> > >>>     machines hwmon: (dell-smm) Cache fan_type() calls and change
> > >>>     fan detection hwmon: (dell-smm) Detect fan with index=2
> > >>>     hwmon: (dell-smm) In debug mode log duration of SMM calls
> > >>>    
> > >>>    drivers/hwmon/dell-smm-hwmon.c |  122
> > >>>    ++++++++++++++++++++++++++++++++-------- 1 file changed, 99
> > >>>    insertions(+), 23 deletions(-)
> > >> 
> > >> Pali,
> > >> 
> > >> You asked for additional testing, so I am not sure what you expect
> > >> me to do.
> > >> 
> > >> Which of the patches can/should I apply now ?
> > >> 
> > >> Guenter
> > > 
> > > Test 3/6 and 4/6 patches on affected Dell machines. I CCed all
> > > people who tried to debug those bugs, so need confirmation from
> > > them that after applying 3/6 and 4/6 patches, erratic fan
> > > behaviour is not there...
> > > 
> > > But because those two patches depends on previous, it is needed to
> > > test whole series...
> > 
> > This doesn't tell me which patches to apply now. The first two ?
> 
> Yes, 1/6 and 2/6 are OK.
> 

Guenter, now you can apply whole series + add all tested-by lines from
email threads. Looks like it is OK now.

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-20  9:12         ` Pali Rohár
@ 2016-06-20 13:24           ` Guenter Roeck
  2016-06-23 12:16             ` Pali Rohár
  0 siblings, 1 reply; 24+ messages in thread
From: Guenter Roeck @ 2016-06-20 13:24 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

On 06/20/2016 02:12 AM, Pali Rohár wrote:
> On Sunday 19 June 2016 00:39:47 Pali Rohár wrote:
>> On Saturday 18 June 2016 18:54:58 Guenter Roeck wrote:
>>> On 06/18/2016 08:26 AM, Pali Rohár wrote:
>>>> On Saturday 18 June 2016 17:13:59 Guenter Roeck wrote:
>>>>> On 06/17/2016 03:54 PM, Pali Rohár wrote:
>>>>>> I'm sending all my dell-smm-hwmon patches in one series, because
>>>>>> due to changes in code other patches depends on previous.
>>>>>>
>>>>>> First two patches fixes problem with old /proc/i8k file. Second
>>>>>> is security fix and should be backported to all stable kernels
>>>>>> (that problem was there always). I tested i8kctl tool (from
>>>>>> i8kutils package) that it still works with these patches.
>>>>>> Without root access for those security operations just showes
>>>>>> '?' or '-1'.
>>>>>>
>>>>>> Third and fourth patches try to fix problem on machines with
>>>>>> broken SMM/BIOS when calling function fan_type().
>>>>>>
>>>>>> Fifth is new feature and last sixth useful for debugging.
>>>>>>
>>>>>> Pali Rohár (6):
>>>>>>      hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios
>>>>>>      version is
>>>>>>
>>>>>>        not a number
>>>>>>
>>>>>>      hwmon: (dell-smm) Restrict fan control and serial number to
>>>>>>
>>>>>>        CAP_SYS_ADMIN by default
>>>>>>
>>>>>>      hwmon: (dell-smm) Disallow fan_type() calls on broken
>>>>>>      machines hwmon: (dell-smm) Cache fan_type() calls and change
>>>>>>      fan detection hwmon: (dell-smm) Detect fan with index=2
>>>>>>      hwmon: (dell-smm) In debug mode log duration of SMM calls
>>>>>>
>>>>>>     drivers/hwmon/dell-smm-hwmon.c |  122
>>>>>>     ++++++++++++++++++++++++++++++++-------- 1 file changed, 99
>>>>>>     insertions(+), 23 deletions(-)
>>>>>
>>>>> Pali,
>>>>>
>>>>> You asked for additional testing, so I am not sure what you expect
>>>>> me to do.
>>>>>
>>>>> Which of the patches can/should I apply now ?
>>>>>
>>>>> Guenter
>>>>
>>>> Test 3/6 and 4/6 patches on affected Dell machines. I CCed all
>>>> people who tried to debug those bugs, so need confirmation from
>>>> them that after applying 3/6 and 4/6 patches, erratic fan
>>>> behaviour is not there...
>>>>
>>>> But because those two patches depends on previous, it is needed to
>>>> test whole series...
>>>
>>> This doesn't tell me which patches to apply now. The first two ?
>>
>> Yes, 1/6 and 2/6 are OK.
>>
>
> Guenter, now you can apply whole series + add all tested-by lines from
> email threads. Looks like it is OK now.
>
First three patches applied and sent to Linus last night.

Remaining three patches applied to -next.

Thanks,
Guenter

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
                   ` (7 preceding siblings ...)
  2016-06-18 15:13 ` Guenter Roeck
@ 2016-06-22  8:02 ` Michał Kępień
  8 siblings, 0 replies; 24+ messages in thread
From: Michał Kępień @ 2016-06-22  8:02 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Jean Delvare, Guenter Roeck, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

> I'm sending all my dell-smm-hwmon patches in one series, because due to
> changes in code other patches depends on previous.
> 
> First two patches fixes problem with old /proc/i8k file. Second is security
> fix and should be backported to all stable kernels (that problem was there
> always). I tested i8kctl tool (from i8kutils package) that it still works
> with these patches. Without root access for those security operations just
> showes '?' or '-1'.
> 
> Third and fourth patches try to fix problem on machines with broken
> SMM/BIOS when calling function fan_type().
> 
> Fifth is new feature and last sixth useful for debugging.
> 
> Pali Rohár (6):
>   hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is
>     not a number
>   hwmon: (dell-smm) Restrict fan control and serial number to
>     CAP_SYS_ADMIN by default
>   hwmon: (dell-smm) Disallow fan_type() calls on broken machines
>   hwmon: (dell-smm) Cache fan_type() calls and change fan detection
>   hwmon: (dell-smm) Detect fan with index=2
>   hwmon: (dell-smm) In debug mode log duration of SMM calls
> 
>  drivers/hwmon/dell-smm-hwmon.c |  122 ++++++++++++++++++++++++++++++++--------
>  1 file changed, 99 insertions(+), 23 deletions(-)

On a Vostro V131 (BIOS A04):

Tested-by: Michał Kępień <kernel@kempniu.pl>

-- 
Best regards,
Michał Kępień

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-20 13:24           ` Guenter Roeck
@ 2016-06-23 12:16             ` Pali Rohár
  2016-06-23 13:51               ` Guenter Roeck
  0 siblings, 1 reply; 24+ messages in thread
From: Pali Rohár @ 2016-06-23 12:16 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

On Monday 20 June 2016 06:24:57 Guenter Roeck wrote:
> On 06/20/2016 02:12 AM, Pali Rohár wrote:
> >On Sunday 19 June 2016 00:39:47 Pali Rohár wrote:
> >>On Saturday 18 June 2016 18:54:58 Guenter Roeck wrote:
> >>>On 06/18/2016 08:26 AM, Pali Rohár wrote:
> >>>>On Saturday 18 June 2016 17:13:59 Guenter Roeck wrote:
> >>>>>On 06/17/2016 03:54 PM, Pali Rohár wrote:
> >>>>>>I'm sending all my dell-smm-hwmon patches in one series, because
> >>>>>>due to changes in code other patches depends on previous.
> >>>>>>
> >>>>>>First two patches fixes problem with old /proc/i8k file. Second
> >>>>>>is security fix and should be backported to all stable kernels
> >>>>>>(that problem was there always). I tested i8kctl tool (from
> >>>>>>i8kutils package) that it still works with these patches.
> >>>>>>Without root access for those security operations just showes
> >>>>>>'?' or '-1'.
> >>>>>>
> >>>>>>Third and fourth patches try to fix problem on machines with
> >>>>>>broken SMM/BIOS when calling function fan_type().
> >>>>>>
> >>>>>>Fifth is new feature and last sixth useful for debugging.
> >>>>>>
> >>>>>>Pali Rohár (6):
> >>>>>>     hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios
> >>>>>>     version is
> >>>>>>
> >>>>>>       not a number
> >>>>>>
> >>>>>>     hwmon: (dell-smm) Restrict fan control and serial number to
> >>>>>>
> >>>>>>       CAP_SYS_ADMIN by default
> >>>>>>
> >>>>>>     hwmon: (dell-smm) Disallow fan_type() calls on broken
> >>>>>>     machines hwmon: (dell-smm) Cache fan_type() calls and change
> >>>>>>     fan detection hwmon: (dell-smm) Detect fan with index=2
> >>>>>>     hwmon: (dell-smm) In debug mode log duration of SMM calls
> >>>>>>
> >>>>>>    drivers/hwmon/dell-smm-hwmon.c |  122
> >>>>>>    ++++++++++++++++++++++++++++++++-------- 1 file changed, 99
> >>>>>>    insertions(+), 23 deletions(-)
> >>>>>
> >>>>>Pali,
> >>>>>
> >>>>>You asked for additional testing, so I am not sure what you expect
> >>>>>me to do.
> >>>>>
> >>>>>Which of the patches can/should I apply now ?
> >>>>>
> >>>>>Guenter
> >>>>
> >>>>Test 3/6 and 4/6 patches on affected Dell machines. I CCed all
> >>>>people who tried to debug those bugs, so need confirmation from
> >>>>them that after applying 3/6 and 4/6 patches, erratic fan
> >>>>behaviour is not there...
> >>>>
> >>>>But because those two patches depends on previous, it is needed to
> >>>>test whole series...
> >>>
> >>>This doesn't tell me which patches to apply now. The first two ?
> >>
> >>Yes, 1/6 and 2/6 are OK.
> >>
> >
> >Guenter, now you can apply whole series + add all tested-by lines from
> >email threads. Looks like it is OK now.
> >
> First three patches applied and sent to Linus last night.
> 
> Remaining three patches applied to -next.

Ok, are you going to send at least patch 4/6 to Linus too as it fixes
next bug which should go to -stable too?

-- 
Pali Rohár
pali.rohar@gmail.com

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

* Re: [PATCH 0/6] dell-smm-hwmon fixes
  2016-06-23 12:16             ` Pali Rohár
@ 2016-06-23 13:51               ` Guenter Roeck
  0 siblings, 0 replies; 24+ messages in thread
From: Guenter Roeck @ 2016-06-23 13:51 UTC (permalink / raw)
  To: Pali Rohár
  Cc: Jean Delvare, Jan C Peters, Thorsten Leemhuis,
	David Santamaría Rogado, Peter Saunderson, Tolga Cakir,
	Austin S. Hemmelgarn, Mario_Limonciello, Gabriele Mazzotta,
	Michał Kępień,
	Dakota Whipple, Leon Yu, linux-hwmon, linux-kernel

On 06/23/2016 05:16 AM, Pali Rohár wrote:
> On Monday 20 June 2016 06:24:57 Guenter Roeck wrote:
>> On 06/20/2016 02:12 AM, Pali Rohár wrote:
>>> On Sunday 19 June 2016 00:39:47 Pali Rohár wrote:
>>>> On Saturday 18 June 2016 18:54:58 Guenter Roeck wrote:
>>>>> On 06/18/2016 08:26 AM, Pali Rohár wrote:
>>>>>> On Saturday 18 June 2016 17:13:59 Guenter Roeck wrote:
>>>>>>> On 06/17/2016 03:54 PM, Pali Rohár wrote:
>>>>>>>> I'm sending all my dell-smm-hwmon patches in one series, because
>>>>>>>> due to changes in code other patches depends on previous.
>>>>>>>>
>>>>>>>> First two patches fixes problem with old /proc/i8k file. Second
>>>>>>>> is security fix and should be backported to all stable kernels
>>>>>>>> (that problem was there always). I tested i8kctl tool (from
>>>>>>>> i8kutils package) that it still works with these patches.
>>>>>>>> Without root access for those security operations just showes
>>>>>>>> '?' or '-1'.
>>>>>>>>
>>>>>>>> Third and fourth patches try to fix problem on machines with
>>>>>>>> broken SMM/BIOS when calling function fan_type().
>>>>>>>>
>>>>>>>> Fifth is new feature and last sixth useful for debugging.
>>>>>>>>
>>>>>>>> Pali Rohár (6):
>>>>>>>>      hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios
>>>>>>>>      version is
>>>>>>>>
>>>>>>>>        not a number
>>>>>>>>
>>>>>>>>      hwmon: (dell-smm) Restrict fan control and serial number to
>>>>>>>>
>>>>>>>>        CAP_SYS_ADMIN by default
>>>>>>>>
>>>>>>>>      hwmon: (dell-smm) Disallow fan_type() calls on broken
>>>>>>>>      machines hwmon: (dell-smm) Cache fan_type() calls and change
>>>>>>>>      fan detection hwmon: (dell-smm) Detect fan with index=2
>>>>>>>>      hwmon: (dell-smm) In debug mode log duration of SMM calls
>>>>>>>>
>>>>>>>>     drivers/hwmon/dell-smm-hwmon.c |  122
>>>>>>>>     ++++++++++++++++++++++++++++++++-------- 1 file changed, 99
>>>>>>>>     insertions(+), 23 deletions(-)
>>>>>>>
>>>>>>> Pali,
>>>>>>>
>>>>>>> You asked for additional testing, so I am not sure what you expect
>>>>>>> me to do.
>>>>>>>
>>>>>>> Which of the patches can/should I apply now ?
>>>>>>>
>>>>>>> Guenter
>>>>>>
>>>>>> Test 3/6 and 4/6 patches on affected Dell machines. I CCed all
>>>>>> people who tried to debug those bugs, so need confirmation from
>>>>>> them that after applying 3/6 and 4/6 patches, erratic fan
>>>>>> behaviour is not there...
>>>>>>
>>>>>> But because those two patches depends on previous, it is needed to
>>>>>> test whole series...
>>>>>
>>>>> This doesn't tell me which patches to apply now. The first two ?
>>>>
>>>> Yes, 1/6 and 2/6 are OK.
>>>>
>>>
>>> Guenter, now you can apply whole series + add all tested-by lines from
>>> email threads. Looks like it is OK now.
>>>
>> First three patches applied and sent to Linus last night.
>>
>> Remaining three patches applied to -next.
>
> Ok, are you going to send at least patch 4/6 to Linus too as it fixes
> next bug which should go to -stable too?
>
Now queued.

Guenter

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

end of thread, other threads:[~2016-06-23 13:52 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 22:54 [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
2016-06-17 22:54 ` [PATCH 1/6] hwmon: (dell-smm) Fail in ioctl I8K_BIOS_VERSION when bios version is not a number Pali Rohár
2016-06-18 20:00   ` Guenter Roeck
2016-06-17 22:54 ` [PATCH 2/6] hwmon: (dell-smm) Restrict fan control and serial number to CAP_SYS_ADMIN by default Pali Rohár
2016-06-18 20:00   ` Guenter Roeck
2016-06-17 22:54 ` [PATCH 3/6] hwmon: (dell-smm) Disallow fan_type() calls on broken machines Pali Rohár
2016-06-18 20:08   ` Guenter Roeck
2016-06-18 22:46     ` Pali Rohár
2016-06-17 22:54 ` [PATCH 4/6] hwmon: (dell-smm) Cache fan_type() calls and change fan detection Pali Rohár
2016-06-19  0:01   ` Tolga Cakir
2016-06-17 22:54 ` [PATCH 5/6] hwmon: (dell-smm) Detect fan with index=2 Pali Rohár
2016-06-19  0:02   ` Tolga Cakir
2016-06-17 22:54 ` [PATCH 6/6] hwmon: (dell-smm) In debug mode log duration of SMM calls Pali Rohár
2016-06-18 12:21 ` [PATCH 0/6] dell-smm-hwmon fixes Pali Rohár
2016-06-18 15:13 ` Guenter Roeck
2016-06-18 15:26   ` Pali Rohár
2016-06-18 16:54     ` Guenter Roeck
2016-06-18 22:39       ` Pali Rohár
2016-06-20  9:12         ` Pali Rohár
2016-06-20 13:24           ` Guenter Roeck
2016-06-23 12:16             ` Pali Rohár
2016-06-23 13:51               ` Guenter Roeck
     [not found]       ` <CA+vQ2zCoGhLT2PUUhcuggJ3oE9Z6vfUW=Z1wgm8Ozz3XdnQoxA@mail.gmail.com>
2016-06-18 22:44         ` Pali Rohár
2016-06-22  8:02 ` Michał Kępień

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