From patchwork Fri Dec 9 14:01:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 31768 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp795487wrr; Fri, 9 Dec 2022 06:08:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf50gDS1+2MDMJGfgmjHuA1JVRsKtSq1hBLhlT+pjbnb+Ioul/q7cBSnBKV8un/Lueg52gXL X-Received: by 2002:a05:6a00:2189:b0:56d:59f0:d291 with SMTP id h9-20020a056a00218900b0056d59f0d291mr6604380pfi.18.1670594890792; Fri, 09 Dec 2022 06:08:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670594890; cv=none; d=google.com; s=arc-20160816; b=dNTuqmSvx34L1PDAlwFEyWsXHBELZyIKC1rCwMtI69fABCUfcBqM0QrFJM/6U8jdyt WKYR62LiOdiRu+E+rS52FchofaMepkwdkfZGj6uMUcPI8J50jhIdTtl59DvyyqrWHehJ n32+woeb9FMCuaU+N9U4YhApkW9mulVQ3hH/kQ4BdfmAKD65MUN0DOSmPVjJVaLtL94d 1tCj3tIo7JqkEvoy1L/9Ld69Afgr4wtTK4HU5Zz1uAdtEEvx8X4L17YAcTz+XvT7eg6t AlP3PZlABTlVaokLG3IDWCOFz3suzxszYE9srWPQ8D5MZlwNwhFvInKRm2nG6V3e1WS4 YIuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NlOQ29Q54riMu3mdOTcCHirFG8hK7BzJCn4n9g8qcoM=; b=H6RhNekfBn6TLHswEkqvI+XEo5kVBodWRzogQmAgFO1Ez0b00qrMlGkmRfarUGCw9b Sk1KxUFjBtuEOTIzE8qFVvW/WMu7oDJfY+liGuazdl5veGrU2LTV5fD+DqMRYkFDvtGr MhuB9vEQcakiCnPP8mjImezHhTHhsIhxZM/IgV+Xx1+oO6j+k5SpZqBZnTIERZxYhuzz 75u9GyLxzRhp2w7lmLmgM2W6QOTgyTqnul7HYFVWiqT6RB4WomxwdM08fagclspg1H+e g0K7i6qfhvjyvhRsvshUtSLLZkM5Xlx/gZO2qMXyjdc+RWmfrgneAsi0X8MYjn3CU9yi dvhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kt/0JpLZ"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a056a00230300b00560bdd654ffsi1848444pfh.314.2022.12.09.06.07.55; Fri, 09 Dec 2022 06:08:10 -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="kt/0JpLZ"; 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 S229968AbiLIOF4 (ORCPT + 99 others); Fri, 9 Dec 2022 09:05:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229917AbiLIOFT (ORCPT ); Fri, 9 Dec 2022 09:05:19 -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 0766D75BCA; Fri, 9 Dec 2022 06:05:16 -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 DEB426226A; Fri, 9 Dec 2022 14:05:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D964CC4332C; 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=WgkN5Je4cNOPVZ/hkI2lCqO1EkpEAYkIqXZpsz/aHt4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kt/0JpLZVVFNgMrMfpluMRkkS1efDFdyD9NG2ZAWI0Yy86pZT9zhcPVjSD6Q5JhQC VOhYIkAxut3lwd51nXIxbqzhfnpeeOraosktgApMH6WlqmkxwkGBA45z8IlaLPjz5F /7OsANSOCDKqf6/C0788t7x6G/3JNYbCsRtXsFXd3q9N6dOdlRfcOhyRCsDtpdZpRY 596PPCham19J1eMFCGq3Xd7G8daWN9xx9UI3vLCYwKDmnx528mpZvoGzMSgBQWhvOI KQNBEB3XnMIPDhOs9rx//GTKhS8q15YLJl8NktAiHzRTPSqaJhDl0AXmIEpl/gGbDa ubTCupgoJr0qg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p3e0J-0000Rs-5E; Fri, 09 Dec 2022 15:05:31 +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 11/19] x86/ioapic: Use irq_domain_create_hierarchy() Date: Fri, 9 Dec 2022 15:01:42 +0100 Message-Id: <20221209140150.1453-12-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221209140150.1453-1-johan+linaro@kernel.org> References: <20221209140150.1453-1-johan+linaro@kernel.org> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751745708320872376?= X-GMAIL-MSGID: =?utf-8?q?1751745708320872376?= Use the irq_domain_create_hierarchy() helper to create the hierarchical domain, which both serves as documentation and avoids poking at irqdomain internals. Signed-off-by: Johan Hovold Reviewed-by: Philippe Mathieu-Daudé --- arch/x86/kernel/apic/io_apic.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index a868b76cd3d4..9cc4c8e0c3c4 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2364,9 +2364,9 @@ static int mp_irqdomain_create(int ioapic) return -ENODEV; } - ip->irqdomain = irq_domain_create_linear(fn, hwirqs, cfg->ops, - (void *)(long)ioapic); - + ip->irqdomain = irq_domain_create_hierarchy(parent, 0, hwirqs, fn, + cfg->ops, + (void *)(long)ioapic); if (!ip->irqdomain) { /* Release fw handle if it was allocated above */ if (!cfg->dev) @@ -2374,8 +2374,6 @@ static int mp_irqdomain_create(int ioapic) return -ENOMEM; } - ip->irqdomain->parent = parent; - if (cfg->type == IOAPIC_DOMAIN_LEGACY || cfg->type == IOAPIC_DOMAIN_STRICT) ioapic_dynirq_base = max(ioapic_dynirq_base,