From patchwork Tue Jun 7 00:00:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 99063 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8B17FB6FB5 for ; Tue, 7 Jun 2011 10:01:31 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754766Ab1FGAB0 (ORCPT ); Mon, 6 Jun 2011 20:01:26 -0400 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:55883 "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752798Ab1FGABZ (ORCPT ); Mon, 6 Jun 2011 20:01:25 -0400 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 934FE24C1C0; Mon, 6 Jun 2011 17:00:56 -0700 (PDT) Date: Mon, 06 Jun 2011 17:00:56 -0700 (PDT) Message-Id: <20110606.170056.193694265.davem@davemloft.net> To: davej@redhat.com Cc: netdev@vger.kernel.org, samuel@sortiz.org Subject: Re: suspect locking in net/irda/iriap.c From: David Miller In-Reply-To: <20110421034057.GA10536@redhat.com> References: <20110421034057.GA10536@redhat.com> X-Mailer: Mew version 6.3 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Dave Jones Date: Wed, 20 Apr 2011 23:40:58 -0400 > My reading of that comment suggests that the two locks aren't the same, > so is this just missing a lockdep annotation ? Dave, I'm going to check in the following to net-2.6 to try and address this. Let me know how it works for you. -------------------- irda: iriap: Use seperate lockdep class for irias_objects->hb_spinlock The SEQ output functions grab the obj->attrib->hb_spinlock lock of sub-objects found in the hash traversal. These locks are in a different realm than the one used for the irias_objects hash table itself. So put the latter into it's own lockdep class. Reported-by: Dave Jones Signed-off-by: David S. Miller --- net/irda/iriap.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 3647753..f876eed 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c @@ -87,6 +87,8 @@ static inline void iriap_start_watchdog_timer(struct iriap_cb *self, iriap_watchdog_timer_expired); } +static struct lock_class_key irias_objects_key; + /* * Function iriap_init (void) * @@ -114,6 +116,9 @@ int __init iriap_init(void) return -ENOMEM; } + lockdep_set_class_and_name(&irias_objects->hb_spinlock, &irias_objects_key, + "irias_objects"); + /* * Register some default services for IrLMP */