Message ID | 20230116135044.14998-16-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1202816wrn; Mon, 16 Jan 2023 05:54:17 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3H0j/PraePVtw96Z6PmrbMkzR5RXgVZAU79lue68euIRbfRDcKcEikQYJ8P2JDrU+BG+o X-Received: by 2002:a17:907:9625:b0:7ad:9455:d57d with SMTP id gb37-20020a170907962500b007ad9455d57dmr89438645ejc.74.1673877257184; Mon, 16 Jan 2023 05:54:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673877257; cv=none; d=google.com; s=arc-20160816; b=NCJPe/5FyPYd8Vx6iabsDcQj5uyAPf8LlgZp0oIWp4hLZsgLDQo/x/6c/d4QEAuMIe CntUag8NIl1NJnssF4C0ADE7ixsyAWDw847vGY6JjSDvDwmFMwVJS/+KNlW6ADTjKTzK N8VVaz5dzs26RjuhLYFt5+1f6fnCBigyacdaQNxuYAx9WTXiXX7BVu7IkfuswtzIV/JY h1DFeByoKZNmcrieU0Vkd/9a2c22LBC7WdsdFRuHan3l9OQzQzzgtcyZGefUr4oTDtsx xjwJMdFnIAdAtpIvMRMB/gXiPN7duHH+VggxtEXwtVNVEedfRcjK4UPqr5+Rr+EsGmvg jzEQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f15-20020a0564021e8f00b0048d6ace589esi38698390edf.128.2023.01.16.05.53.53; Mon, 16 Jan 2023 05:54:17 -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 <rfc822;stefanalexe802@gmail.com> + 99 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <johan+linaro@kernel.org>) id 1pHPt6-0003vP-RB; Mon, 16 Jan 2023 14:51:00 +0100 From: Johan Hovold <johan+linaro@kernel.org> To: Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@linutronix.de> 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 <johan+linaro@kernel.org>, Hsin-Yi Wang <hsinyi@chromium.org>, Mark-PK Tsai <mark-pk.tsai@mediatek.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755187518767750984?= X-GMAIL-MSGID: =?utf-8?q?1755187518767750984?= |
Series |
irqdomain: fix mapping race and clean up locking
|
|
Commit Message
Johan Hovold
Jan. 16, 2023, 1:50 p.m. UTC
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 <hsinyi@chromium.org> Tested-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> --- 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; }