From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93B8FC433FE for ; Wed, 22 Dec 2021 17:52:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 4AE3A60FCF; Wed, 22 Dec 2021 17:52:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zm7Z6ZbYT2eG; Wed, 22 Dec 2021 17:52:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 1D64360FB3; Wed, 22 Dec 2021 17:52:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EA34BC001E; Wed, 22 Dec 2021 17:52:12 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id DD35DC0012 for ; Wed, 22 Dec 2021 17:52:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id CB77B8195C for ; Wed, 22 Dec 2021 17:52:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=nvidia.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9b2Gt23sBGTt for ; Wed, 22 Dec 2021 17:52:10 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2066.outbound.protection.outlook.com [40.107.237.66]) by smtp1.osuosl.org (Postfix) with ESMTPS id 7E2F781B71 for ; Wed, 22 Dec 2021 17:52:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VP+NLdzx3RGsdxwM6VuX2bMd4c2xEX+yXoIAA1QBY4B2ZAr1YVWklcnqBuYkTEODcXfGjKYAX6uBrsRcTOclZkVL9awotyNOyYT6ouvM1TcfZ7S1DLUxctvvv99gLbYvWzaM7/PXgwu+IIEzvMDg7WTEOsFY4fBuajsbZyJvIDVSix6tYKLrW2dhnO6Pj9tP3jLBm0nmLs3QxZNCIPCHyfBHeDo4SraRKLjRpjmWv4A2fsKNMjG9nvDbgSGOzyZ/biDXnLGzBdMf4kD8FSZsFGo2QnruPehPo7dQ9YMAT3mJBFGGDv4+lTmIeZ0RBq4G5owo0SJ9jZnrOimIucd44Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BZhpsDmmXVHBis31nXjeXXEsp6+x6ZM/nkS2KwjvaDc=; b=nl27CSjdLACFnMz3UktqHKUarRmHccOVlpPgcOG0wBxTDFrd55VNwSqMYJ3jOPWCIakO5ukAxq4+LkyEKqzxJsb4NjYS4uQhXbwiDxUmMAV31WZwF2AEtRbGc5klYxzZE7WC/zycYLWv///Oa5EqyqkVEOvw52XEnKT2zW3tJ9nm/1alB9EH34LStxSirrfj8FTMCzdSZ1SSHwEQsmEq6KZzYWRGtJNK8dZZ5vnf/E2e4AoawiwMKvvJFttB95tLOKZE+vNcAe+8D+fepDrht8GxcTmj0fUP8MHYEy736t4bropQxmUEYk15fkHzeITx+DcwU/U/S7o72BngAWYjrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BZhpsDmmXVHBis31nXjeXXEsp6+x6ZM/nkS2KwjvaDc=; b=FQB6XEL3h6H8BNCM4TcceSo+AGHuBMTBJkobjkYvSXZLj9yW1lqqfKQy5VgNB6o/UA4nUDuplBIEthSxj14c8CnyWq75xwfPyyvcSwDipqrRNGSexXKiy8OOCnPTXwVsyU//OdEViMetiLQtTwbHbdvCoE8sCPw3MqqijlyjLugttVJtYPvUWxT/4m1whVPz5bsS7w1QDT5gnefIDtAgbNxBnvPoWeoIoqXv4o6ndRfk2J57I6rHfLp5kOUTxCo5Ow5nJ0MldokWyzON+hE5pqP/kula5ad3Zf/DZmZ6H1vj4XbVVOgCKYlm29jX9EJSfnVe/YgwPA7rIFKQxdhe/Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5224.namprd12.prod.outlook.com (2603:10b6:208:319::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 22 Dec 2021 17:52:07 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::d8be:e4e4:ce53:6d11]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::d8be:e4e4:ce53:6d11%7]) with mapi id 15.20.4823.019; Wed, 22 Dec 2021 17:52:07 +0000 Date: Wed, 22 Dec 2021 13:52:05 -0400 To: Greg Kroah-Hartman Subject: Re: [PATCH v4 02/13] driver core: Set DMA ownership during driver bind/unbind Message-ID: <20211222175205.GL1432915@nvidia.com> References: <20211217063708.1740334-1-baolu.lu@linux.intel.com> <20211217063708.1740334-3-baolu.lu@linux.intel.com> Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MN2PR08CA0025.namprd08.prod.outlook.com (2603:10b6:208:239::30) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af56339f-7652-4542-8538-08d9c573c512 X-MS-TrafficTypeDiagnostic: BL1PR12MB5224:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: W1oSqoLAl4e78Skj2iYDTmvhGjr5XBUQwrwEPrgWfWu44tIIneYnPbj4At5G4ds963hNFnickVAlnoC3HuBN70kvcWibxOK9uGsJixTRZYwA7KcwU9qRaq9iI78GqnsGFu+KuhuK5yc7sdi1VVGMQdWfDLzwQ2A1mizdiS/7D1haZjFCzskt+vpK+bCiezm4bQiIuXC3mkXUMMdTnKSMQbAAqtt0PMbngZG2Nn7sdyjltIBON1mf1QlTjiJ086CxKycdRyLXujFes+zRziWg+g0zxEhrp5MPwU+fL78esHb3YGGNysCnnhZ2OFV8L/yzLZBd3Hn89qcEn2BGYNEDedhVdIW4kMvRvtNdqc8/uQwpPDD9ZOobyoYvVDAdeqMsTBJD12A7JmM1g/pr1QiDM+iFMch5lUVEkOhwD0WTj0hXfU2xiOwKzGu1tnODn2hkiTu55cp4+tQa7Vzu+AewxIUfpiL06LbUkg0a1TnMGB6uPVdUIXZzgXAdkBpEB9bAl7LrYkx2W3d4BH2fo3HkN/Ng1VOmuCvXT0lvDEhU0JTC7OKx6LyIkeReHh3U0pKyPSivQ862gvSIBZBvh7DejWs5vdcHhOqhhXa8zSm5mZ6fTdYJ4KDEiqH+toYM4iXI9c4NUbaYKwUVLswP6Obh60kwGg5vjfy1MWJePen1YwkHvWIQTj7RAod9toKdY1jA8WQXv60bTdrwV3ccD8FjhQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL0PR12MB5506.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(4326008)(8676002)(66556008)(36756003)(316002)(33656002)(8936002)(6486002)(38100700002)(5660300002)(508600001)(186003)(54906003)(6506007)(6916009)(66476007)(6512007)(1076003)(26005)(66946007)(7416002)(2906002)(2616005)(86362001)(357404004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?LNUD/IgNmlKnrRo+pbsrJkjafl0UVOTlgto7/Njz8Al+ivNtDElw/moGbmhT?= =?us-ascii?Q?mH4P9wQykdwwB5v/JtZ7A2MjNdsezfGYOwnOHkEy++Jqmt7hmKysfoApgwuj?= =?us-ascii?Q?fV3qX4ZZLn3nqQIEHQiVwT2ErreTxZVDZgSnu5HoGq/D2S6mjKBJVqfKv2Ao?= =?us-ascii?Q?uw/eaL1CK8u/igrUo2hwO5WO1FzCEt2OxOTGXysmewIgGjOjTNDIP3d15ZhJ?= =?us-ascii?Q?sdzMggaLHkVdpIh0O2X7RiA5uq+m8d2ML2tj1kO+aLxTIbZPMAfriyKI/w/w?= =?us-ascii?Q?v7iUYH067m25Xs0ksU8m0r1EIKKuVfbYVwIzIV7WpnyNH4GOQGeuWdT6txeq?= =?us-ascii?Q?rwZukXBYXzASjBZcTjKrBiORTlnZf/j20fotFzHT/lWaoJlQJ9mkY1MaU1Ap?= =?us-ascii?Q?BoMiP7YCquD3DptVVHrl1+Q/FARJuswBQ8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5ZOVc012N8wK8qIiJTd0phndFfCGsJvsNGDTFVyMzj3zyJcmI8uKYj/Z?= =?us-ascii?Q?nWPmv/ykSFqqfOeQTrcVMpFyG8Kf5iuAMnaEFzjfsaFnjIzhWWVm/Jda+3rO?= =?us-ascii?Q?6Q45/8tlVLtjOdzyNw/ixM6BkAaghx/2YHVy3qTIBJd/wwu1FI+MQ1eD8TqT?= =?us-ascii?Q?ViV4JI30Q4iFlbrAFxkp7N/l1Lqkn85QSUuNqK4mX6q/XVpJO/Zw17oQqtfd?= =?us-ascii?Q?M5e6O2PhJc7XVRDEq30=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: af56339f-7652-4542-8538-08d9c573c512 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Dec 2021 17:52:06.9746 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: D0jr7NMtj5q5slxr7okhtLMqU+3/UoPzj2iumZqCV89O5M9vqo1GqZ0pZWcQf/6r X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5224 Cc: Stuart Yoder , rafael@kernel.org, David Airlie , linux-pci@vger.kernel.org, Thierry Reding , Diana Craciun , Dmitry Osipenko , Will Deacon , Ashok Raj , Jonathan Hunter , Christoph Hellwig , Kevin Tian , Chaitanya Kulkarni , Alex Williamson , kvm@vger.kernel.org, Bjorn Helgaas , Dan Williams , Cornelia Huck , linux-kernel@vger.kernel.org, Li Yang , iommu@lists.linux-foundation.org, Jacob jun Pan , Daniel Vetter , Robin Murphy X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Jason Gunthorpe via iommu Reply-To: Jason Gunthorpe Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Dec 22, 2021 at 01:47:34PM +0100, Greg Kroah-Hartman wrote: > Right now we only have 4 different "busses" that care about this. Out > of the following callbacks: > fsl_mc_dma_configure > host1x_dma_configure > pci_dma_configure > platform_dma_configure > > Which one will actually care about the iommu_device_set_dma_owner() > call? All of them? None of them? Some of them? You asked this already, and it was answered - all but host1x require it, and it is harmless for host1x to do it. > Again, why can't this just happen in the (very few) bus callbacks that > care about this? Because it is not 'very few', it is all but one. This is why HCH and I both prefer this arrangement. Especially since host1x is pretty odd. I wasn't able to find where a host1x driver is doing DMA using the host1x device.. The places I looked at already doing DMA used a platform device. So I'm not sure what its host1x_dma_configure is for, or why host1x calls of_dma_configure() twice.. > In following patches in this series, you turn off this > for the pci_dma_configure users, so what is left? ??? Where do you see this? > I know others told you to put this in the driver core, but I fail to see > how adding this call to the 3 busses that care about it is a lot more > work than this driver core functionality that we all will have to > maintain for forever? It is 4, you forgot AMBA's re-use of platform_dma_configure. Why are you asking to duplicate code that has no reason to be different based on bus type? That seems like bad practice. No matter where we put this we have to maintain it "forever" not sure what you are trying to say. Jason _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu