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 81EDFC4332F for ; Fri, 9 Dec 2022 15:17:23 +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:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qk6/G/vGbg94dfvPkbNVh5JV6Q/CnBYBeP2Fza5BFvQ=; b=WPUpG/Pd9Q9SN3 wejnvmgipFGR28gT0/L2g/0aNyS61c437T7PBmGOwLIyc/AFyyypSstEkFQ05wEl24bhxBn7c64Rm /Fjnnh0ppgQrMNLGuICeasaRf2If0OeujZKN7U3hfR96hNFTe+y43AP3//xLdNFcmkgwnm41Gii9f VOCWvxV3A2sNwm20jjIOfsSgoj3cTb00a5MMLIEs89aVHMXaMD5HQFbFIBTGDPwGfDacGk2eMlK5H Q2FyioNBkTWAMvLbl9TWucHV3LF6jSo86Wn4PeobsH9PZTzNdXMPzOdz84XAAM/fF/rH2DlO5wF5Y 1N5O7cfefgvax1LnDoJw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3f7F-008uQG-GC; Fri, 09 Dec 2022 15:16:45 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3e04-008Daw-7l for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 14:05:18 +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 83E52B827A2; Fri, 9 Dec 2022 14:05:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 493D5C433EF; Fri, 9 Dec 2022 14:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670594713; bh=6uHKC/rYNMZbGqgdzTkCFSACHYrX65u6glI/1+02iB0=; h=From:To:Cc:Subject:Date:From; b=B1fmxikqb8Fw67G0tC7YA9Efg+IL/HqcUBdjDdfPrsQhNY/mQBKRtz5YnrDnnVhUc BEJezUadtkdrQD5ixCWcX/j4cRItCf0riR0INKkRNXKwmhg3/nfM6Qu8jyrkUJ3xcV c9QE3PZlgs9qCvOHj8wjdpVddifI2S0oeA4j6MZJfgFKtTxnSbd0cPCq9K6djnrJy1 rYznRVt4XbTP0sQVPKxMOkfq//4yg+66BT0EwB6v7pi8nz7vaCpAR7sBClK2YPq6pn zOB/CxyUVyyrJ+V4scR2b8ucmxivPTUb5ESteT8w/ypt1NER1wSEyW1Gbgf6bkYT6i m6ZuhT2qjK++g== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p3e0I-0000RN-3S; Fri, 09 Dec 2022 15:05:30 +0100 From: Johan Hovold To: Marc Zyngier Cc: Thomas Gleixner , 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 Subject: [PATCH v3 00/19] irqdomain: fix mapping race and clean up locking Date: Fri, 9 Dec 2022 15:01:31 +0100 Message-Id: <20221209140150.1453-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_060516_606069_CD6586F0 X-CRM114-Status: GOOD ( 11.32 ) 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 Parallel probing (e.g. due to asynchronous probing) of devices that share interrupts can currently result in two mappings for the same hardware interrupt to be created. This series fixes this mapping race and clean up the irqdomain locking so that in the end the global irq_domain_mutex is only used for managing the likewise global irq_domain_list, while domain operations (e.g. IRQ allocations) use per-domain (hierarchy) locking. Johan Changes in v2 - split out redundant-lookup cleanup (1/4) - use a per-domain mutex to address mapping race (2/4) - move kernel-doc to exported function (2/4) - fix association race (3/4, new) - use per-domain mutex for associations (4/4, new) Changes in v3 - drop dead and bogus code (1--3/19, new) - fix racy mapcount accesses (5/19, new) - drop revmap mutex (6/19, new) - use irq_domain_mutex to address mapping race (9/19) - clean up irq_domain_push/pop_irq() (10/19, new) - use irq_domain_create_hierarchy() to construct hierarchies (11--18/19, new) - switch to per-domain locking (19/19, new) Johan Hovold (19): irqdomain: Drop bogus fwspec-mapping error handling irqdomain: Drop dead domain-name assignment irqdomain: Drop leftover brackets irqdomain: Fix association race irqdomain: Fix disassociation race irqdomain: Drop revmap mutex irqdomain: Look for existing mapping only once irqdomain: Refactor __irq_domain_alloc_irqs() irqdomain: Fix mapping-creation race irqdomain: Clean up irq_domain_push/pop_irq() x86/ioapic: Use irq_domain_create_hierarchy() x86/apic: Use irq_domain_create_hierarchy() irqchip/alpine-msi: Use irq_domain_add_hierarchy() irqchip/gic-v2m: Use irq_domain_create_hierarchy() irqchip/gic-v3-its: Use irq_domain_create_hierarchy() irqchip/gic-v3-mbi: Use irq_domain_create_hierarchy() irqchip/loongson-pch-msi: Use irq_domain_create_hierarchy() irqchip/mvebu-odmi: Use irq_domain_create_hierarchy() irqdomain: Switch to per-domain locking arch/x86/kernel/apic/io_apic.c | 8 +- arch/x86/platform/uv/uv_irq.c | 7 +- drivers/irqchip/irq-alpine-msi.c | 8 +- drivers/irqchip/irq-gic-v2m.c | 5 +- drivers/irqchip/irq-gic-v3-its.c | 13 +- drivers/irqchip/irq-gic-v3-mbi.c | 5 +- drivers/irqchip/irq-loongson-pch-msi.c | 9 +- drivers/irqchip/irq-mvebu-odmi.c | 13 +- include/linux/irqdomain.h | 6 +- kernel/irq/irqdomain.c | 328 ++++++++++++++----------- 10 files changed, 220 insertions(+), 182 deletions(-) -- 2.37.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel