Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85824C636D7 for ; Mon, 13 Feb 2023 09:25:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229951AbjBMJZI (ORCPT ); Mon, 13 Feb 2023 04:25:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229801AbjBMJYq (ORCPT ); Mon, 13 Feb 2023 04:24:46 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1D78BDDA; Mon, 13 Feb 2023 01:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gFeqYOXczwx3CAc2qMLDLlbFrxDEgSjP5KEBsqfU5cI=; b=JJfbRNqykp3u5JZxLoa1Sb6y5s lW+WGSPGaD+NXTBHbLcMRwhcADLsSvMAtIMWiLafYTjxpJrjZIGSUJjFoK2lA3rXmCZxRSmyiPfQU 4XPaF16EQlhBfjdrCsnY9M0asc52iUoF3HyUsF1DxVwjTlEm9/4NDuFFvzFVdJ8jEBXn+usci59nc vIDK9FWG11om3OSpzNNGLqHIsbQxacsH3Qe9Eweh8DBtuQvbP6kf4hXt3Y6JH/xxUrU1J2F3ClF+N eCUGWNpUqJOMGE3Rx6qBXn+BjLks6v6TEecGTuY/s4FM13n4rD+KA+uX98e4OOV5Fs3qE9kaPyT4Z DouLopsg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pRV4K-005btr-9T; Mon, 13 Feb 2023 09:24:16 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A531530020C; Mon, 13 Feb 2023 10:24:13 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 80E8F20C6EEA1; Mon, 13 Feb 2023 10:24:13 +0100 (CET) Date: Mon, 13 Feb 2023 10:24:13 +0100 From: Peter Zijlstra To: Alan Stern Cc: Kent Overstreet , Kent Overstreet , Linus Torvalds , Coly Li , Tetsuo Handa , syzkaller , Dmitry Vyukov , Greg Kroah-Hartman , "Rafael J. Wysocki" , Ingo Molnar , Boqun Feng , LKML , USB list , Hillf Danton Subject: Re: [PATCH RFC] drivers/core: Replace lockdep_set_novalidate_class() with unique class keys Message-ID: References: <52c7d509-ba9e-a121-60c9-138d7ff3f667@I-love.SAKURA.ne.jp> <109c3cc0-2c13-7452-4548-d0155c1aba10@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 12, 2023 at 10:23:44AM -0500, Alan Stern wrote: > Provided it acquires the parent device's lock first, this is > utterly safe no matter what order the children are locked in. Try > telling that to lockdep! mutex_lock_next_lock(child->lock, parent->lock) is there to express this exact pattern, it allows taking multiple child->lock class locks (in any order) provided parent->lock is held.