Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp968174lqs; Fri, 14 Jun 2024 10:34:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVNIKUI/hoiGaff90oD1Sdjo/i8KGdB37cyAyZAvZnK+bZ4ZuJTiFJI/Wyt6OdldDt8JZp+3zoYXLttn1yNk/z+B8zvtJTFrga+6oTlqQ== X-Google-Smtp-Source: AGHT+IFm6T9QlIHzZhxAJVZ08jAVXiX4Urgt0XRoGlFZE2B6mkKYtgMTKS6lm9DeRa4UzzH60H6C X-Received: by 2002:ac8:5709:0:b0:441:579e:b415 with SMTP id d75a77b69052e-44216b82e54mr40272361cf.47.1718386488406; Fri, 14 Jun 2024 10:34:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718386488; cv=pass; d=google.com; s=arc-20160816; b=WNsWKFdyBqA+Vr3bvNzwXT0WYal4R4b/l8+IcpkvqRnj3/CD3M2SiCE3xH8oCyABsb CAcMB2Y9H7u0FWxAA8j6MTefkhwfKSpZRElfFmjNVUbeJqIgLdnIePAYMOm22c/+Djar HeMbS08YMBzl++Edzpo2D9PGsGfWICitVYVggxG45mVm68EVMsuE5ZcH2TZTV2CdMII+ NxjjJIVCwENpL4mrDuQCwBO3BhX6w3H2uwSp8GrIRxcLsoiPcrpybyGJ0im70Vn354q9 bCs9qwdj+9d7WqMEop9ssCPos8q2EebVjchEYYHROT2P70Jh6J9hY8ZNi+sZAawrnfQo qPRA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+NkYxenKEC9OO3jJ3gxAE6moq1UMvEUEbQkI5OAK8Bk=; fh=bujJSrd+k1h/0aZbC1LeFD2/cY2NpcCgJFppOaBslqM=; b=QRk5rcc/ULFMKNUOEvb4xqT2RbsimHXcaWv8ttPIUIrJXqrHP3aQlJKHFvzyrrrJGh PqOzLh022UypCKDyoi8MYF9HgB/1Eaj/nE/otE09UjEqAvBoVupvKjw2KtZ8eE8JbrbM T664MGFa2i2apWkOXL3SfZapbo19XwdIyiHGQfrY7tJoDg0DkR6csZh8K2JAd3guVh9p V6A8Y/xGOJP71EvSZrmCTupM1HIhVxsaZRZaK/ZHhpdZrU9AsDWZzn1pTSshd7kLJPO+ /eP0QCYZilZVPMNFmwpSMoVheggL8/Gp1norLZjKiO8Z5F+UJJdu3iry7CVLNVoqWILa jUbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VQBWA83d; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-215364-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215364-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-441f31297bbsi41865111cf.796.2024.06.14.10.34.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 10:34:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215364-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=VQBWA83d; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-215364-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215364-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 854851C20C5E for ; Fri, 14 Jun 2024 17:34:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1783D1A38FB; Fri, 14 Jun 2024 17:32:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="VQBWA83d" Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EBC519DF5D; Fri, 14 Jun 2024 17:32:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718386376; cv=none; b=SaoeFLw/EIX3gk7dgRM76K6lXPh7KWl75yzu5h5B+ui6HqLeVeWe4V335p6yMbh0pgWEQU/U/ELpGRtxofAlcJgQf1DYj0mdyii1kf8rGszFzZKKBNfpUGqI5mWzlavURd0yvCzymfC92mXiAyMVJsWzJ9mJXj6pTE421tVgS9I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718386376; c=relaxed/simple; bh=kEUiQ1CYjLj755ILvY6eux74YH9KYDJzi2RBOyIeGR8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E2QLXhKV4tcjp+3erJ5S75JKPLQw90nj//9jmPKCDwHS894jND5gssxPhyuXtUn16LwpgMqlMwi8POrhxtYO+ELqaZpPVjp08s2EV8nobKjKO6fknVbz18riM1hc5Rvl1P/EpEIpF+jlyNNb69WDvRI4tyvdE9tBMHmCyoCq1Ec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=VQBWA83d; arc=none smtp.client-ip=217.70.183.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id 2C61DFF80C; Fri, 14 Jun 2024 17:32:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1718386372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+NkYxenKEC9OO3jJ3gxAE6moq1UMvEUEbQkI5OAK8Bk=; b=VQBWA83dpargUL4CS6k35jbg8SKlxJAGPHYkzdgEEmtSl5vL1cntkYI6XkIIjtpa9pDh4C Av7cVO9vJakY5eylBEXku6OTiL6KMd2IOoKoyZB1SLoNStAzpyvs85hnVXiKH67aGUg5LB cNwthBjvoeORgsoaoJphzeU0KPfxvLfHwOvCaJdYipR1WwrcdSwhr4lt7trgfKo87JTomj eYlaobYjgGaP/5//iadWWn3YmYO8hWG7wTbkm86mYcq0xYCQouc+z91tocA0gslxRiXzir ZjNP2Vq6LDpRBig9FY/deNx2YTwmjqn037zuEpG0NOWpBeyNn9I+8emIGlKV9A== From: Herve Codina To: Matti Vaittinen , Herve Codina , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Richard Weinberger , Anton Ivanov , Johannes Berg , Marc Zyngier Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-um@lists.infradead.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni Subject: [PATCH 08/23] irqdomain: Handle domain hierarchy parent in irq_domain_instantiate() Date: Fri, 14 Jun 2024 19:32:09 +0200 Message-ID: <20240614173232.1184015-9-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240614173232.1184015-1-herve.codina@bootlin.com> References: <20240614173232.1184015-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com To use irq_domain_instantiate() from irq_domain_create_hierarchy(), irq_domain_instantiate() needs to handle the domain hierarchy parent. Handle this parent. Signed-off-by: Herve Codina --- include/linux/irqdomain.h | 6 ++++++ kernel/irq/irqdomain.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index 4683b66eded9..e52fd5e5494c 100644 --- a/include/linux/irqdomain.h +++ b/include/linux/irqdomain.h @@ -276,6 +276,12 @@ struct irq_domain_info { int direct_max; const struct irq_domain_ops *ops; void *host_data; +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY + /** + * @parent: Pointer to the parent irq domain used in a hierarchy domain + */ + struct irq_domain *parent; +#endif }; struct irq_domain *irq_domain_instantiate(const struct irq_domain_info *info); diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 34acc2ccfee7..7e4a1da63549 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -265,6 +265,13 @@ struct irq_domain *irq_domain_instantiate(const struct irq_domain_info *info) domain->flags |= info->domain_flags; +#ifdef CONFIG_IRQ_DOMAIN_HIERARCHY + if (info->parent) { + domain->root = info->parent->root; + domain->parent = info->parent; + } +#endif + __irq_domain_publish(domain); return domain; -- 2.45.0