Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp949357pxa; Wed, 5 Aug 2020 17:21:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyxXqh1A+92c05ZvfSZcwURTOpO/3SUVawGK2cr9RKc/8DLzTz63pr9Lode4jQmGVkwbC+ X-Received: by 2002:aa7:ce98:: with SMTP id y24mr1756006edv.76.1596673277405; Wed, 05 Aug 2020 17:21:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1596673277; cv=pass; d=google.com; s=arc-20160816; b=zBji8WVwht6jMoioDYod6lPpGxi2kreNG2hA8GgHiSF64OE4ggLcY9E7nGKcileh03 aSptrO2PTpDp6mFSCWB3TwAIQnj1gHDuPl4m0dDn+pYvNrbiXwhizfRPdp4jeE1DhIr5 TpkYg7EjNlefVq92fAa2gmjJ7szZAXm1W/ZMPEKy5RNr6zeCzeRQKYrOT8Xa2eS1X+vF x0BSeP0LZui/tX5NGeq+ykAoWG9J4hxhrCgrPFOXNcqcsE9tJCwUlJ1uRYbPdKK7bC/o LCrLHxlSIInxzDU0CFDqvz3NVS/cHGm1Fgbxn5q6wRopwqdl+2QokPrevrRbNFEMJxpf C3PA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8/ieMeAv+UuHyv+8RMNofaAoQw9WgzA1jEFYWwxzzVU=; b=QPFANJCOua/ZceZGAWkbDPUALEZv9FYmXr6PkdjAhILHX4OlMTztUkGMn4k+mrYfks cm8QujuJ3euObeosYpWg5hFETPbtP8IAyUxc++GroW+/O88Ob7hyhcLZBOYC9cJiLks+ Rrw5vYxhwlw8TW5zK5XBuxFEFj/oAUnlJ1mfjSzTp/wF/2uczxniH6ZMpdOCGxZvDdA3 BtIU+cJvJyTl85ov6oyM0ruoA6jXOA7qmIBa0Pz92lH3wFEz8QmRde6/ebOhGKTsUOxg BrDmOUX2xCjjtPczFJqqS+MHGDGWqxiG73rgF3v5uhUlW9pBt2yA2vPhDOoxzuu02z/J qZyA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=j1j7NHwx; arc=pass (i=1 spf=pass spfdomain=mellanox.com dkim=pass dkdomain=mellanox.com dmarc=pass fromdomain=mellanox.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a18si2394136ejr.262.2020.08.05.17.20.54; Wed, 05 Aug 2020 17:21:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Mellanox.com header.s=selector1 header.b=j1j7NHwx; arc=pass (i=1 spf=pass spfdomain=mellanox.com dkim=pass dkdomain=mellanox.com dmarc=pass fromdomain=mellanox.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726634AbgHFATj (ORCPT + 99 others); Wed, 5 Aug 2020 20:19:39 -0400 Received: from mail-eopbgr00045.outbound.protection.outlook.com ([40.107.0.45]:31969 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725999AbgHFATi (ORCPT ); Wed, 5 Aug 2020 20:19:38 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R2x7I04CiEpQ5hIGWKDJ/sDeklVDKHvs7JhzXvBhTpRkhXLYm+tH1Zc/DwjhQBJwD3Bm1o1TkTkHgTcegtYc5rG9knwMlVdjbc7jlJB7nB6smAz+pREG+Sjpr7p+Xcpu92gHAiIdjwSfGm6yOIMF/0dt7uJxzBKv+W9K3LE1G/Eyh15kHmSo6dq2i4BzKJTrmSUso+K/yb7j1S6uP4pqVWQUDr/8vx3PCBMFzTN6PuaIV4zUCCCkLUzPRt8o58vkkesm/1napmHUpaQRYCXvs8TmvgcVW/E3+Wu+3v0e37OQcnS2g/6ADvWTnY716MhpaPzZyjLRnCvCYNIqZsBKvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8/ieMeAv+UuHyv+8RMNofaAoQw9WgzA1jEFYWwxzzVU=; b=L2jzjVDd1WkbOUMZy81Vp6FLDEWZULU4KhHT3ywUc078pnbUM9K4COPfwXjdEJZb4endG4a/OUZj5IU23zW/lUBkG9CGUAr4scggkZp8yHZ7bOWu9WHZOwmftUZ5Zdb89B36CKKrbpDs6SOxo57jg7k0vFCMPIcdAgXC9uyO8B/yx8+6OtUmx/oThu2HHCgmik48TyM2dQ99zkEipoEGUvOJzwHlBjd3oWRX0L3L6nP/p3FXOfoBVkPhhowNHnjeBDuJpIeO5T8dd4o5u8cQlshQtfIZOMYSw/PfkXX7LjzeAxV1FKwNEtiUVUmsibUQtM7VQmlF+I9nZ5KpEO6INg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8/ieMeAv+UuHyv+8RMNofaAoQw9WgzA1jEFYWwxzzVU=; b=j1j7NHwxx6Qv1w0aUSmKW9agNs50jJmO7tYJVMOsIYVmQLy/uDGqJ9n0SSfiXyrYuQ7vD0GIf5y/OFAubOQvS5W93LPq5cfVikOwS43dGpseeMks6KQ6Mzp+bCevEj8DjjcA/Aplpi1S0NOItnrT41l7FZI8cUfZC0TfFGTfcFc= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB4141.eurprd05.prod.outlook.com (2603:10a6:803:44::15) by VE1PR05MB7375.eurprd05.prod.outlook.com (2603:10a6:800:1ab::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16; Thu, 6 Aug 2020 00:19:32 +0000 Received: from VI1PR05MB4141.eurprd05.prod.outlook.com ([fe80::10b0:e5f1:adab:799a]) by VI1PR05MB4141.eurprd05.prod.outlook.com ([fe80::10b0:e5f1:adab:799a%4]) with mapi id 15.20.3261.016; Thu, 6 Aug 2020 00:19:32 +0000 Date: Wed, 5 Aug 2020 21:19:27 -0300 From: Jason Gunthorpe To: "Dey, Megha" Cc: Marc Zyngier , "Jiang, Dave" , "vkoul@kernel.org" , "bhelgaas@google.com" , "rafael@kernel.org" , "gregkh@linuxfoundation.org" , "tglx@linutronix.de" , "hpa@zytor.com" , "alex.williamson@redhat.com" , "Pan, Jacob jun" , "Raj, Ashok" , "Liu, Yi L" , "Lu, Baolu" , "Tian, Kevin" , "Kumar, Sanjay K" , "Luck, Tony" , "Lin, Jing" , "Williams, Dan J" , "kwankhede@nvidia.com" , "eric.auger@redhat.com" , "parav@mellanox.com" , "Hansen, Dave" , "netanelg@mellanox.com" , "shahafs@mellanox.com" , "yan.y.zhao@linux.intel.com" , "pbonzini@redhat.com" , "Ortiz, Samuel" , "Hossain, Mona" , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" , "linux-pci@vger.kernel.org" , "kvm@vger.kernel.org" Subject: Re: [PATCH RFC v2 02/18] irq/dev-msi: Add support for a new DEV_MSI irq domain Message-ID: <20200806001927.GM19097@mellanox.com> References: <159534667974.28840.2045034360240786644.stgit@djiang5-desk3.ch.intel.com> <159534734833.28840.10067945890695808535.stgit@djiang5-desk3.ch.intel.com> <878sfbxtzi.wl-maz@kernel.org> <20200722195928.GN2021248@mellanox.com> <96a1eb5ccc724790b5404a642583919d@intel.com> <20200805221548.GK19097@mellanox.com> <70465fd3a7ae428a82e19f98daa779e8@intel.com> <20200805225330.GL19097@mellanox.com> <630e6a4dc17b49aba32675377f5a50e0@intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <630e6a4dc17b49aba32675377f5a50e0@intel.com> X-ClientProxiedBy: MN2PR19CA0025.namprd19.prod.outlook.com (2603:10b6:208:178::38) To VI1PR05MB4141.eurprd05.prod.outlook.com (2603:10a6:803:44::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (156.34.48.30) by MN2PR19CA0025.namprd19.prod.outlook.com (2603:10b6:208:178::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.17 via Frontend Transport; Thu, 6 Aug 2020 00:19:31 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1k3Td1-0041NA-Rr; Wed, 05 Aug 2020 21:19:27 -0300 X-Originating-IP: [156.34.48.30] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 35c259cf-ef0f-4f8e-58e6-08d8399e640d X-MS-TrafficTypeDiagnostic: VE1PR05MB7375: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hAZPRAlyoOS0DqCNSfPPuVELncAkDI0H2F1WKEeBVIhMyy4hPw+Y3JJAGyfmDgePCSpKlR+k+VPhbFuR3zAcSut6hWlM/QpR+GZMldJ/cICE4EK8v51a5BkOgk3xDhC862K/Wod85hS9lxA0uQeM0e4mc8sAPMAQZGnunlMbifRYuGpZwv4JtsX1x1UnoBOXkf0bKeITQMnnCMComTfKSmCrFM4/73furvcrJLRGVRZL0NHeaqOkscYWo+M1ohS5AMESQ0MSPBxayXZpUve9WY3tX50ddqGGFQQPetTfr493FgiYT4ielKsRRg9EYiZPa7b8ykEdeOmb9Pvjfm6miQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR05MB4141.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(396003)(366004)(376002)(136003)(39860400002)(346002)(36756003)(26005)(1076003)(86362001)(2906002)(2616005)(6916009)(5660300002)(426003)(7406005)(7416002)(9746002)(9786002)(66556008)(66476007)(316002)(54906003)(8936002)(33656002)(478600001)(8676002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: VjgGJxWg8Xuwv0bjfwwW0JiN1Io2mf46DBKd6f2cJqKopkFysKaEI2HUMDTsU7oeDIBo47EJLmYWt2oNLvXFPelOoZAbKxqbn37bm1aue94TH3xPX2ofg9DJO8OcR9wGdeDeErAguC63/z6LyucDlaQB6Bnj1qXN3YfSYnCWRwDdEzW57AWHXkgY7mCc+vxCO6W7koSFXKmTTE/PZxIup3i6rlF8t47XhNepZPdu8MgRktHMdapWX3P5M7ezuG1aiNRcG9lo/NsXWUgnYY7NztTzOtkaG65wsdFeulpjWz125uK3MCGJ9QoSmY1XBS/AljQ2PlReA+yCPrImiBSiaYYgzmq32U/t9r33cqbHfJyIWbgvzA9G0Du9/ZE8HrWcb6h2AaKjgjy5RyrMzoMw/N+qHvQCpl8PWjPKomHG6k/aIaMYD8FUAi5rHwB70zjTEu5KWwmRIYj7hsBMmag6qcIti1hdTMKF1DzXBo6gkHkHvnPwrOwnZAOaJyRcNlULEzv/ydAr0MOeYoeXnW+vVCSo9ut1L9x9pyp0chR6LPjFnVop7T0gBuU0NVFSNc0fplqXhmVPjMAeeVZB7v+6E0JEEzjszNR9w7Zcoif5iEsfVN1KtrwYZfP0K1ik5IoD6hUHz8TOo3UmYB55X4N5oA== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35c259cf-ef0f-4f8e-58e6-08d8399e640d X-MS-Exchange-CrossTenant-AuthSource: VI1PR05MB4141.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2020 00:19:32.2195 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Bxv+NhQc3z/r93GlbwCk84DKYResC6dCmTJEWzqW5a3LS29wJ9ubqJsV0iSLeg6l7lLwJwzNhUI3GJS42uGI+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR05MB7375 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 06, 2020 at 12:13:24AM +0000, Dey, Megha wrote: > > Well, I had suggested to pass in the parent struct device, but it could certainly > > use an irq_domain instead: > > > > platform_msi_assign_domain(dev, device_to_iommu(p_dev)->ir_domain); > > > > Or > > > > platform_msi_assign_domain(dev, pdev->msi_domain) > > > > ? > > > > Any maybe the natural expression is to add a version of > > platform_msi_create_device_domain() that accepts a parent irq_domain() and if > > the device doesn't already have a msi_domain then it creates one. Might be too > > tricky to manage lifetime of the new irq_domain though.. > > > > It feels cleaner to me if everything related to this is contained in the > > platform_msi and the driver using it. Not sure it makes sense to involve the > > iommu? > > Well yeah something like this can be done, but what is the missing > piece is where the IRQ domain actually gets created, i.e where this > new version of platform_msi_create_device_domain() is called. That > is the only piece that is currently done in the IOMMU driver only > for DSA mdev. Not that all devices need to do it this way.. do you > have suggestions as to where you want to call this function? Oops, I was thinking of platform_msi_domain_alloc_irqs() not create_device_domain() ie call it in the device driver that wishes to consume the extra MSIs. Is there a harm if each device driver creates a new irq_domain for its use? Jason