Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3998625ybg; Sun, 7 Jun 2020 18:00:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyo9hgSoXIir8EDgdA77J74coimaLsCnjTAlwkvsKrTFicT4113dwgnLTzTC8dNdvkGd7iz X-Received: by 2002:a17:906:6d4b:: with SMTP id a11mr19647901ejt.108.1591578021357; Sun, 07 Jun 2020 18:00:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591578021; cv=none; d=google.com; s=arc-20160816; b=dIZEKTnU+SO/R5AkXo64CxlgTPzOS6TNjPEQsi95aNa05W9sUQZUYWhjQgrl0EnObT h+e2js7tMQ9KWvFb6oJpQKLgxqbFbkRW1MhRrBIIYDXSeb+hZi7FBTh89jyGRMFEcMWx CdxmtjlNlszxZdoeU150MPAfs+NhT/5qJWbGYYnkEzLofpzBgGsWiFeJLyPRadALPeVw TejxuAz5U8TjFR02y4al/53HPmhuV5mASBLll23la58D1AxuTnDIYVccwY09bFsMehWe Cjvbm772ErJHgNJGEbl9TDBydBx6XgMluzHVm0lH6BcqP5LDTYqvMZdLUqvpWrGIcR6m xXOg== 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:from; bh=wTOOWgr0j+14HGPYefJ5v3Bp+01eD9fMWU6TUa97nS8=; b=jdzRJUft0DG81by17pXJCsPZaKeCAOR9+jG6mM4u+HhpKQ38BvZdwCISoCGmEUU9qH bhCcXHdt0J9/doHxpHIbIB557pUbiffIiECJrh167MUti0iU6+Vzuo8Fn4SeVlzvY5+q wuIEmfRrNTXHKLjXCr7qCYiqhcakkFafwbxr2XBEz9QmZwsRlPpoUZ7F8hCSNa/EPMe3 MYaspUjIkxgbjAmip+5MnISDIYk74njhApCCcDc2O9BNs+qeXVQoNZQV69kRnYZzhHmu TaJ/+nUgtmZvi5m0vLJFjMdZd2PwEWZSVbKkWLw9J0uQcILAiwOUA5PeSn1mSch9V6xt ftWg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f20si7979471ejx.646.2020.06.07.17.59.59; Sun, 07 Jun 2020 18:00:21 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728630AbgFHA6E (ORCPT + 99 others); Sun, 7 Jun 2020 20:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbgFHA6A (ORCPT ); Sun, 7 Jun 2020 20:58:00 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0DCAEC08C5C4 for ; Sun, 7 Jun 2020 17:58:00 -0700 (PDT) Received: from [5.158.153.53] (helo=debian-buster-darwi.lab.linutronix.de.) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ji66t-0000mQ-7v; Mon, 08 Jun 2020 02:57:55 +0200 From: "Ahmed S. Darwish" 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 v2 05/18] dma-buf: Remove custom seqcount lockdep class key Date: Mon, 8 Jun 2020 02:57:16 +0200 Message-Id: <20200608005729.1874024-6-a.darwish@linutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200608005729.1874024-1-a.darwish@linutronix.de> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200608005729.1874024-1-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 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 4264e64788c4..590ce7ad60a0 100644 --- a/drivers/dma-buf/dma-resv.c +++ b/drivers/dma-buf/dma-resv.c @@ -50,12 +50,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 @@ -134,9 +128,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