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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E189C433FE for ; Mon, 6 Dec 2021 14:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344439AbhLFOkM (ORCPT ); Mon, 6 Dec 2021 09:40:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344364AbhLFOkL (ORCPT ); Mon, 6 Dec 2021 09:40:11 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AE5EC061746; Mon, 6 Dec 2021 06:36:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4l1EyDlzIIv+1SIRD0zZn4HUbfQJMuJ4Y2dEvO1gf1I=; b=Ae2mosQSSIN3/Ou9+CZAfKfpnP WOxt9x5/Z6YXFpVax628Ud7NOehUpL/RiSlkeCvSFaGy6mwZBbStPzxBATjSut3Vhrlj+uIOHJvsz aMLDZZCYdoOfEGEJSqpYWO8mQVMzrrsVDWx+P5CBjJVG+1jMa6wSv4fUkjoCk4Gq5RQUQqipuTWO6 70i+4AOeEB/wBPZV3lA2N+ntCzKz68xJ5XThuwFTi0+Q8vVALv2RqdwOZkSxuf3hw8Q2NButSmMlU rFnRjQHr6vRqaalJaRX7Piori3OFsCeee3Q3hZGhWCOc9RxjBFhz13xw5CpwXp+N9HeZYrxG0mX/B AL8WRRsQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1muF6R-004FGQ-GK; Mon, 06 Dec 2021 14:36:27 +0000 Date: Mon, 6 Dec 2021 06:36:27 -0800 From: Christoph Hellwig To: Lu Baolu Cc: Greg Kroah-Hartman , Joerg Roedel , Alex Williamson , Bjorn Helgaas , Jason Gunthorpe , Christoph Hellwig , Kevin Tian , Ashok Raj , Will Deacon , Robin Murphy , Dan Williams , rafael@kernel.org, Diana Craciun , Cornelia Huck , Eric Auger , Liu Yi L , Jacob jun Pan , Chaitanya Kulkarni , Stuart Yoder , Laurentiu Tudor , Thierry Reding , David Airlie , Daniel Vetter , Jonathan Hunter , Li Yang , Dmitry Osipenko , iommu@lists.linux-foundation.org, linux-pci@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 04/18] driver core: platform: Add driver dma ownership management Message-ID: References: <20211206015903.88687-1-baolu.lu@linux.intel.com> <20211206015903.88687-5-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211206015903.88687-5-baolu.lu@linux.intel.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I really hate the amount of boilerplate code that having this in each bus type causes. Between that and the suggestion from Joerg I wonder if we could do the following again: - add new no_kernel_dma flag to struct device_driver - set this flag for the various vfio drivers - skip claiming the kernel dma ownership for those (or rather release it if the suggestion from Joerg works out)