Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3314357ybt; Mon, 29 Jun 2020 22:46:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPuLSMefmybJFSdLTYBtER8+m97fLYpNboNY8xuR0XD0HUtoea7DCgitYczbiUhfx48SLn X-Received: by 2002:a50:bf4c:: with SMTP id g12mr21551791edk.203.1593495993765; Mon, 29 Jun 2020 22:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593495993; cv=none; d=google.com; s=arc-20160816; b=cszZhvdhwr4Rk5/QCQVRznJYgXaXYFYtegeS1s7yvKHqf4UGhIG8Uswe3ipHPIV+Wj N2KtWjg9z0iGOP0mYp69SK8RcNeGQaCJoyq4sDAEpumeATX3ZY7wlBBome4ecalruhJy cnTSPK2SpHZt3WiRUnPK3yEIxmyS1Q0MGLz40cywLuE7uoenBPhK2Dwv1HAKqzMa2P5d wq5RSpl2pYWEEWW1KCdyI1zdy2dZVtg5NFV6huGEKW5BK3jZ2MdbupXhAPkeI6+1Mgs5 q7JNsEuXUMLRLOhNWUm9Uemv7x96z1HVy3FmJTzOQT4r6Spz7sUTktSUIpGKehHhUWC4 3oew== 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 :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=0LvtODdt/qpdhh8rPzhryXa7h9i3Brijmjrucqb9JZE=; b=kD2lnNUCVfZbBvGk2ZSrAIXc/t05uJApgYBq5z9LuLMYlT//YgWocpkKHxKOgFHcq6 K3KaKGubopa4Vz7Uw2ouIFQulOjm6IjNCvOFwhJWv3GyHIDn7iShIhveJrqUhv4mLE8L 6dxPzwidccL+PTWmGzxBAJquXlArqJbAl3f6K/cfJCmO3r1+JpukgXXLgg+Et93p3DFQ KkWOwPMFe+iheLjqPb6Ch//JbLGyc/WN7SN2EW9tEwVTRNqW+4B0VXfBpKqlQDdVqpip 4w/XNk7RFvNOq8BhRyYOJUS6bKjyCpV2LIib55WibljK4dYTDIkplAS/COuYO9sw13B4 d4dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ieapcwO9; dkim=neutral (no key) header.i=@vger.kernel.org header.b=EACQwdMu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b19si1068456ejv.524.2020.06.29.22.46.11; Mon, 29 Jun 2020 22:46:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ieapcwO9; dkim=neutral (no key) header.i=@vger.kernel.org header.b=EACQwdMu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729842AbgF3Fpb (ORCPT + 99 others); Tue, 30 Jun 2020 01:45:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729615AbgF3Fp3 (ORCPT ); Tue, 30 Jun 2020 01:45:29 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72068C061755 for ; Mon, 29 Jun 2020 22:45:29 -0700 (PDT) From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1593495925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0LvtODdt/qpdhh8rPzhryXa7h9i3Brijmjrucqb9JZE=; b=ieapcwO9vL9rn9zROuyYxUPIJUiRC6AjkM7xmqQebae80orrHUFdbI8WS6Uh4hieCsDSTz gTFYKAThZZbPkFld1x/495ZO4J6TbJjFrM4RQtw8IBphmYUA5P59pcZL2PCo3kdMCb9Jwd zJq4ejF6DJ22Q6YuAnruBK+a0DrYgzl/9z1b2vpFbg9K/Vnfs8qu+z7ueINmkbj3xmAYz/ SGl7U0jR53Useq/1f5Qw3o2FhiaRk6bSY6bXtumtsC0lCsDRpmP8ojvgNuSN94weQHLD7V z5G0a2Nc1x5lBW5SAZKhRcWpXbroZDMnu0OlP/3m4bAAaAsrWQCcEciLWM/wQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1593495925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0LvtODdt/qpdhh8rPzhryXa7h9i3Brijmjrucqb9JZE=; b=EACQwdMuBBvXQvar78kldgLcsIwIwnqUulR+VSBpsEYu0AiFsbeiBA1LdxldGUP/k8sE0l h6TUfcFB0yEdVhAg== To: Peter Zijlstra , Ingo Molnar , Will Deacon Cc: Thomas Gleixner , "Paul E. McKenney" , "Sebastian A. Siewior" , Steven Rostedt , LKML , "Ahmed S. Darwish" , Daniel Vetter , David Airlie , dri-devel@lists.freedesktop.org Subject: [PATCH v3 07/20] dma-buf: Remove custom seqcount lockdep class key Date: Tue, 30 Jun 2020 07:44:39 +0200 Message-Id: <20200630054452.3675847-8-a.darwish@linutronix.de> In-Reply-To: <20200630054452.3675847-1-a.darwish@linutronix.de> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200630054452.3675847-1-a.darwish@linutronix.de> 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 Commit 3c3b177a9369 ("reservation: add support for read-only access using rcu") introduced a sequence counter to manage updates to reservations. Back then, the reservation object initializer reservation_object_init() was always inlined. Having the sequence counter initialization inlined meant that each of the call sites would have a different lockdep class key, which would've broken lockdep's deadlock detection. The aforementioned commit thus introduced, and exported, a custom seqcount lockdep class key and name. The commit 8735f16803f00 ("dma-buf: cleanup reservation_object_init...") transformed the reservation object initializer to a normal non-inlined C function. seqcount_init(), which automatically defines the seqcount lockdep class key and must be called non-inlined, can now be safely used. Remove the seqcount custom lockdep class key, name, and export. Use seqcount_init() inside the dma reservation object initializer. Signed-off-by: Ahmed S. Darwish Reviewed-by: Sebastian Andrzej Siewior Acked-by: Daniel Vetter --- drivers/dma-buf/dma-resv.c | 9 +-------- include/linux/dma-resv.h | 2 -- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/dma-buf/dma-resv.c b/drivers/dma-buf/dma-resv.c index b45f8514dc82..15efa0c2dacb 100644 --- a/drivers/dma-buf/dma-resv.c +++ b/drivers/dma-buf/dma-resv.c @@ -51,12 +51,6 @@ DEFINE_WD_CLASS(reservation_ww_class); EXPORT_SYMBOL(reservation_ww_class); -struct lock_class_key reservation_seqcount_class; -EXPORT_SYMBOL(reservation_seqcount_class); - -const char reservation_seqcount_string[] = "reservation_seqcount"; -EXPORT_SYMBOL(reservation_seqcount_string); - /** * dma_resv_list_alloc - allocate fence list * @shared_max: number of fences we need space for @@ -135,9 +129,8 @@ subsys_initcall(dma_resv_lockdep); void dma_resv_init(struct dma_resv *obj) { ww_mutex_init(&obj->lock, &reservation_ww_class); + seqcount_init(&obj->seq); - __seqcount_init(&obj->seq, reservation_seqcount_string, - &reservation_seqcount_class); RCU_INIT_POINTER(obj->fence, NULL); RCU_INIT_POINTER(obj->fence_excl, NULL); } diff --git a/include/linux/dma-resv.h b/include/linux/dma-resv.h index ee50d10f052b..a6538ae7d93f 100644 --- a/include/linux/dma-resv.h +++ b/include/linux/dma-resv.h @@ -46,8 +46,6 @@ #include extern struct ww_class reservation_ww_class; -extern struct lock_class_key reservation_seqcount_class; -extern const char reservation_seqcount_string[]; /** * struct dma_resv_list - a list of shared fences -- 2.20.1