From patchwork Mon Jan 19 20:11:50 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Harrison X-Patchwork-Id: 19390 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.176.167]) by ozlabs.org (Postfix) with ESMTP id A8094DDF93 for ; Tue, 20 Jan 2009 07:12:13 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753198AbZASUMI (ORCPT ); Mon, 19 Jan 2009 15:12:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753020AbZASUMG (ORCPT ); Mon, 19 Jan 2009 15:12:06 -0500 Received: from wf-out-1314.google.com ([209.85.200.175]:63142 "EHLO wf-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752671AbZASUMD (ORCPT ); Mon, 19 Jan 2009 15:12:03 -0500 Received: by wf-out-1314.google.com with SMTP id 27so3368017wfd.4 for ; Mon, 19 Jan 2009 12:12:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=vzqHSE3Z3zB1TbtUGYm6Pz0tpvJAMjoDnULF9wgGp6o=; b=YDiiClCsT2X0UZKJVjnGXISKoWUc00efBlk2K36I/wp1s/i6vOkfkL0cbyQUt+m9to 2Qlw2xeYs+RPrcIVemtO46FhC8fLL5bOCX3lQXTEYpa59JsYLzmta7oufUhmXfZUjPSl FHUUzsTMpZK2LGn7QbBnClHIodKaqVgQEKHcQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=eebd/etzDVRKzCqCqZdcI6UebGwxRdjhfHg5b++yYcRGDo/wvK2YP0cn0RyORrXwR6 HbSSIfolz3nFZuZY2jEH+6PDng+sQTOLstMUr5h7URFONii06IdIxSRL++x8Bbi9gVOl mGv6LlioT61umbACXr1uCJn+hmUkz+XVWP43k= Received: by 10.142.14.18 with SMTP id 18mr2500087wfn.215.1232395922777; Mon, 19 Jan 2009 12:12:02 -0800 (PST) Received: from ?128.189.251.53? ([128.189.251.53]) by mx.google.com with ESMTPS id 22sm6270010wfg.10.2009.01.19.12.12.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 19 Jan 2009 12:12:02 -0800 (PST) Subject: [PATCH] bnx2: annotate bp->phy_lock functions From: Harvey Harrison To: Eilon Greenstein Cc: David Miller , linux-netdev Date: Mon, 19 Jan 2009 12:11:50 -0800 Message-Id: <1232395910.13386.4.camel@brick> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org It looks like the locking is OK as the locks were being taken before the various phy setup functions, add the annotations as they release and reacquire the phy_lock. Signed-off-by: Harvey Harrison --- drivers/net/bnx2.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index d4a3dac..d86a8f2 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -1497,6 +1497,8 @@ static int bnx2_fw_sync(struct bnx2 *, u32, int, int); static int bnx2_setup_remote_phy(struct bnx2 *bp, u8 port) +__releases(&bp->phy_lock) +__acquires(&bp->phy_lock) { u32 speed_arg = 0, pause_adv; @@ -1554,6 +1556,8 @@ bnx2_setup_remote_phy(struct bnx2 *bp, u8 port) static int bnx2_setup_serdes_phy(struct bnx2 *bp, u8 port) +__releases(&bp->phy_lock) +__acquires(&bp->phy_lock) { u32 adv, bmcr; u32 new_adv = 0; @@ -1866,6 +1870,8 @@ bnx2_set_remote_link(struct bnx2 *bp) static int bnx2_setup_copper_phy(struct bnx2 *bp) +__releases(&bp->phy_lock) +__acquires(&bp->phy_lock) { u32 bmcr; u32 new_bmcr; @@ -1963,6 +1969,8 @@ bnx2_setup_copper_phy(struct bnx2 *bp) static int bnx2_setup_phy(struct bnx2 *bp, u8 port) +__releases(&bp->phy_lock) +__acquires(&bp->phy_lock) { if (bp->loopback == MAC_LOOPBACK) return 0; @@ -2176,6 +2184,8 @@ bnx2_init_copper_phy(struct bnx2 *bp, int reset_phy) static int bnx2_init_phy(struct bnx2 *bp, int reset_phy) +__releases(&bp->phy_lock) +__acquires(&bp->phy_lock) { u32 val; int rc = 0;