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=unavailable 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 CB5F3C38A30 for ; Mon, 20 Apr 2020 16:57:30 +0000 (UTC) Received: from silver.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 mail.kernel.org (Postfix) with ESMTPS id A76BA20B1F for ; Mon, 20 Apr 2020 16:57:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A76BA20B1F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7049C2156C; Mon, 20 Apr 2020 16:57:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BAD9PpT41NZk; Mon, 20 Apr 2020 16:57:29 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 2F9A42154C; Mon, 20 Apr 2020 16:57:29 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1651BC1D74; Mon, 20 Apr 2020 16:57:29 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id F16CCC0177 for ; Mon, 20 Apr 2020 16:57:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DA5EC21553 for ; Mon, 20 Apr 2020 16:57:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C60UgHaVF+Qf for ; Mon, 20 Apr 2020 16:57:25 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by silver.osuosl.org (Postfix) with ESMTP id 7D68B2154C for ; Mon, 20 Apr 2020 16:57:25 +0000 (UTC) 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 D0A1C31B; Mon, 20 Apr 2020 09:57:24 -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 79EF63F73D; Mon, 20 Apr 2020 09:57:22 -0700 (PDT) Subject: Re: [PATCHv3 2/6] iommu/arm-smmu: Allow client devices to select direct mapping To: Sai Prakash Ranjan , Will Deacon , Joerg Roedel , Sibi Sankar , Bjorn Andersson , Jordan Crouse , Rob Clark References: From: Robin Murphy Message-ID: Date: Mon, 20 Apr 2020 17:57:19 +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-Language: en-GB Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Evan Green , Stephen Boyd , iommu@lists.linux-foundation.org, Matthias Kaehlcke , linux-arm-kernel@lists.infradead.org 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On 2020-04-20 5:42 pm, Sai Prakash Ranjan wrote: > From: Jordan Crouse > > Some client devices want to directly map the IOMMU themselves instead > of using the DMA domain. Allow those devices to opt in to direct > mapping by way of a list of compatible strings. Neat and tidy :) Reviewed-by: Robin Murphy Strictly, I think patch #3/6 should really have come before this one (with the header change moved accordingly), but don't bother resending just for that. Thanks, Robin. > Signed-off-by: Jordan Crouse > Co-developed-by: Sai Prakash Ranjan > Signed-off-by: Sai Prakash Ranjan > --- > drivers/iommu/arm-smmu-qcom.c | 19 +++++++++++++++++++ > drivers/iommu/arm-smmu.h | 1 + > 2 files changed, 20 insertions(+) > > diff --git a/drivers/iommu/arm-smmu-qcom.c b/drivers/iommu/arm-smmu-qcom.c > index 64a4ab270ab7..5bedf21587a5 100644 > --- a/drivers/iommu/arm-smmu-qcom.c > +++ b/drivers/iommu/arm-smmu-qcom.c > @@ -3,6 +3,7 @@ > * Copyright (c) 2019, The Linux Foundation. All rights reserved. > */ > > +#include > #include > > #include "arm-smmu.h" > @@ -11,6 +12,23 @@ struct qcom_smmu { > struct arm_smmu_device smmu; > }; > > +static const struct of_device_id qcom_smmu_client_of_match[] = { > + { .compatible = "qcom,adreno" }, > + { .compatible = "qcom,mdp4" }, > + { .compatible = "qcom,mdss" }, > + { .compatible = "qcom,sc7180-mdss" }, > + { .compatible = "qcom,sdm845-mdss" }, > + { } > +}; > + > +static int qcom_smmu_def_domain_type(struct device *dev) > +{ > + const struct of_device_id *match = > + of_match_device(qcom_smmu_client_of_match, dev); > + > + return match ? IOMMU_DOMAIN_IDENTITY : 0; > +} > + > static int qcom_sdm845_smmu500_reset(struct arm_smmu_device *smmu) > { > int ret; > @@ -41,6 +59,7 @@ static int qcom_smmu500_reset(struct arm_smmu_device *smmu) > } > > static const struct arm_smmu_impl qcom_smmu_impl = { > + .def_domain_type = qcom_smmu_def_domain_type, > .reset = qcom_smmu500_reset, > }; > > diff --git a/drivers/iommu/arm-smmu.h b/drivers/iommu/arm-smmu.h > index 8d1cd54d82a6..d172c024be61 100644 > --- a/drivers/iommu/arm-smmu.h > +++ b/drivers/iommu/arm-smmu.h > @@ -386,6 +386,7 @@ struct arm_smmu_impl { > int (*init_context)(struct arm_smmu_domain *smmu_domain); > void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync, > int status); > + int (*def_domain_type)(struct device *dev); > }; > > static inline void __iomem *arm_smmu_page(struct arm_smmu_device *smmu, int n) > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu