Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2165733imm; Tue, 2 Oct 2018 22:42:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV614AWW0MNj+mvV7AG3F2y3DP3dOmJiE7YkQwCklaMaPHMaCFJPlQmJEco1GGeP15iga1U2h X-Received: by 2002:a17:902:6848:: with SMTP id f8-v6mr20122375pln.27.1538545349189; Tue, 02 Oct 2018 22:42:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538545349; cv=none; d=google.com; s=arc-20160816; b=BHy/ylkTqo0F7BqQKxqO29MhB17DgjD64S/zsyH1xGlv/Q+qcZr7mqYiB46UbBOBIy G1cuKK1wBU5CSBdHO7C2fy3GyGc5U4JAxRxmIQeyKDtgYJrxL1nsf9V3fHye7ch033R1 ETgYtm5l2vKR1UB+b6gfM7fFmhIOweAXFJVKTbfejvK4M7asDR+JTgIocZCfOo23zQ8w dLpqP0A2ez2+D4x3FbvIHF6/jUWEEwzUyVRqHXZ711Z4nBjEepfZzIMIfOEXqlLXJ6VE acFCRxhpPsNC6p0QwvjBGBND7IRMqH1Zksbw29VIjrWsUXZlxktqO/B3njqqZ4c3eWtl e7sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :reply-to:references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rSXE1F6VacTevCbA7egalmTDNA0MErWNqJnY+ifDMwQ=; b=kUueryU21AdAdc3fcP8JDSX6bcF4Q/y1Pzb+6rHW3fxk1qxSLv3rtnN3zAdPTiCT7e vxHmHheOjv1amkoNiCjRIiI+/Ha5OLeWly4PQurkeV8my86CKUp4Izi4vov1GuJfTmH5 oFXbcT7ZPrfZY2HgsnkZU5+Lhk7/AgIsOti2HaBXufrd7UogF/8O4mLxqQdEXGvUVjDa zskHyRsxrZi6BVvp48yEgtqyDWT2fyM0OnuqTVPqMi0THNjPI6dtBQCAfz1tuLVCTqMb g9hAlC4KGGqZL839QnSNdVYdVh9zb3S5zV8SIRYcIhY9BlHsx0T/tw+Xre6N0muOuCDG hXVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jUDXfxVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d11-v6si260406pgg.91.2018.10.02.22.42.14; Tue, 02 Oct 2018 22:42:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jUDXfxVd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727051AbeJCM0p (ORCPT + 99 others); Wed, 3 Oct 2018 08:26:45 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34081 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbeJCM0o (ORCPT ); Wed, 3 Oct 2018 08:26:44 -0400 Received: by mail-pg1-f193.google.com with SMTP id g12-v6so1037698pgs.1; Tue, 02 Oct 2018 22:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=rSXE1F6VacTevCbA7egalmTDNA0MErWNqJnY+ifDMwQ=; b=jUDXfxVdqUFnZtdJAEhM4hzwXAEGFrcxsY6v+9x2o4ijs85qMDop7/69XgOYDFdpVn eKfshoQT4EG4LZQyx443xvkcu61gba0PrvfiN7y13E7BMyDo3aBBsjNpF/BqDwuYqamG Q2C/w4/wKArA5VhGoDxOp5V3N3MpepFyEWbzrcPMjGdLKtDNxG/e3H9T9a3Qa8WY/XfQ 6urXryjZ4fUXgNPvmFtDhmvkEms6rKoazZZQKwt0TljJfUOocSoCFDGxcoiQd2ZekjtV MhR+XXj8j0s0TgoREKHJwZNWmnKLfj1gZRuQ6BVQLqfQsjL3rkjZhsPVB9UaglRwZ+k8 xq0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=rSXE1F6VacTevCbA7egalmTDNA0MErWNqJnY+ifDMwQ=; b=YgKn67XePOuNDxVvnm4MzeDu+5HD/MzDnj+oBFG9Q6LPb6ZsbjXWxtsntEBfOh9wt3 V/lL/s+/BOl5iCrLN9ArouFRElASMd88mhX4MWroKFo1ItlWdBB+VH3w+LxCubdItPZp 2fmICJhAH+BN9kVC8Tt7C7yL1467Czd6FkcOE196xXOBHnYrH9y6gxcaadIoUQ+Q/dum XpL+56wK0voUGslil36/M7H9hAJzTV3AZnhfuilgbVzTRATdgxZHHiYS5GxyWOOIGE+z JTV7C1Yu4uzhdAJwvPScgA0SWL5AP0qxdiejjhaWzq9Ug82zIGxMj2S8tYRHFTXGxAzz nK8Q== X-Gm-Message-State: ABuFfoif+Ao4aqzfB4mw1X44AxheXwB+tzREfU3Xc9BfRP/VKsn7gMKx H5Gs+6gfQyOADUU/G5Q/7is= X-Received: by 2002:a62:8145:: with SMTP id t66-v6mr19285852pfd.192.1538545194832; Tue, 02 Oct 2018 22:39:54 -0700 (PDT) Received: from E570.localdomain (c-24-21-68-121.hsd1.or.comcast.net. [24.21.68.121]) by smtp.gmail.com with ESMTPSA id x69-v6sm499091pff.175.2018.10.02.22.39.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Oct 2018 22:39:54 -0700 (PDT) Received: by E570.localdomain (Postfix, from userid 1000) id 9EEA61643D0; Tue, 2 Oct 2018 22:39:53 -0700 (PDT) From: Lance Roy To: linux-kernel@vger.kernel.org Cc: "Paul E. McKenney" , Lance Roy , Jeff Kirsher , "David S. Miller" , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Subject: [PATCH 05/16] igbvf: Replace spin_is_locked() with lockdep Date: Tue, 2 Oct 2018 22:38:51 -0700 Message-Id: <20181003053902.6910-6-ldr709@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181003053902.6910-1-ldr709@gmail.com> References: <20181003053902.6910-1-ldr709@gmail.com> Reply-To: Lance Roy MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org lockdep_assert_held() is better suited to checking locking requirements, since it won't get confused when someone else holds the lock. This is also a step towards possibly removing spin_is_locked(). Signed-off-by: Lance Roy Cc: Jeff Kirsher Cc: "David S. Miller" Cc: intel-wired-lan@lists.osuosl.org Cc: --- drivers/net/ethernet/intel/igbvf/mbx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/igbvf/mbx.c b/drivers/net/ethernet/intel/igbvf/mbx.c index 163e5838f7c2..a3cd7ac48d4b 100644 --- a/drivers/net/ethernet/intel/igbvf/mbx.c +++ b/drivers/net/ethernet/intel/igbvf/mbx.c @@ -241,7 +241,7 @@ static s32 e1000_write_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size) s32 err; u16 i; - WARN_ON_ONCE(!spin_is_locked(&hw->mbx_lock)); + lockdep_assert_held(&hw->mbx_lock); /* lock the mailbox to prevent pf/vf race condition */ err = e1000_obtain_mbx_lock_vf(hw); @@ -279,7 +279,7 @@ static s32 e1000_read_mbx_vf(struct e1000_hw *hw, u32 *msg, u16 size) s32 err; u16 i; - WARN_ON_ONCE(!spin_is_locked(&hw->mbx_lock)); + lockdep_assert_held(&hw->mbx_lock); /* lock the mailbox to prevent pf/vf race condition */ err = e1000_obtain_mbx_lock_vf(hw); -- 2.19.0