lkml.org 
[lkml]   [2004]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] pmac: keywest bugfix
From
Date
Please apply

-----Forwarded Message-----
From: Samuel Rydh <samuel@ibrium.se>
To: linuxppc-dev@lists.linuxppc.org
Cc: benh@kernel.crashing.org
Subject: keywest bugfix
Date: Sat, 20 Mar 2004 14:43:16 +0100


The following patch fixes a deadlock in I2C probing:

===== drivers/i2c/busses/i2c-keywest.c 1.12 vs edited =====
--- 1.12/drivers/i2c/busses/i2c-keywest.c Mon Mar 15 11:25:23 2004
+++ edited/drivers/i2c/busses/i2c-keywest.c Sat Mar 20 14:33:07 2004
@@ -608,6 +608,7 @@
}
#endif /* POLLED_MODE */

+ pmac_low_i2c_unlock(np);
dev_set_drvdata(dev, iface);

for (i=0; i<nchan; i++) {
@@ -645,7 +646,6 @@
printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n",
np->parent->name, nchan, nchan > 1 ? "s" : "", bsteps);

- pmac_low_i2c_unlock(np);
return 0;
}

Without this patch, the deadlock occurs in the following situation:

- keywest holds the pmac_low_i2c_lock while registering the i2c adapter.
- i2c_add_adapter() notifies registered drivers by calling
driver->attach_adapter().
- a driver might access the i2c bus from attach_adapter() which
deadlocks since all xfer routines take the lock.

/Samuel

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
--
Benjamin Herrenschmidt <benh@kernel.crashing.org>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:01    [W:0.047 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site