public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] i2c: fix virtual i2c adapter lockdep warning
@ 2008-08-04 17:50 David Rientjes
       [not found] ` <alpine.DEB.1.10.0808032024130.2365-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: David Rientjes @ 2008-08-04 17:50 UTC (permalink / raw)
  To: Rodolfo Giometti; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA

bus_lock for both the virtual adapter and its parent have the same lock
class.  Since both are taken in i2c_virt_master_xfer() and
i2c_virt_smbus_xfer(), lockdep needs an annotation that the nesting is
safe.

Signed-off-by: David Rientjes <rientjes-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
---
 drivers/i2c/i2c-virt.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-virt.c b/drivers/i2c/i2c-virt.c
--- a/drivers/i2c/i2c-virt.c
+++ b/drivers/i2c/i2c-virt.c
@@ -53,7 +53,7 @@ static int i2c_virt_master_xfer(struct i2c_adapter *adap,
 	 * the transfer.
 	 */
 
-	mutex_lock(&parent->bus_lock);
+	mutex_lock_nested(&parent->bus_lock, SINGLE_DEPTH_NESTING);
 
 	ret = priv->select(parent, priv->client, priv->id);
 	if (ret >= 0)
@@ -79,7 +79,7 @@ static int i2c_virt_smbus_xfer(struct i2c_adapter *adap,
 	 * the transfer.
 	 */
 
-	mutex_lock(&parent->bus_lock);
+	mutex_lock_nested(&parent->bus_lock, SINGLE_DEPTH_NESTING);
 
 	ret = priv->select(parent, priv->client, priv->id);
 	if (ret == 0)

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

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

end of thread, other threads:[~2008-08-14 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-04 17:50 [patch] i2c: fix virtual i2c adapter lockdep warning David Rientjes
     [not found] ` <alpine.DEB.1.10.0808032024130.2365-X6Q0R45D7oAcqpCFd4KODRPsWskHk0ljAL8bYrjMMd8@public.gmane.org>
2008-08-14 11:42   ` Rodolfo Giometti
2008-08-14 19:46     ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox