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=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 7B57CC2BA19 for ; Tue, 14 Apr 2020 16:18:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 581DE20732 for ; Tue, 14 Apr 2020 16:18:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="TEn3Gh/v" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390954AbgDNQSl (ORCPT ); Tue, 14 Apr 2020 12:18:41 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:17347 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733258AbgDNQSk (ORCPT ); Tue, 14 Apr 2020 12:18:40 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586881118; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=pjzwfTcChHnISigCJHUetoRvOtw8Q36XYbff0pt71XY=; b=TEn3Gh/vOZ1W+lAoWJtGBRzzb0cAdeQgMqgbjCHBbOH7U5crXhaFQJPZzKBZ1TMuhWKitAHv ocxc6GOkbT+p3sqjqno/GVStlRhsDaPTPwasostbr6mAX9+IiyRxzXiLrE0TfgLJvNmZidkM mgUQip1QiZZVHRcjUGCl78fJoDg= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e95e25e.7f4c0c536228-smtp-out-n04; Tue, 14 Apr 2020 16:18:38 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 06F62C4478F; Tue, 14 Apr 2020 16:18:37 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id 28FA7C433F2; Tue, 14 Apr 2020 16:18:37 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 14 Apr 2020 21:48:37 +0530 From: Sai Prakash Ranjan To: Evan Green Cc: Will Deacon , Robin Murphy , Joerg Roedel , Jordan Crouse , Rob Clark , iommu@lists.linux-foundation.org, linux-arm Mailing List , LKML , linux-arm-msm , Stephen Boyd , Matthias Kaehlcke , Bjorn Andersson , Rajendra Nayak , Tomasz Figa Subject: Re: [PATCH 2/2] iommu/arm-smmu: Allow client devices to select direct mapping In-Reply-To: References: <813cc5b2da10c27db982254b274bf26008a9e6da.1579692800.git.saiprakash.ranjan@codeaurora.org> Message-ID: X-Sender: saiprakash.ranjan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi Evan, On 2020-04-14 04:42, Evan Green wrote: > On Wed, Jan 22, 2020 at 3:48 AM 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. >> >> Signed-off-by: Jordan Crouse >> Co-developed-by: Sai Prakash Ranjan >> Signed-off-by: Sai Prakash Ranjan >> --- >> drivers/iommu/arm-smmu-qcom.c | 39 >> +++++++++++++++++++++++++++++++++++ >> drivers/iommu/arm-smmu.c | 3 +++ >> drivers/iommu/arm-smmu.h | 5 +++++ >> 3 files changed, 47 insertions(+) >> >> diff --git a/drivers/iommu/arm-smmu-qcom.c >> b/drivers/iommu/arm-smmu-qcom.c >> index 64a4ab270ab7..ff746acd1c81 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,43 @@ struct qcom_smmu { >> struct arm_smmu_device smmu; >> }; >> >> +static const struct arm_smmu_client_match_data qcom_adreno = { >> + .direct_mapping = true, >> +}; >> + >> +static const struct arm_smmu_client_match_data qcom_mdss = { >> + .direct_mapping = true, > > I don't actually see direct_mapping being used. Shouldn't this member > be checked somewhere? > Thanks for spotting this, my bad. It should be checked in qcom_smmu_request_domain(). diff --git a/drivers/iommu/arm-smmu-qcom.c b/drivers/iommu/arm-smmu-qcom.c index ff746acd1c81..3ff62ca13ad5 100644 --- a/drivers/iommu/arm-smmu-qcom.c +++ b/drivers/iommu/arm-smmu-qcom.c @@ -43,7 +43,7 @@ static int qcom_smmu_request_domain(struct device *dev) const struct arm_smmu_client_match_data *client; client = qcom_smmu_client_data(dev); - if (client) + if (client && client->direct_mapping) iommu_request_dm_for_dev(dev); return 0; -Sai -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation 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=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 D5204C2BB85 for ; Tue, 14 Apr 2020 16:18:43 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 A54F920678 for ; Tue, 14 Apr 2020 16:18:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="EBVOg6X/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A54F920678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 80EA58511F; Tue, 14 Apr 2020 16:18:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a04WRPOvUkiZ; Tue, 14 Apr 2020 16:18:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0FCD884EDB; Tue, 14 Apr 2020 16:18:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EA2A4C089E; Tue, 14 Apr 2020 16:18:42 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id DB481C0172 for ; Tue, 14 Apr 2020 16:18:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C281B84737 for ; Tue, 14 Apr 2020 16:18:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EtpCIargEUu0 for ; Tue, 14 Apr 2020 16:18:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail26.static.mailgun.info (mail26.static.mailgun.info [104.130.122.26]) by whitealder.osuosl.org (Postfix) with ESMTPS id 4E50D81B8A for ; Tue, 14 Apr 2020 16:18:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586881119; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=pjzwfTcChHnISigCJHUetoRvOtw8Q36XYbff0pt71XY=; b=EBVOg6X/p8Plyh7uVYSdxlpC70ArYFEMk51fgEK/B/bp2K3IC3orEv8eF9AUu4Su42r8ezrX K1qYYCFrTbBc9M/3Zqh/IMWsCue72TzGg9VhmaiDSgEktaKEupqbWlzfvEoULpBcPWQj0zwA ypoXb7FqSNiEGrGW/FfJyVMDAuU= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI3NDkwMCIsICJpb21tdUBsaXN0cy5saW51eC1mb3VuZGF0aW9uLm9yZyIsICJiZTllNGEiXQ== Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e95e25e.7f500d6a9730-smtp-out-n02; Tue, 14 Apr 2020 16:18:38 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id E87E4C432C2; Tue, 14 Apr 2020 16:18:37 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id 28FA7C433F2; Tue, 14 Apr 2020 16:18:37 +0000 (UTC) MIME-Version: 1.0 Date: Tue, 14 Apr 2020 21:48:37 +0530 From: Sai Prakash Ranjan To: Evan Green Subject: Re: [PATCH 2/2] iommu/arm-smmu: Allow client devices to select direct mapping In-Reply-To: References: <813cc5b2da10c27db982254b274bf26008a9e6da.1579692800.git.saiprakash.ranjan@codeaurora.org> Message-ID: X-Sender: saiprakash.ranjan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Cc: Rajendra Nayak , Will Deacon , iommu@lists.linux-foundation.org, LKML , Matthias Kaehlcke , Bjorn Andersson , linux-arm-msm , Stephen Boyd , Robin Murphy , linux-arm Mailing List 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" Hi Evan, On 2020-04-14 04:42, Evan Green wrote: > On Wed, Jan 22, 2020 at 3:48 AM 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. >> >> Signed-off-by: Jordan Crouse >> Co-developed-by: Sai Prakash Ranjan >> Signed-off-by: Sai Prakash Ranjan >> --- >> drivers/iommu/arm-smmu-qcom.c | 39 >> +++++++++++++++++++++++++++++++++++ >> drivers/iommu/arm-smmu.c | 3 +++ >> drivers/iommu/arm-smmu.h | 5 +++++ >> 3 files changed, 47 insertions(+) >> >> diff --git a/drivers/iommu/arm-smmu-qcom.c >> b/drivers/iommu/arm-smmu-qcom.c >> index 64a4ab270ab7..ff746acd1c81 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,43 @@ struct qcom_smmu { >> struct arm_smmu_device smmu; >> }; >> >> +static const struct arm_smmu_client_match_data qcom_adreno = { >> + .direct_mapping = true, >> +}; >> + >> +static const struct arm_smmu_client_match_data qcom_mdss = { >> + .direct_mapping = true, > > I don't actually see direct_mapping being used. Shouldn't this member > be checked somewhere? > Thanks for spotting this, my bad. It should be checked in qcom_smmu_request_domain(). diff --git a/drivers/iommu/arm-smmu-qcom.c b/drivers/iommu/arm-smmu-qcom.c index ff746acd1c81..3ff62ca13ad5 100644 --- a/drivers/iommu/arm-smmu-qcom.c +++ b/drivers/iommu/arm-smmu-qcom.c @@ -43,7 +43,7 @@ static int qcom_smmu_request_domain(struct device *dev) const struct arm_smmu_client_match_data *client; client = qcom_smmu_client_data(dev); - if (client) + if (client && client->direct_mapping) iommu_request_dm_for_dev(dev); return 0; -Sai -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-6.8 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,URIBL_BLOCKED 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 9BA7CC2BA19 for ; Tue, 14 Apr 2020 16:19:01 +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 6D15C20678 for ; Tue, 14 Apr 2020 16:19:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pFxUs2Gb"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="dVbhOHBA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D15C20678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org 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:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Jr0kKRVO3+NHw9YwCkKxrrlBdg1O5TBRtdoVcxG0ZF0=; b=pFxUs2GbgIQU/BE37+QVXvrR/ aAhGBKdXkk2Jtexa8RgwdKd9cBJzry7yDrydT/kzTxuMIeG/yPszfK0wa+qS626VJVUz9lQgB+nGC YCtIeHUFfIWOafa8P5sbr+VFudRxzxB6vzgYRW2zNbtVe7bVHv5d5KshR9RX/6UEusbcamQWDlFlP Dgsvieah1gt3kCAtL2Flwyi6cgYd6Bz4Lew3eadqh2jE0jK8gZtxuGOahavKfRac/Y4WNswhcVrGV NIWNXth1IWn4LXH9J0qjwSOzKTEBQBNfYx3BbdgNA9FVNPjiSQnB9PF5KKNLC71BCatjh3o2WF7Ok I0oNzvO4A==; 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 1jOOH6-00012j-3o; Tue, 14 Apr 2020 16:19:00 +0000 Received: from mail26.static.mailgun.info ([104.130.122.26]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOOGv-00011b-01 for linux-arm-kernel@lists.infradead.org; Tue, 14 Apr 2020 16:18:58 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1586881131; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=pjzwfTcChHnISigCJHUetoRvOtw8Q36XYbff0pt71XY=; b=dVbhOHBAW8S1XODH+8GNu1JH9oKKrg36XUTrpnURORgU8CJbwRSCuwMGvpu3l5OpWw0Iwern iB+wdZcokEhzcYRiOgyiqXkImoEZE39WauaOar1ZM0EYZVbkt+XZzzdyNJ3LPI5466WoDUzo 5dEE00X8fc4sKNWUpNJLDFaeaCY= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e95e25e.7f0219a64d88-smtp-out-n05; Tue, 14 Apr 2020 16:18:38 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 02A82C44788; Tue, 14 Apr 2020 16:18:37 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id 28FA7C433F2; Tue, 14 Apr 2020 16:18:37 +0000 (UTC) MIME-Version: 1.0 Date: Tue, 14 Apr 2020 21:48:37 +0530 From: Sai Prakash Ranjan To: Evan Green Subject: Re: [PATCH 2/2] iommu/arm-smmu: Allow client devices to select direct mapping In-Reply-To: References: <813cc5b2da10c27db982254b274bf26008a9e6da.1579692800.git.saiprakash.ranjan@codeaurora.org> Message-ID: X-Sender: saiprakash.ranjan@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200414_091851_610385_A3398F35 X-CRM114-Status: GOOD ( 18.35 ) 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: Rob Clark , Tomasz Figa , Rajendra Nayak , Will Deacon , Joerg Roedel , iommu@lists.linux-foundation.org, LKML , Jordan Crouse , Matthias Kaehlcke , Bjorn Andersson , linux-arm-msm , Stephen Boyd , Robin Murphy , linux-arm Mailing List 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 Hi Evan, On 2020-04-14 04:42, Evan Green wrote: > On Wed, Jan 22, 2020 at 3:48 AM 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. >> >> Signed-off-by: Jordan Crouse >> Co-developed-by: Sai Prakash Ranjan >> Signed-off-by: Sai Prakash Ranjan >> --- >> drivers/iommu/arm-smmu-qcom.c | 39 >> +++++++++++++++++++++++++++++++++++ >> drivers/iommu/arm-smmu.c | 3 +++ >> drivers/iommu/arm-smmu.h | 5 +++++ >> 3 files changed, 47 insertions(+) >> >> diff --git a/drivers/iommu/arm-smmu-qcom.c >> b/drivers/iommu/arm-smmu-qcom.c >> index 64a4ab270ab7..ff746acd1c81 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,43 @@ struct qcom_smmu { >> struct arm_smmu_device smmu; >> }; >> >> +static const struct arm_smmu_client_match_data qcom_adreno = { >> + .direct_mapping = true, >> +}; >> + >> +static const struct arm_smmu_client_match_data qcom_mdss = { >> + .direct_mapping = true, > > I don't actually see direct_mapping being used. Shouldn't this member > be checked somewhere? > Thanks for spotting this, my bad. It should be checked in qcom_smmu_request_domain(). diff --git a/drivers/iommu/arm-smmu-qcom.c b/drivers/iommu/arm-smmu-qcom.c index ff746acd1c81..3ff62ca13ad5 100644 --- a/drivers/iommu/arm-smmu-qcom.c +++ b/drivers/iommu/arm-smmu-qcom.c @@ -43,7 +43,7 @@ static int qcom_smmu_request_domain(struct device *dev) const struct arm_smmu_client_match_data *client; client = qcom_smmu_client_data(dev); - if (client) + if (client && client->direct_mapping) iommu_request_dm_for_dev(dev); return 0; -Sai -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel