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 X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66828C38A30 for ; Mon, 20 Apr 2020 16:59:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 41F99206B8 for ; Mon, 20 Apr 2020 16:59:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726089AbgDTQ7v (ORCPT ); Mon, 20 Apr 2020 12:59:51 -0400 Received: from foss.arm.com ([217.140.110.172]:52272 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725773AbgDTQ7v (ORCPT ); Mon, 20 Apr 2020 12:59:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 21D5831B; Mon, 20 Apr 2020 09:59:51 -0700 (PDT) Received: from [10.57.33.63] (unknown [10.57.33.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1EC623F73D; Mon, 20 Apr 2020 09:59:47 -0700 (PDT) Subject: Re: [PATCHv3 3/6] iommu/arm-smmu: Implement iommu_ops->def_domain_type call-back To: Sai Prakash Ranjan , Will Deacon , Joerg Roedel , Sibi Sankar , Bjorn Andersson , Jordan Crouse , Rob Clark Cc: Stephen Boyd , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Matthias Kaehlcke , Evan Green References: From: Robin Murphy Message-ID: Date: Mon, 20 Apr 2020 17:59:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On 2020-04-20 5:42 pm, Sai Prakash Ranjan wrote: > Implement the new def_domain_type call-back for the ARM > SMMU driver. We need this to support requesting the domain > type by the client devices. Modulo any further changes to the default domain rework, Reviewed-by: Robin Murphy > Signed-off-by: Sai Prakash Ranjan > --- > drivers/iommu/arm-smmu.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c > index e622f4e33379..b345a86085ce 100644 > --- a/drivers/iommu/arm-smmu.c > +++ b/drivers/iommu/arm-smmu.c > @@ -1609,6 +1609,17 @@ static void arm_smmu_get_resv_regions(struct device *dev, > iommu_dma_get_resv_regions(dev, head); > } > > +static int arm_smmu_def_domain_type(struct device *dev) > +{ > + struct arm_smmu_master_cfg *cfg = dev_iommu_priv_get(dev); > + const struct arm_smmu_impl *impl = cfg->smmu->impl; > + > + if (impl && impl->def_domain_type) > + return impl->def_domain_type(dev); > + > + return 0; > +} > + > static struct iommu_ops arm_smmu_ops = { > .capable = arm_smmu_capable, > .domain_alloc = arm_smmu_domain_alloc, > @@ -1627,6 +1638,7 @@ static struct iommu_ops arm_smmu_ops = { > .of_xlate = arm_smmu_of_xlate, > .get_resv_regions = arm_smmu_get_resv_regions, > .put_resv_regions = generic_iommu_put_resv_regions, > + .def_domain_type = arm_smmu_def_domain_type, > .pgsize_bitmap = -1UL, /* Restricted during device attach */ > }; > >