From f5dcac2b3088954655be5ecd7c65e8840db752de Mon Sep 17 00:00:00 2001 From: Samuel Rydh Date: Sat, 20 Mar 2004 03:39:50 -0800 Subject: [PATCH] [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. --- drivers/i2c/busses/i2c-keywest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-keywest.c b/drivers/i2c/busses/i2c-keywest.c index 74af8459765b4..3c65c9d030e89 100644 --- a/drivers/i2c/busses/i2c-keywest.c +++ b/drivers/i2c/busses/i2c-keywest.c @@ -608,6 +608,7 @@ create_iface(struct device_node *np, struct device *dev) } #endif /* POLLED_MODE */ + pmac_low_i2c_unlock(np); dev_set_drvdata(dev, iface); for (i=0; iparent->name, nchan, nchan > 1 ? "s" : "", bsteps); - pmac_low_i2c_unlock(np); return 0; } -- 2.53.0