Source: linux
Version: 3.16.7-ckt11-1+deb8u4
Severity: critical
Tags: patch
Justification: breaks the whole system

Dear Maintainer,

i2c-i801 module hangs on my IBM x3550, the system starts but in emergency
console and in the tty systemd continuously notify:
INFO: task systemd-udevd:262 blocked for more than 120 seconds.
        Not tainted 3.16.0-4-amd64 #1
"echo 0 > /proc/syst/kernel/hung_task_timeout_secs" disables this message.

Before udev upgrade (215-17+deb8u1 to 215-17+deb8u2) the system was started but
with systemd warning and "blocked" udevd.

However a official patch to i2c-i801 resolve the problem, it adds
wait_event_timeout() to to wait for interrupts.

I've tested the patch on kernel 3.16.7-ckt11-1+deb8u3 without problems.

Please, try and add id to the official kernel :-)



-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.1.0-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
Index: linux-3.16.7-ckt11/drivers/i2c/busses/i2c-i801.c
===================================================================
--- linux-3.16.7-ckt11.orig/drivers/i2c/busses/i2c-i801.c
+++ linux-3.16.7-ckt11/drivers/i2c/busses/i2c-i801.c
@@ -2,7 +2,7 @@
     Copyright (c) 1998 - 2002  Frodo Looijaard <fro...@dds.nl>,
     Philip Edelbrock <p...@netroedge.com>, and Mark D. Studebaker
     <mdsxyz...@yahoo.com>
-    Copyright (C) 2007 - 2012  Jean Delvare <jdelv...@suse.de>
+    Copyright (C) 2007 - 2014  Jean Delvare <jdelv...@suse.de>
     Copyright (C) 2010         Intel Corporation,
                                David Woodhouse <dw...@infradead.org>
 
@@ -370,6 +370,7 @@ static int i801_transaction(struct i801_
 {
 	int status;
 	int result;
+	const struct i2c_adapter *adap = &priv->adapter;
 
 	result = i801_check_pre(priv);
 	if (result < 0)
@@ -378,7 +379,14 @@ static int i801_transaction(struct i801_
 	if (priv->features & FEATURE_IRQ) {
 		outb_p(xact | SMBHSTCNT_INTREN | SMBHSTCNT_START,
 		       SMBHSTCNT(priv));
-		wait_event(priv->waitq, (status = priv->status));
+		result = wait_event_timeout(priv->waitq,
+					    (status = priv->status),
+					    adap->timeout);
+		if (!result) {
+			status = -ETIMEDOUT;
+			dev_warn(&priv->pci_dev->dev,
+				 "Timeout waiting for interrupt!\n");
+		}
 		priv->status = 0;
 		return i801_check_post(priv, status);
 	}
@@ -526,6 +534,7 @@ static int i801_block_transaction_byte_b
 	int smbcmd;
 	int status;
 	int result;
+	const struct i2c_adapter *adap = &priv->adapter;
 
 	result = i801_check_pre(priv);
 	if (result < 0)
@@ -554,7 +563,14 @@ static int i801_block_transaction_byte_b
 		priv->data = &data->block[1];
 
 		outb_p(priv->cmd | SMBHSTCNT_START, SMBHSTCNT(priv));
-		wait_event(priv->waitq, (status = priv->status));
+		result = wait_event_timeout(priv->waitq,
+					    (status = priv->status),
+					    adap->timeout);
+		if (!result) {
+			status = -ETIMEDOUT;
+			dev_warn(&priv->pci_dev->dev,
+				 "Timeout waiting for interrupt!\n");
+		}
 		priv->status = 0;
 		return i801_check_post(priv, status);
 	}
@@ -1208,6 +1224,9 @@ static int i801_probe(struct pci_dev *de
 		outb_p(inb_p(SMBAUXCTL(priv)) &
 		       ~(SMBAUXCTL_CRC | SMBAUXCTL_E32B), SMBAUXCTL(priv));
 
+	/* Default timeout in interrupt mode: 200 ms */
+	priv->adapter.timeout = HZ / 5;
+
 	if (priv->features & FEATURE_IRQ) {
 		init_waitqueue_head(&priv->waitq);
 

Reply via email to