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.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 8DCC4C3815B for ; Mon, 20 Apr 2020 16:57:41 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 5D37720782 for ; Mon, 20 Apr 2020 16:57:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Juy/ycdt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D37720782 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SlKAX99UzsmwHOQCDfOYs93um1J4/BpQBsbDb/GoFSQ=; b=Juy/ycdt4qrfM5JZo34aDqU8D lOqZD0LROf9dT9tRnk2Q5i2KvVY/sNZe5MgFGSRk9DdYVCl4tGPEryDYlL59TXE5tjTnlwSUpH9tl kTEo7OAPDfglYbalVaoWYynn8zN91OYSY0KX6TXrlzgJazDChpSxD7CkSHS1uPPfaorfVB7KLCsWe yYQd4My0xXkjK58gtLrT1AtBnT4O6tT+eOLGQ+7Tm+eAwPzUftWVuID82VsQVHgE4QNtFrVbnMi7O EDAmjpsTJvwJjbOoPgj1BPhPcPuf/omIZrsHhYG9FbvRtApB2l7BeTo1ZmQZkBcXLUEQsU7WqF5Lo r34t1bIug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQZjk-0003Pq-RB; Mon, 20 Apr 2020 16:57:36 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jQZjZ-0003Oz-RA for linux-arm-kernel@lists.infradead.org; Mon, 20 Apr 2020 16:57:35 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200420_095733_567951_DA801FBD X-CRM114-Status: GOOD ( 19.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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) > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel