Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp30638ybh; Mon, 20 Jul 2020 09:35:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi7RoSBrhTNhMZua0TC8VQEL4/oCnESuhDTgr3rr3lvuI9w0aBnbF6mpsNVfyDbeEWIros X-Received: by 2002:aa7:c3d6:: with SMTP id l22mr21987707edr.148.1595262901333; Mon, 20 Jul 2020 09:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595262901; cv=none; d=google.com; s=arc-20160816; b=WtpU1TbYNPAzZw300l3vTWwcNVJJumGqPvaM53Q7LYQMUHzQVBlW/Kj4oE+psJ7P7X 0eUcSW+S+zLJ82ltDSChj/Y0MlRRsW2ED0Jnmv7H2mZwtoRbMK/4gfSPq+l3TMrkPx19 xlEWV1U10nnQJJ2Q1zh7InYuMjht+/gmchKjSkWwv6Dd40Qz6DJ6RjaWm4iKOqHcYa68 ODOnDVFR1sI62f+i0GOzbE9C6meH7r4Gv+ivzEB/c/q4elb1ToISewOTd18naTdX3/GM P0BApbzcksW7dlFzBygQg+uOVgj4qi18Ll4dmH3aK3QQpCRQz3GKpz2n4HcVWnfZGknh BUxw== 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=UdCh///jlT0RZiIkHJUVwUB8C+BRuUOcKKMIEKgcpShul77S6zytXr9m6UT6jwsrFK P+TAwTwQsD8aFRyVPNqA9T4Gdmwa3jMKGUyoVN2uliMcqdYflbEe5JRvKw50LtvpQ43E pVEqmB0zH8DY8gvFwo+Ze+D82AO8MoUo6ulP/AKS7UaY6c0mEAcXNJG75I4c2A0Hn84y AARgr/JsWQnFgOjMBfm66din/n6L5C1dZLcRO70MyiqnbhJD15AoOKhpjCuHqdFwPG6j 6newRncdOG+76sCTTVsqe3FwaO7sgCrt9CVZC1zSAB1TtfRfA2uo8AhNdskOJ2Xcu2es 2zHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=vglMCEkJ; dkim=neutral (no key) header.i=@linutronix.de header.b=WpXgsBkD; 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 s15si10903862ejc.7.2020.07.20.09.34.37; Mon, 20 Jul 2020 09:35:01 -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=vglMCEkJ; dkim=neutral (no key) header.i=@linutronix.de header.b=WpXgsBkD; 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 S2388929AbgGTQdE (ORCPT + 99 others); Mon, 20 Jul 2020 12:33:04 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58808 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731799AbgGTP40 (ORCPT ); Mon, 20 Jul 2020 11:56:26 -0400 From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595260584; 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=vglMCEkJnKDV9C9gl5yiBKv0rsKn11X9rca8Uhpd3/JzUjkB47eLDwg6mZl97/X2A2NMnG V3ZDjFK4/lRiCusV+cMPKqzQOtUdVfXa374NtTVhr4TC7kdylQPMhRZvfcx3ao+ZmoGmjM tSNqPKvU16oVkHkVxg7PsrRsKb0J4KJUB+4M2pX2shxzzI9kgesqHEMJOtaCcBzDZTTbCB BBazox5RJdIF/VstuK9W8fGJbuIjb23AHo1fhai95H8qNCsH5tCz0W4P6VbWOSbDLvvFpb J8D8lB47W1gTIkkdxD/OGSXo4kmGYVEqmxxstrwZexLx4wyuH3AO4JupskwSGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595260584; 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=WpXgsBkD0uNt1Rx2RbQ3QwKmY4xJgRuU8KSbTtQiQUGfnAxseItKzSI6FvDBIRrtttKqbN PUR+FecPEzFoL8Dw== To: Peter Zijlstra , Ingo Molnar , Will Deacon Cc: Thomas Gleixner , "Paul E. McKenney" , "Sebastian A. Siewior" , Steven Rostedt , LKML , "Ahmed S. Darwish" , Daniel Vetter Subject: [PATCH v4 11/24] dma-buf: Remove custom seqcount lockdep class key Date: Mon, 20 Jul 2020 17:55:17 +0200 Message-Id: <20200720155530.1173732-12-a.darwish@linutronix.de> In-Reply-To: <20200720155530.1173732-1-a.darwish@linutronix.de> References: <20200519214547.352050-1-a.darwish@linutronix.de> <20200720155530.1173732-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