Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp36365ybk; Tue, 19 May 2020 14:51:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJAruqry55w/qsXT0KKTv3ol3nZ3ehcm35u8u8ftPvC7dOc2zYFCBkNBLDmzzXyosAu3c0 X-Received: by 2002:a17:906:1443:: with SMTP id q3mr1110301ejc.325.1589925076335; Tue, 19 May 2020 14:51:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589925076; cv=none; d=google.com; s=arc-20160816; b=b/nV/NJ7vBoZT1P7rW0HvS++dGCwwCB473cm5WkXPcp3QLuMQZdUwaxyFCZyWwiO4A b+7/sJxFQUqC3PAAbfW5coLRf6jr9unuyFh6D2Ednn8UXvRfu8j8iTb2qc9oY7gv//1k zdMT0kS5xmigHA8gH0rkXLBZBgTNcZEmBItyDBoiWXiyoPWDpu8CDa3gG0DhAGNkPd3r p6jtglAqJldl9smv5yFUw+onklgTjQg8IXHdbQ5Oic5bcqoeB5T6Fscf0Yh2sgZ1Rtdh hb4KJvRsPOOiZjJoSZMp8a8/HygNns6L3+TxX96W6ITBMl7fmdNNE1eNKC+IzvW+RvJ2 P44g== 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=cF2x3sY0BCgyVDI2MiFY+1d/3C8IdOG5AAIXas47AzY=; b=RKPAxRqaC+i0xabVSeCNGFYv5q7VDUSCym9HZ+5WulkKGzjke899HzgLD0iI3ntksw 0emoRN3Xmi4rypA5+joxpUM5h0pKSatyPcsWYfvnRA6Y2N2XK2WEkAvjux5zEgWz4l9i PTsvBDEzANMEForbuHFNgKfaAh07IytQUc2xyOj9xhla7DZ9uDVJg8+/KmK/Dq5sELl8 r0Ut6WrYQUBQHsSpHMY//FzC0OQNEzrboOT9Uoh3hDwkz+Sio4zdNQ0j+RoxkbniDyNc BHoIeLs+ebSgH6Zn29ql/BmqXBSz6vTWOAeET0UtAr1Nvz4DAzo8BM/Cwz8m2sO3c/Up OYZg== 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 b102si350186edf.194.2020.05.19.14.50.53; Tue, 19 May 2020 14:51:16 -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 S1728649AbgESVs2 (ORCPT + 99 others); Tue, 19 May 2020 17:48:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728255AbgESVqz (ORCPT ); Tue, 19 May 2020 17:46:55 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 006D4C08C5C3; Tue, 19 May 2020 14:46:55 -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 1jbA42-0002dr-Ph; Tue, 19 May 2020 23:46:18 +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" , Sumit Semwal , David Airlie , Daniel Vetter , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v1 06/25] dma-buf: Remove custom seqcount lockdep class key Date: Tue, 19 May 2020 23:45:28 +0200 Message-Id: <20200519214547.352050-7-a.darwish@linutronix.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200519214547.352050-1-a.darwish@linutronix.de> References: <20200519214547.352050-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 --- 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