From patchwork Fri Nov 11 13:54:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 18759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp752822wru; Fri, 11 Nov 2022 05:57:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf7+FlnaombAx/zuD/Vo7azeStTJLW4Tl1BARf2sqKWFWlzM+FLZ2lh8VP20ZrsLp0oOptrl X-Received: by 2002:aa7:c6d0:0:b0:461:ee90:3d77 with SMTP id b16-20020aa7c6d0000000b00461ee903d77mr1500873eds.322.1668175020787; Fri, 11 Nov 2022 05:57:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175020; cv=none; d=google.com; s=arc-20160816; b=SAMOW9CAP0uPBEIWpWUr2fO3a6DPQ9rqQU673qJ9HmgMALIb8VZMs2mpYe60VRPudX A0LgpEUCzJ1JPN5Yv45CMCnd84qzUKQMVZaBfy8WG3GmeBdGsKYKfnitY3zOzhRSI1Wd GQNn/CjGwoip+Vpy8X2mAWFyvxxFjQNFtj9pHtOooXHMUBTGQxAaC4JZffvYHAV2Jb/f fnn+CRuC8rDjOdTzSYn6pl+cAKRgU64tG/V9N0lWCcfcwGTiHjAsAX4foQVCx7uJpdSl cFztxMX6r+u+H9cwx5jsKaMygEcjC5D06PQAdqQw/LVaUI5e5lWmGPeP+45wm1HymrwG wb+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=bJxkwerKAjiWe6cHbEqN33xS2DP9tmAemXhkKdu0gyY=; b=pG7AjpnZ3UuCfDbSd1KoIAF/wqidgvjz+b0ofDOY+2Tz11jdtG/8N9TCpKMjU8N5ij EhNcwNa86NvEFYvRNdx6OaRoXDBWAR3CqKveHl48FuNnG54jGkmSNiZBIqHKQILjm22B Vu108Kgt+oGlhy42nHYnuai4JCIGoYBX4YmbwN56mVupapOKXrJ+5c4/678ARauTPFm3 ytodclkI/zzzpBKww8NBrPV3RZtOB/Wn2saKrEVoCfIKwhP4TJmWP6WiNiT3NuPUnLlZ ENAfjbLU2FxL8N/tbEhGDK1zIRgzxAyH9y2HB5TPJVv0kDou7gEnOF1YFOBy8iUc+ZZz KJfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QLffNtOU; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bj10-20020a170906b04a00b0078dc5c888f1si1790190ejb.135.2022.11.11.05.56.36; Fri, 11 Nov 2022 05:57:00 -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=@linutronix.de header.s=2020 header.b=QLffNtOU; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233692AbiKKNzo (ORCPT + 99 others); Fri, 11 Nov 2022 08:55:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233688AbiKKNzT (ORCPT ); Fri, 11 Nov 2022 08:55:19 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4414742D2; Fri, 11 Nov 2022 05:54:35 -0800 (PST) Message-ID: <20221111122014.294554462@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668174874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=bJxkwerKAjiWe6cHbEqN33xS2DP9tmAemXhkKdu0gyY=; b=QLffNtOU+BM9Q6v/Z8H95R6LwiMPRmhfbmoj75MKEHMyuvoWkxB4RbZv0LOe8zConFdPn3 FoUFDUYVoPhjPiUz6C+xwY6wbZBS5lKJg3/Gsu3284EwPDC+c//3QKxn3kDkoOFde3hYQC +pd/Xgm/h8dGs8OjV+shpssdUDGjerTJOwD/8mC4GG/L0S4ZPt/7rL+PeupLgtvUpTDE1N Un9QztBWeePvOOGEhy8v40+sFh0e4oCbUYoSJSn1XhDvUlTbCyxiOgkrR743ROQ9a0ADqn +HbdIbRhYeOip7Q6YM6FLWMKuOVt6JtuB76/8dQyT2nLcE1Cab8xY9yYhSPJGw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668174874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=bJxkwerKAjiWe6cHbEqN33xS2DP9tmAemXhkKdu0gyY=; b=REJ8yjGkmRMaCMvX4cw1m2qo8vf54uF9WaXNDdGlD7gTrIZa0CONrZEpNhXpv0sciserxB AcKM8IQKL5Qmr3BQ== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe , "Ahmed S. Darwish" , Reinette Chatre , Michael Ellerman , Christophe Leroy , linuxppc-dev@lists.ozlabs.org Subject: [patch 12/39] genirq/msi: Add bus token to struct msi_domain_info References: <20221111120501.026511281@linutronix.de> MIME-Version: 1.0 Date: Fri, 11 Nov 2022 14:54:33 +0100 (CET) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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?1749208290717554140?= X-GMAIL-MSGID: =?utf-8?q?1749208290717554140?= From: Ahmed S. Darwish Add a bus token member to struct msi_domain_info and let msi_create_irq_domain() set the bus token. That allows to remove the bus token updates at the call sites. Suggested-by: Thomas Gleixner Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe --- include/linux/msi.h | 19 +++++++++++-------- kernel/irq/msi.c | 7 +++++-- 2 files changed, 16 insertions(+), 10 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -16,6 +16,7 @@ * abuse. The only function which is relevant for drivers is msi_get_virq(). */ +#include #include #include #include @@ -365,6 +366,7 @@ struct msi_domain_ops { /** * struct msi_domain_info - MSI interrupt domain data * @flags: Flags to decribe features and capabilities + * @bus_token: The domain bus token * @ops: The callback data structure * @chip: Optional: associated interrupt chip * @chip_data: Optional: associated interrupt chip data @@ -374,14 +376,15 @@ struct msi_domain_ops { * @data: Optional: domain specific data */ struct msi_domain_info { - u32 flags; - struct msi_domain_ops *ops; - struct irq_chip *chip; - void *chip_data; - irq_flow_handler_t handler; - void *handler_data; - const char *handler_name; - void *data; + u32 flags; + enum irq_domain_bus_token bus_token; + struct msi_domain_ops *ops; + struct irq_chip *chip; + void *chip_data; + irq_flow_handler_t handler; + void *handler_data; + const char *handler_name; + void *data; }; /* Flags for msi_domain_info */ --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -694,8 +694,11 @@ struct irq_domain *msi_create_irq_domain domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0, fwnode, &msi_domain_ops, info); - if (domain && !domain->name && info->chip) - domain->name = info->chip->name; + if (domain) { + if (!domain->name && info->chip) + domain->name = info->chip->name; + irq_domain_update_bus_token(domain, info->bus_token); + } return domain; }