Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1171799ybg; Wed, 29 Jul 2020 07:35:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDBBnnnaqvkZAynenY7Ra2yRb54n+ecG9kh/qE3EpQdKjDRnskBg6SwJfMJGMOFEfmLE8a X-Received: by 2002:a17:906:2a5b:: with SMTP id k27mr30175356eje.82.1596033347949; Wed, 29 Jul 2020 07:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596033347; cv=none; d=google.com; s=arc-20160816; b=BxIyr939Zz3PpI7zN0ZJUnd4nNOgbFRIVHybslp+GJR9nl34v3aFVPSaaTjXDYYi5J MfS2sFm28BAjCwYOGtvqaL+9Pk98mvmG+MTT5JPlwid6E8mmC3diUY8HVu5trRjoE6zU kZyAj26r5ego9aiVlNTgxO32fBlEQxta06dmsPcQUoaoQ58ZdB7HjahlP9V1voKmYk5K jQx4mdfxO32In0Fw6uhp7ifPzpL45qZOxevFCbkGuHgFgQgwSbDcmTZMEkOycgImsFQc UCYJON0BjhxEn+9M+kUV7fFnl7uUsyw/vmyHygILxV3MSOPRUA8bdD9jIOD6A317qykR 5A1A== 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 :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:dkim-signature :dkim-signature:date; bh=i3kZYEXD09ZkAvbgWwq9AHUVj6gmkSIz2Tqokc9cvaQ=; b=VhtFcwlx7rOz0615M8uk6bHYCHtuZzrQtJVAUKGOeofL7A2/lN9uLcEZNxdXB+YZMC t/EmCYCVo7EXsz0aeKo6gWWoaX1B351eK/aAgjCD3BM5CoEZFOlMbT8zmP8lQO0ShKVx ISnLouV5ZwCcV9ear0iW+S5NtbWknl86E8Yt4Eqh08cpNQ7oxq8XbsLx3nh+0++sQE5L dkRz2Eimz2lUj0Uw0AdlnC6lQcb4Z0BsHaqTbdbbzsP5xzNUFNl754qCkBN6e32MccZZ 5uxwfWFRkeVZdM5tRuNrR7anyr+wzdKnQKC0qZIRn2xi9VRVJSPTmIt6xJO1+MLiQGGB lVgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=clhY5Xfs; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e header.b=Fj9eLbBn; 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=fail (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 lw6si1334759ejb.506.2020.07.29.07.35.25; Wed, 29 Jul 2020 07:35:47 -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=fail header.i=@linutronix.de header.s=2020 header.b=clhY5Xfs; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e header.b=Fj9eLbBn; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727977AbgG2Oee (ORCPT + 99 others); Wed, 29 Jul 2020 10:34:34 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:42998 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbgG2Odi (ORCPT ); Wed, 29 Jul 2020 10:33:38 -0400 Date: Wed, 29 Jul 2020 14:33:35 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1596033216; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i3kZYEXD09ZkAvbgWwq9AHUVj6gmkSIz2Tqokc9cvaQ=; b=clhY5XfsMV2DtOM02605cuD2eamuKR1z/v3VnoYsVVmT/VTRvHJmBSgpo2Ca+NIVDiTj9n UzRiIIEya/8CBHVms/RG6covjfwJ7dLpzbJI3aQtrp88IarS+W5yVOWqg7tilZc7dAYm/O D53B5fglxXNF/1CoF2Bb2nY9tgKYWZ4p4cIGoLc2/32HLPB8DyDvUBOXVUsxpNLKQO/Gc4 jsyUDSVmMKTtRk6qLGib/UBEu3pvs+vDE3UyeQyv9bbcLUTgH7tmGWt/7+a5rFvwpQLZ4k x9M4b1cKwJWHXyZaZYmYG49kx5AfF5Moz4qA9EJhHlw/KjzMQS0/VLkuo4i3Nw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1596033216; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=i3kZYEXD09ZkAvbgWwq9AHUVj6gmkSIz2Tqokc9cvaQ=; b=Fj9eLbBnf9J+CHn2EvM1lsYxHMbweFL50TKjY4tZYt21K4cZ+kyqQpiR8AXOKuonDibkjb EprNpcAKPMvWFHCQ== From: "tip-bot2 for Ahmed S. Darwish" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] dma-buf: Remove custom seqcount lockdep class key Cc: "Ahmed S. Darwish" , "Peter Zijlstra (Intel)" , Sebastian Andrzej Siewior , Daniel Vetter , x86 , LKML In-Reply-To: <20200720155530.1173732-12-a.darwish@linutronix.de> References: <20200720155530.1173732-12-a.darwish@linutronix.de> MIME-Version: 1.0 Message-ID: <159603321587.4006.6439425506446476952.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: 318ce71f3e3ae4108c1665f3860afa8a2a4c9f02 Gitweb: https://git.kernel.org/tip/318ce71f3e3ae4108c1665f3860afa8a2a4c9f02 Author: Ahmed S. Darwish AuthorDate: Mon, 20 Jul 2020 17:55:17 +02:00 Committer: Peter Zijlstra CommitterDate: Wed, 29 Jul 2020 16:14:25 +02:00 dma-buf: Remove custom seqcount lockdep class key 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Sebastian Andrzej Siewior Acked-by: Daniel Vetter Link: https://lkml.kernel.org/r/20200720155530.1173732-12-a.darwish@linutronix.de --- 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 b45f851..15efa0c 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 ee50d10..a6538ae 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