From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B782C05027 for ; Thu, 9 Feb 2023 13:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dmV26zn8qewPYWdGJ0VjL2eZyrdgjeKL3roqpn+O+4k=; b=YywLYpuc2WfZNX tPFVNoFL+1Kf/425P7hZFPf9cQX+8/iMpKHjWzXnFtx/ppVW2+j9HXqKMUI1LKZqxPhcBWDLGr67M huXhAkBxUhKngwX9ugEDHY1WAkRZ8QkoZjSaO9Mf3HxAfGBhFvxVUUQBOrCG7wedj35+pHUixk1AE nJKCrRviv4upa4JO8vM/TdXYHqhIxt1cCR03HFlha+ctr2SdSKK9IFgMAU1OMMs0C+LAvZpPxygY9 wxS6frlla3YXoPrjs41A+g3d84vmW03h4ExRE2fXHL/GOCRKG/Xu22wikf983JWdHn44U5M7Bh5m/ VuZohLziV+rLWNo6p7zA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ6Wi-001aHK-Ri; Thu, 09 Feb 2023 12:59:48 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQ6We-001aGA-Vf for linux-arm-kernel@lists.infradead.org; Thu, 09 Feb 2023 12:59:46 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 6CA5EB82073; Thu, 9 Feb 2023 12:59:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14CD2C433D2; Thu, 9 Feb 2023 12:59:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1675947582; bh=ueSbzbCgVSLYf9tlzKphbkF8Np2IEsOAlfnOzU+6UYY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EOc+j1ULKe63GU4YvUl0yQ8bwgBE+7iwrHHEvKuBw8MujB+tpgtKUBpHDPA1bPpSl SW3x9IMWqIraRRZLEPtbeNS28PM5edk7e7+Pk5pTra9igPlkodT8v1m0EYDmNNSXbi CHqcSozPpQainIemp1Vbh97AGqQWlzCxCi+Jy7pPjJdfYVjlwkvedW6YlQ33ZFJKGs LwLXGwN6FCmFPCovq+2ScjoWz/mDIY/HxX0yU7XthFXo2yf1HTjBZnuImZgwfcUB8f VvByTdpLcZfrHuwXlzvnLBId6YQaYSKVzd0CbpIqwrpYFMuGdZXnScG+aQ0mXLvcoa khCs8I7+tJEYA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pQ6XE-0001F4-8c; Thu, 09 Feb 2023 14:00:21 +0100 Date: Thu, 9 Feb 2023 14:00:20 +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 07/19] irqdomain: Look for existing mapping only once Message-ID: References: <20230116135044.14998-1-johan+linaro@kernel.org> <20230116135044.14998-8-johan+linaro@kernel.org> <87wn5kkfqo.ffs@tglx> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230209_045945_347334_8A9A0C9E X-CRM114-Status: GOOD ( 29.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 18, 2023 at 10:26:16AM +0100, Johan Hovold wrote: > On Tue, Jan 17, 2023 at 10:34:07PM +0100, Thomas Gleixner wrote: > > On Mon, Jan 16 2023 at 14:50, Johan Hovold wrote: > > > Avoid looking for an existing mapping twice when creating a new mapping > > > using irq_create_fwspec_mapping() by factoring out the actual allocation > > > which is shared with irq_create_mapping_affinity(). > > > > This changelog is incomplete and it took me a while to figure out why > > this is before the race fix. > > > > The point is that you need __irq_create_mapping_affinity() later to fix > > the shared mapping race. The double check avoidance is just a nice side > > effect. > > > > So please spell it out and make it clear that this needs to be > > backported too, e.g. by adding: > > > > The split out internal function will be used to fix a shared interrupt > > mapping race. This change is therefore tagged with the same fixes tag. > > > > Fixes: .... > > Sure. It was originally part of the fix of the race, but I was told to > clean up the code first (and not worry about backporting). > > I'll see what I can do about reordering these again with the aim of > making things easier to backport. > > > > +static unsigned int __irq_create_mapping_affinity(struct irq_domain *domain, > > > + irq_hw_number_t hwirq, > > > + const struct irq_affinity_desc *affinity) > > > > Please rename to irq_create_mapping_affinity_locked() so it's clear what > > this is about and what the calling convention is. A lockdep assert to > > that effect would be nice too. > > Will do. Actually this cannot be done as part of this patch as the function is still being called without the lock held until the actual shared-interrupt mapping fix. I have a vague recollection that this was part of the reason I went with the double underscore prefix. I'll rename the function using a __locked suffix as part of the race fix, but a lockdep assert feels like overkill here as this static function is only in two places where the lock has just been taken (and the asserts in the revmap helper will eventually catch any future hypothetical offenders). Johan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel