Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp480466ybl; Fri, 23 Aug 2019 03:56:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxD+7or40MrHFxo062Fp409my1Cn+3x4HrZ2lce3Blc2RPnGodSG+rHv6YuC0iuECDds8mW X-Received: by 2002:a63:de4c:: with SMTP id y12mr3504307pgi.264.1566557761804; Fri, 23 Aug 2019 03:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566557761; cv=none; d=google.com; s=arc-20160816; b=j7riUkO41aSZ9oQPm5oabfi4dJd7wYOcuI4yVc1Ol8n/rQO0nyzyimSjLv8jeXzpZw himvQUsNFgrITz7+/DiSn2tRw2PlCG2RncFw/lh2h53MotPctq2TIkphRj0a6ymT8eW6 AmenwwtaiK6p24lz/kTmHI4IzVGRSALOKQFx4gyq7jQKmyIdBRbGbActq+/cRogAmXUe pJa40fgaUOCr8CBqyc+ZoRDbe0pFoiAp2eMVAZcY1O/s594sOXdx6NKx75k853pAkmsB XP+cRA8AjgMoiYTLZZzABTlPpHA4vS7p6/uC6KCNhXlwr6qia+R14ICjA6e3ZwWQLUhN 42cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=L/vkdcP05JWhGYT6635EGSEpeSPBO2zNysiTmrxCkEw=; b=wLO0xG1VhTKtPRCCHeushrs2tf7d4Lx7ZlHJCOIhheTB8DfmbdUF1QzXSy7zOnmCCD /pY9Hqd3QsG5nsA0IYil17Rj0t0D8Qeo98vo7+Obu+oDXDCatSYGy9/XysVxI5OCsqMz TTz47l1bxwDRtIWYamRc0/JV4f/XCQ4qokzaH41lRf61tMuIHtQAg5u5AKpHhgA7Tqok areK9P7tA6nx5MqLsy9jXC3LpFljNVQrkTVvPg4y8KhCEqUDtJSEAtOsA9hxQYOvQsW6 WuNO5IUlSApv7UQMwNkFjRLwJI37qAmz+XgbjMLSSoq9rXQ0+qO8ytOr5FhErb/5uTBg TbhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=B6fmBKNR; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ay19si2080867pjb.44.2019.08.23.03.55.46; Fri, 23 Aug 2019 03:56:01 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=B6fmBKNR; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393055AbfHWItX (ORCPT + 99 others); Fri, 23 Aug 2019 04:49:23 -0400 Received: from merlin.infradead.org ([205.233.59.134]:36254 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732418AbfHWItX (ORCPT ); Fri, 23 Aug 2019 04:49:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=L/vkdcP05JWhGYT6635EGSEpeSPBO2zNysiTmrxCkEw=; b=B6fmBKNREv3wbYVEJbZKMQylr 2QE8UM9F6/Eu480sbXo3kKT1SplNa1HQWh5VdAw1Ka1+0ZFxIqOGOK/ztOA+4XWWiO16yLgmfvCgr 5jWDafwbqh+r4doQ1z9eNSBwZUQ590qOP6xjoRDsaRO/9+XsBOkgmtch16YsU48DjLXG6m8GxfXOa PaN1jnGH90cm4drdC3HyCDBY9PGmzmNeIhjN4RDEsnjl7Narv3X0ej9AzM6TWE2TdoC0B7LbQNVjV 5FcaVV12fLFnfP4v4dR0/ZWhbV2MnChzI8s2cFVH/39hgE+ihzJUqdhlv15hHMaEQhq6ztLoAjZCT EkYmJapIg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1i15Fx-0007QZ-Ip; Fri, 23 Aug 2019 08:49:13 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 69D73307510; Fri, 23 Aug 2019 10:48:39 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CCFF620A21FD2; Fri, 23 Aug 2019 10:49:11 +0200 (CEST) Date: Fri, 23 Aug 2019 10:49:11 +0200 From: Peter Zijlstra To: Daniel Vetter Cc: Intel Graphics Development , LKML , Daniel Vetter , Ingo Molnar , Will Deacon Subject: Re: [PATCH 2/3] lockdep: add might_lock_nested() Message-ID: <20190823084911.GE2369@hirez.programming.kicks-ass.net> References: <20190820081951.25053-1-daniel.vetter@ffwll.ch> <20190820081951.25053-2-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820081951.25053-2-daniel.vetter@ffwll.ch> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 20, 2019 at 10:19:50AM +0200, Daniel Vetter wrote: > Necessary to annotate functions where we might acquire a > mutex_lock_nested() or similar. Needed by i915. > > Signed-off-by: Daniel Vetter > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Will Deacon > Cc: linux-kernel@vger.kernel.org Acked-by: Peter Zijlstra (Intel) > --- > include/linux/lockdep.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h > index 38ea6178df7d..30f6172d6889 100644 > --- a/include/linux/lockdep.h > +++ b/include/linux/lockdep.h > @@ -631,6 +631,13 @@ do { \ > lock_acquire(&(lock)->dep_map, 0, 0, 1, 1, NULL, _THIS_IP_); \ > lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ > } while (0) > +# define might_lock_nested(lock, subclass) \ > +do { \ > + typecheck(struct lockdep_map *, &(lock)->dep_map); \ > + lock_acquire(&(lock)->dep_map, subclass, 0, 1, 1, NULL, \ > + _THIS_IP_); \ > + lock_release(&(lock)->dep_map, 0, _THIS_IP_); \ > +} while (0) > > #define lockdep_assert_irqs_enabled() do { \ > WARN_ONCE(debug_locks && !current->lockdep_recursion && \ > @@ -653,6 +660,7 @@ do { \ > #else > # define might_lock(lock) do { } while (0) > # define might_lock_read(lock) do { } while (0) > +# define might_lock_nested(lock, subclass) do { } while (0) > # define lockdep_assert_irqs_enabled() do { } while (0) > # define lockdep_assert_irqs_disabled() do { } while (0) > # define lockdep_assert_in_irq() do { } while (0) > -- > 2.23.0.rc1 >