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 19E2BC4332F for ; Thu, 15 Dec 2022 09:32:58 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=j0jNuXlSSbC2c8Rg0m4HoGhQDOr+dkXMfgcu3wVeJlw=; b=DM0R1F3RWmHzNo /9Ux4EyMSXGR/+EFjY+ooMch8bVxcHoMu7jHRvk+z56yOStuIFRRw+oWyvUdF6vA6X0+yYkAaMF5D y7z1NOybGMmHQr0y3YOhgX6e3kNKMWhq+YTfUQ0tsOFuwbibRQuw+Xoq+O+qaC50KOds85TZM5ouk qtgOPz8srXg7RrZpnBtL71sHzWBeQBdb4WKBBuehrNEh7wB95NUx1iqLjxISWLjlvkhS6MT/tvGLm +kl1ZRgu6qNzQNnxnP27EvmkT5PVBSxjnyL+OTzCtXWSzfhGG8YYEcWOI5yzrVRRK7hafVyE96R4R YJSXJnZYsK1y6b3zTa1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5kaq-008Ihf-Kl; Thu, 15 Dec 2022 09:31:57 +0000 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5kan-008IdZ-F9 for linux-arm-kernel@lists.infradead.org; Thu, 15 Dec 2022 09:31:54 +0000 Received: by mail-qv1-xf36.google.com with SMTP id r15so1549186qvm.6 for ; Thu, 15 Dec 2022 01:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=a3EptiNNYz54B6ALuBWXOFkTd9baua/QSniBYKYKUZY=; b=d341/ShCuNm10nw7YXEAqsyxMI1C9+zYWCuxWP6KtFLWgNL1luRsAMab4cG331bjiF ecGvAPHxwavOY3dWh/uHTy6ZzCeHYX5xarp1CBq2xRMd+YM2rUqUkQ81muxHi6hq9AvS 8XitkIVk/iec2mh+T3HoI3VF7oe4e27dAcGlk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a3EptiNNYz54B6ALuBWXOFkTd9baua/QSniBYKYKUZY=; b=lc3W45rtSbbzI15smTus2JBOCaqGdlXnrn8Q1qSKtFsRuu1EaChkDuB/EmaVQoKMiR Y9pbFKH7v4bC14CxPWvKfqla4FtnBdm4JYs0opwv0Ue+f+YakrRwHhemtMgZa8bEh0CK 3xUtIJ96aqRhsp8cdIoe0aKOklzbWh439npkcDEmzV1V7Dw5uKesd3KHMI/MMDJoYM8D KTLO9IcVPtemgSMBoY2PniRthe2vj5Vq8BHqtsdnTiBZ3Ib62kRMJkV95KLu34UaaAuL jvX/7mVmF0lxekgsuuB6UFm4pqKuidvzfJZZxUhzwFL0qkrVkz/1+QTW3s1CAuBFt3k1 iIbQ== X-Gm-Message-State: ANoB5pno8OFgK0qtTXU1UquKzQ2SGJE/bEGgI2cJJssjT0+35VYJJGI7 27puWc07yv1FTRCXvM9sO3vwQCwIe3JLWQmVLrGugw== X-Google-Smtp-Source: AA0mqf4MjWdBgRV6+uwFHEh1nlyzpA7P1m0VMHF4xYlbLdYqgj/mBMj62ZjpW/dyQJKfHN5RHUtk2CKEOv5B6fQnj7w= X-Received: by 2002:a05:6214:4281:b0:4c6:8e11:b1ea with SMTP id og1-20020a056214428100b004c68e11b1eamr69618854qvb.18.1671096709828; Thu, 15 Dec 2022 01:31:49 -0800 (PST) MIME-Version: 1.0 References: <20221209140150.1453-1-johan+linaro@kernel.org> In-Reply-To: <20221209140150.1453-1-johan+linaro@kernel.org> From: Hsin-Yi Wang Date: Thu, 15 Dec 2022 17:31:24 +0800 Message-ID: Subject: Re: [PATCH v3 00/19] irqdomain: fix mapping race and clean up locking To: Johan Hovold Cc: Marc Zyngier , 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221215_013153_557935_BFCD67D4 X-CRM114-Status: GOOD ( 17.97 ) 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 Thu, Dec 15, 2022 at 5:22 PM Johan Hovold wrote: > > 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(-) > > -- Tested-by: Hsin-Yi Wang The series solves a race issue when having non-populated 2nd source components that share the same irq on ARM devices: Previously we would see [ 0.476357] irq: type mismatch, failed to map hwirq-11 for pinctrl@10005000! and the component failed to probe. > 2.37.4 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel