Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3403378rwb; Mon, 16 Jan 2023 07:35:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXvyZKZaumzbWfaEQ8X3PUIe+lXni1F1l3BntDLOc+REBjE+m8gwM9ko60PushHEyRmdFAdp X-Received: by 2002:a05:6402:4c7:b0:49a:23ce:2ab4 with SMTP id n7-20020a05640204c700b0049a23ce2ab4mr17297233edw.42.1673883303415; Mon, 16 Jan 2023 07:35:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673883303; cv=none; d=google.com; s=arc-20160816; b=dNURFeX9six7V2r079wjEkYeorLQBZ4wRTPsOUNXP8tZATqPwtC0P2EA8LKL88t+KZ X3hGKbKWlJIY+UwMCRG6Zxgf1/+fH2EBISbILPY7m2QiEvisu8Wqq5sdRnDFp/y9ZdPC Kp2Tk+MS3TiwXgNDYKGqlzIX0KU+ss6RlFZh33xJGk7dvxZaLO8XrVeZgIF62QYEt/Jj +6i/bbcE8de3Ba+wopwAMPDc17ZltWTINTdAsFoJXr762SBRVlEDSLrb63lrk2EFwH4k Kmtuv0YRkd9M0Hqr4OmBlZHS+3L7AGyi+P+LQDRmy+NdhWBotjw/x0icyB7wVHJ9ReJP /TTA== 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=09hhy9ylbHeu/SiceC01gZnXJr+aPiYtWbGovWWFSFs=; b=NXmYOvxEU7LM4pdVXKM5VBUPPNE4i3s3yD6RHGTyxP0EV4XQLBgwlrUWwGTz0mXW70 422yoQiMmzr7rtM1dQwAQE+GESb6x0IehVlH7LqtjkiJHBusVuaa04ysU9Ba5G7mftt5 ixvVaKg7hql+gkZZmkg9ZcYwGYNAxdxDkh2PRc5/LayXdeRVIAHR38+EMJRsa7n68ww8 /BzDJ3qNFUS5I5if5APsBouRwzP0DlsIcNJpAyg0Up2vITDGNR0rNwgZtkuPi8ucmJch Ve8RPI9kRAYKNDJO/bW1xJVhZFDT13Wf+hYEYcZXfBpjkwl+NMoqFifMvzg7ovobz/r7 Z0ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EfKk9L9s; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a056402084e00b004842aaeea0bsi8728262edz.603.2023.01.16.07.34.50; Mon, 16 Jan 2023 07:35:03 -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=EfKk9L9s; 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 S229842AbjAPNwB (ORCPT + 50 others); Mon, 16 Jan 2023 08:52:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231548AbjAPNur (ORCPT ); Mon, 16 Jan 2023 08:50:47 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83D8521971; Mon, 16 Jan 2023 05:50:44 -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 ams.source.kernel.org (Postfix) with ESMTPS id 36D2DB80F98; Mon, 16 Jan 2023 13:50:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E978C433A0; Mon, 16 Jan 2023 13:50:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1673877041; bh=7j3QbaKo3LQZQVKIp6aKOuNy40ktCIOrZ3HeL+Rwf1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EfKk9L9sqpnMZ3+AHb1HMoqZOhQNRwQ/oZkLjU7l3UA9rg17LEbiVel0eSSLhjMC2 zPG81JAv2b1s3VupJKrzR6KNrx0SlI2mJVlrR9cHwWgWsFsRE+qAboOoWXD6Vlr2jJ pdXuNUtXhAtsfzTIJ6fDZhDFxwnsEsixuwaOiy0ihM4Oa8AAeGQtO5TSQQz3rvkP3T mJrVuzeUOIKHwG0EuhhMilUXJWe3ikESXth5vKLBzCjJJj2bOefjqQkeMUPaNQu8Ho cmBc6JyPLCm4u6Mp5q0flNNwB+fo/2enYScFNELZ67OutJgvUTKDkOz2QYFSyudsjK XPSxv9rnDFCnQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pHPt6-0003vP-RB; Mon, 16 Jan 2023 14:51:00 +0100 From: Johan Hovold To: Marc Zyngier , Thomas Gleixner 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: [PATCH v4 15/19] irqchip/gic-v3-its: Use irq_domain_create_hierarchy() Date: Mon, 16 Jan 2023 14:50:40 +0100 Message-Id: <20230116135044.14998-16-johan+linaro@kernel.org> X-Mailer: git-send-email 2.38.2 In-Reply-To: <20230116135044.14998-1-johan+linaro@kernel.org> References: <20230116135044.14998-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Use the irq_domain_create_hierarchy() helper to create the hierarchical domain, which both serves as documentation and avoids poking at irqdomain internals. Note that the domain host_data was first set to the struct its_node during allocation only to immediately be overwritten with the struct msi_domain_info. Tested-by: Hsin-Yi Wang Tested-by: Mark-PK Tsai Signed-off-by: Johan Hovold --- drivers/irqchip/irq-gic-v3-its.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 973ede0197e3..5634d29b644d 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -4909,18 +4909,19 @@ static int its_init_domain(struct fwnode_handle *handle, struct its_node *its) if (!info) return -ENOMEM; - inner_domain = irq_domain_create_tree(handle, &its_domain_ops, its); + info->ops = &its_msi_domain_ops; + info->data = its; + + inner_domain = irq_domain_create_hierarchy(its_parent, + its->msi_domain_flags, 0, + handle, &its_domain_ops, + info); if (!inner_domain) { kfree(info); return -ENOMEM; } - inner_domain->parent = its_parent; irq_domain_update_bus_token(inner_domain, DOMAIN_BUS_NEXUS); - inner_domain->flags |= its->msi_domain_flags; - info->ops = &its_msi_domain_ops; - info->data = its; - inner_domain->host_data = info; return 0; } -- 2.38.2