Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5524635rwb; Tue, 17 Jan 2023 15:11:24 -0800 (PST) X-Google-Smtp-Source: AMrXdXviVxJbj3bgzc32njB29fWesHPLDnaAwYcYgD1JCz1XT9ou3EUDw9dMwlIU5Ez75rY6rA3q X-Received: by 2002:a05:6a20:8e05:b0:af:ae14:9ecb with SMTP id y5-20020a056a208e0500b000afae149ecbmr7401833pzj.17.1673997084126; Tue, 17 Jan 2023 15:11:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673997084; cv=none; d=google.com; s=arc-20160816; b=wYZgZeHOdf6hg7tRL+HWHp2jj7AkpnXQWj6k6VhLCd44cA6Fk2xE3aWA+N1/Ok6g1b j5LCE1AIQpgkJiFqItOVtU8a8UjgACm2A0KtZa+U8iQuaB/f6ddvo3Tzlg/IZtxv2x5+ F7dNk+/Wpo9vAVQ0gAhgsPU/K6mQcqpEdeoRvdvu/cLsYce5DwWANlpoci+RJ9a8HOOr Fs++OSBD0tslNgxDu2PQsVVmC+upbTswJuy0EdROO2iuSUlQ6fweD7U9tVVqK0qVUTyD gt0q9k6rmp0tJJEaUGuo//3IHjDSe0bxcvdrszasktkhap5OSYvZN+mScc+NXt4DX7Tp Lb9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=QIUMiMeO37HLXHmh1Ihwd/CfbMCTUhD4A8mHgM2Czpw=; b=KlICMRgm7mogqrjBOAt9tNM498g9OZBauyzPYqR+JY8cJrZi0qYrxT48T6tz9PjI7d JwHZdgPNl3V+FyU3DZBcX8o5xTxrjsPVcCvNvGGbtiXRb+LyrnBPBVytQKBIbFAsR/Ms R22/YogSudAMWY1O9+cY6HOle81NfPUvAmLtsazzA6opMvWkqaMuLxdb/uveIhHZqrSM NCJHjC0imdYEgiUib9RNPuDE6s51893wNCA+09yxZ8UkklWyJ4Pp6Wjkguu0yG+Vsh71 boW6cfN3kYQap2RFm3sIp6fZjr1V/dMQgAdbhJK8ZYlAQTtyT4ZUc/Jp0EXn84Czy1Yg BlpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TMgeBVYq; dkim=neutral (no key) header.i=@linutronix.de header.b=s+GLdJwk; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a63bf08000000b004c5936dd6e8si13597985pgf.11.2023.01.17.15.11.18; Tue, 17 Jan 2023 15:11:24 -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=@linutronix.de header.s=2020 header.b=TMgeBVYq; dkim=neutral (no key) header.i=@linutronix.de header.b=s+GLdJwk; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbjAQXJH (ORCPT + 46 others); Tue, 17 Jan 2023 18:09:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbjAQXGj (ORCPT ); Tue, 17 Jan 2023 18:06:39 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D25423C1B; Tue, 17 Jan 2023 13:34:09 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673991248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QIUMiMeO37HLXHmh1Ihwd/CfbMCTUhD4A8mHgM2Czpw=; b=TMgeBVYqAtYPEdUD25oT5SMdrISlzChdtJSl+ZUFGSTag87Nb03Fck3z8eBuYfXvTUjUe0 B6C65sFML/MBmgBAaEpJAdOgl7806R+uzAAuiA2fAqWLbz6sDjYJNtgd01nkw5PSm7i2sg hYmuYan8mvZTEtPPuFCztDeUGbj3lpcBwdhog8DEMEM5+zCmQ7ul0j7IanXG8ayKF2EGiY cUAgImO7uposBpaa83UqdfwVTkyr58wVCB9FjQHoLcQLtr2oiDbiMB5uTP4g6LmodGheEU wQY3t8WpjtD0yU5VaJvqnMnivZPROjajdz0RQomk9xo8KO+opoC3mZHCJz4TGA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673991248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QIUMiMeO37HLXHmh1Ihwd/CfbMCTUhD4A8mHgM2Czpw=; b=s+GLdJwkzpwBSI8hb81AMVA4pKM7Xk7hlF4wgMUeQB2lMoApgWmnSBjHnMqfmh1xC4fW+0 PdBLHAuwtwYTpsAQ== To: Johan Hovold , Marc Zyngier Cc: 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, Johan Hovold , Hsin-Yi Wang , Mark-PK Tsai Subject: Re: [PATCH v4 07/19] irqdomain: Look for existing mapping only once In-Reply-To: <20230116135044.14998-8-johan+linaro@kernel.org> References: <20230116135044.14998-1-johan+linaro@kernel.org> <20230116135044.14998-8-johan+linaro@kernel.org> Date: Tue, 17 Jan 2023 22:34:07 +0100 Message-ID: <87wn5kkfqo.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 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: .... > > +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. Thanks, tglx