Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6228323rwb; Wed, 18 Jan 2023 02:47:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtUBI10HgffPPSf9BXif+QYll1mC6BVRsARlBngknHw8X786yMB7suIGzNfmvPJUflUGPVy X-Received: by 2002:a17:907:2392:b0:86e:c9e2:6329 with SMTP id vf18-20020a170907239200b0086ec9e26329mr6149195ejb.12.1674038840783; Wed, 18 Jan 2023 02:47:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674038840; cv=none; d=google.com; s=arc-20160816; b=M5XSAAzExRKmY3qAtoA9+qRrRfYJC/UHIUZISAfEpHsZ4uGvTXsiJAEPsVSmqzA5id Imfy/keqWUkob2cjiSr52hE05cVEjnC+7FVBwjeb6IsdKdtS2kPq56oBiUnDJeuEz9rw XtOXhieMLfbK9NBwEOXgC57jHWtPpEmVQmJHoChaJxwSDcrzW5p7dhWSyTjvEExyOLzc FPOcwptscRRfvoZgB9Y18pm1ZH5TGPbK9qaTGZWWYIbJgC48kI3zqpcsOxQoeYw03phg x2K1KnykRgrwdjMmXNKCnMoILbzqWYWEJXkXwUhBEknHPepOPslhILRhdYKvUPyY1WLg ZXIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=HMXsQkM11JBu4yNkld1rbPMwtTN1359FT7PhUeSMdvo=; b=yZUYziQBSAXpB0eT5Rjst5YAZxqM31PXFapKjVySigoiOv0WcxumBRopfdPyVcAWeP VLug9G6VsTs9brHTqJXjTaY6HCAehxyT/6viFqMZPWCFRBRMBWoA4oeRTx9xR9CUJmIA VnJefJmwmvfLki8bM/GshAtN3v1xt/dKWtEKx0DL1ELgHyeIMGoTpSS3S+tsVtomx5+S sqtd2R8XO9cKrTd7Qy3GgaEg0FYBfrprf27ygEk6DBe/23vsYOf4VliBAz7qUWk2XCg3 TcVnIXCTHXFZq3JVEqjdtN2qK1catKf5n0lMZDXziTwTe6k4U0mG8T0aRhINVP8yzzA9 2RDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kQ7ipcJn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk11-20020a1709077f8b00b008711359b93esi9178491ejc.250.2023.01.18.02.47.09; Wed, 18 Jan 2023 02:47:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kQ7ipcJn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbjARKPk (ORCPT + 46 others); Wed, 18 Jan 2023 05:15:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230218AbjARKNX (ORCPT ); Wed, 18 Jan 2023 05:13:23 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BD905955F; Wed, 18 Jan 2023 01:22:03 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8EE18616ED; Wed, 18 Jan 2023 09:22:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6099C433F2; Wed, 18 Jan 2023 09:22:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674033723; bh=DZS895Z+3sptXir0tPzxTsJKKkNp6DzwiYVTcI+Nxas=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kQ7ipcJnCrbNJpn/1LWq84GZ6TR5qt3+KUz1dTKkr0XakM13mE2CdJADXrQLKwcR6 /Y3Z9lMY/yyTr/h9ZUnaD8+HXWyOE5ECHRk5Ms4N/Ok8HHvwCpTGqhjRA0VIalsHhM Me7LShijNUwJaJ0wWn8jIkIIhcRWdLmHJ1kRfvMXLLv6X71hv3leQfEbYu6u3h9QRe CgT19EWFPvSX+s3slPUT+xSyveq5YOLXegUVs4z8Ti9TPBsI0yH1Rys/JCC1QfWt8t ughKXZz3GlLkly1qj6aT0KSqaw88dFUiVD4evJ91gGUyuExYpTAmMoCAcYMW+RlnUq AdP1+leZLv+ng== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pI4eI-0001cJ-FS; Wed, 18 Jan 2023 10:22:27 +0100 Date: Wed, 18 Jan 2023 10:22:26 +0100 From: Johan Hovold To: Thomas Gleixner Cc: Johan Hovold , Marc Zyngier , x86@kernel.org, platform-driver-x86@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Hsin-Yi Wang , Mark-PK Tsai Subject: Re: [PATCH v4 06/19] irqdomain: Drop revmap mutex Message-ID: References: <20230116135044.14998-1-johan+linaro@kernel.org> <20230116135044.14998-7-johan+linaro@kernel.org> <871qnslut3.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871qnslut3.ffs@tglx> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 17, 2023 at 10:23:20PM +0100, Thomas Gleixner wrote: > On Mon, Jan 16 2023 at 14:50, Johan Hovold wrote: > > The global irq_domain_mutex is now held in all paths that update the > > revmap structures so there is no longer any need for the revmap mutex. > > This can also go after the 3rd race fix, but ... > > > static void irq_domain_clear_mapping(struct irq_domain *domain, > > irq_hw_number_t hwirq) > > { > > + lockdep_assert_held(&irq_domain_mutex); > > these lockdep asserts want to be part of the [dis]association race > fixes. They are completely unrelated to the removal of the revmap_mutex. No, they are very much related to the removal of the revmap_mutex. These functions deal with the revmap structures which before this patch were clearly only modified with the revmap_mutex held. The lockdep assert is here to guarantee that my claim that all current (and future) paths that end up modifying these structures do so under the irq_domain_mutex instead. > Your race fixes change the locking and you want to ensure that all > callers comply right there, no? I want to make sure that all callers of these function comply, yes. That's why the asserts belong in this patch. Johan