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 7BE0BC4332F for ; Tue, 7 Dec 2021 02:34:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243794AbhLGChv (ORCPT ); Mon, 6 Dec 2021 21:37:51 -0500 Received: from mga12.intel.com ([192.55.52.136]:6439 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232285AbhLGChs (ORCPT ); Mon, 6 Dec 2021 21:37:48 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10190"; a="217498038" X-IronPort-AV: E=Sophos;i="5.87,293,1631602800"; d="scan'208";a="217498038" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2021 18:34:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,293,1631602800"; d="scan'208";a="515056584" Received: from allen-box.sh.intel.com (HELO [10.239.159.118]) ([10.239.159.118]) by orsmga008.jf.intel.com with ESMTP; 06 Dec 2021 18:34:11 -0800 Cc: baolu.lu@linux.intel.com, Greg Kroah-Hartman , Joerg Roedel , Alex Williamson , Bjorn Helgaas , 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 18/18] drm/tegra: Use the iommu dma_owner mechanism To: Jason Gunthorpe References: <20211206015903.88687-1-baolu.lu@linux.intel.com> <20211206015903.88687-19-baolu.lu@linux.intel.com> <20211206124033.GY4670@nvidia.com> From: Lu Baolu Message-ID: Date: Tue, 7 Dec 2021 10:34:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211206124033.GY4670@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/21 8:40 PM, Jason Gunthorpe wrote: > On Mon, Dec 06, 2021 at 09:59:03AM +0800, Lu Baolu wrote: > >> @@ -941,48 +944,44 @@ int host1x_client_iommu_attach(struct host1x_client *client) >> * not the shared IOMMU domain, don't try to attach it to a different >> * domain. This allows using the IOMMU-backed DMA API. >> */ >> - if (domain && domain != tegra->domain) >> + client->group = NULL; >> + if (!client->dev->iommu_group || (domain && domain != tegra->domain)) >> + return iommu_device_set_dma_owner(client->dev, >> + DMA_OWNER_DMA_API, NULL); >> + >> + if (!tegra->domain) >> return 0; > > This if should be removed completely now > > Jason > Sure. Best regards, baolu