Commit f5dcac2b authored by Samuel Rydh's avatar Samuel Rydh Committed by Wim Van Sebroeck

[PATCH] keywest bugfix

This fixes a deadlock in I2C probing.

 - 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.
parent 366bf3a0
...@@ -608,6 +608,7 @@ create_iface(struct device_node *np, struct device *dev) ...@@ -608,6 +608,7 @@ create_iface(struct device_node *np, struct device *dev)
} }
#endif /* POLLED_MODE */ #endif /* POLLED_MODE */
pmac_low_i2c_unlock(np);
dev_set_drvdata(dev, iface); dev_set_drvdata(dev, iface);
for (i=0; i<nchan; i++) { for (i=0; i<nchan; i++) {
...@@ -645,7 +646,6 @@ create_iface(struct device_node *np, struct device *dev) ...@@ -645,7 +646,6 @@ create_iface(struct device_node *np, struct device *dev)
printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n", printk(KERN_INFO "Found KeyWest i2c on \"%s\", %d channel%s, stepping: %d bits\n",
np->parent->name, nchan, nchan > 1 ? "s" : "", bsteps); np->parent->name, nchan, nchan > 1 ? "s" : "", bsteps);
pmac_low_i2c_unlock(np);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment