Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3069558pxb; Mon, 19 Apr 2021 23:06:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaJmpCduJZdUPQUXeAp1zeac7rByE13l9ejJOAJ8Nw+GGE+cpQ1ioqfdzYWdev7Y/X/ntr X-Received: by 2002:a17:90a:13c3:: with SMTP id s3mr3211622pjf.59.1618898817655; Mon, 19 Apr 2021 23:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618898817; cv=none; d=google.com; s=arc-20160816; b=xlXv7vYxi+wkElYLK8WOMWrPOh6tQh5ueQKHlzyfLeDDZf0+lDQKPR53ib7feMIAsv jgqy2wFCzhg3UON3vbTaKxU2f8S0eDoOO05pwTxwE9yhORprSTNydnTUh1JzpDnl6tZx PeGLKixffHWuOyPP/eORnbBFG0ORKe27reEOAVlyPPfQubXNry5LPL5pN24dymb7NeFn ZZwmoukUWVkiM4+VGuaFPnffMq0GYmxWpUucKHXCNL2ep+3zYHzZFpW/1WC5WKn3X3mv XSyizzVh6B6T7Ix8o8Ir2RvJAD2ynBPT6fugB49sPJ2JfUrP0Zl0+aW4EFVLOyI9MYPP AHCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:sender:dkim-signature; bh=TX5ZhpXY1Z4ybv7ySUZwbowC+tCeYwO568zmEFD04CY=; b=A5eHHUu6g7+BMyqYkXUYoyp7fyXgGQ6957qQngB7FPFPP5HwAVmmGoW4KkJckpALqE 0tyDaEDJIfnB/yQWuEnUhEer97vxH0HCnuFzHSIf3BzBYYmbY7HyPhcJNuvzWFoGpVNW AI9jUlEt7GmBCVLz5UL4UTWjxhszDG4UMux2FXEQet3GJOd2kdvY+jU+o24yW1jA4Awr EUjcLyeMVINyk+rJIwZPDgYue7pvI5R5zpX3i/nSxeaSL7AgQZCzSay01qsoTrEYnbKn LmFgOs0BeDvk4Z0dH43WJ5M0fQa75yNPYq/fBsx3jKGhhg4D0Txe+nK77E3pkcSrbUKh DubA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=aYBm7f2X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w132si18143354pfd.78.2021.04.19.23.06.44; Mon, 19 Apr 2021 23:06:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=aYBm7f2X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229981AbhDTGGI (ORCPT + 99 others); Tue, 20 Apr 2021 02:06:08 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:35548 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230023AbhDTGGD (ORCPT ); Tue, 20 Apr 2021 02:06:03 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1618898733; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=TX5ZhpXY1Z4ybv7ySUZwbowC+tCeYwO568zmEFD04CY=; b=aYBm7f2Xwag5kuKVwHBp/IdOS1nbw/x4967nZfiRUhZSmYaBzqMfcW1d4ukCncNlDwGqkpCg ai9EydaTKSgxLtYmrFF2oTrlma/EWfOku9IDrQiBm9t90kL6+duCsV9lmcSE4FcOc6L8BBN/ 0QzsiJZriTT+UimuBcFqm5aUIho= X-Mailgun-Sending-Ip: 198.61.254.9 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-east-1.postgun.com with SMTP id 607e6f2ca817abd39ad74ab0 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 20 Apr 2021 06:05:32 GMT Sender: saiprakash.ranjan=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C3658C43217; Tue, 20 Apr 2021 06:05:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from blr-ubuntu-253.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: saiprakash.ranjan) by smtp.codeaurora.org (Postfix) with ESMTPSA id 7E2BDC433D3; Tue, 20 Apr 2021 06:05:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 7E2BDC433D3 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=saiprakash.ranjan@codeaurora.org From: Sai Prakash Ranjan To: Will Deacon , Robin Murphy , Joerg Roedel Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Jordan Crouse , Rob Clark , Akhil P Oommen , Bjorn Andersson , Sai Prakash Ranjan Subject: [PATCHv3 2/2] iommu/arm-smmu-qcom: Move the adreno smmu specific impl earlier Date: Tue, 20 Apr 2021 11:34:57 +0530 Message-Id: X-Mailer: git-send-email 2.29.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Adreno(GPU) SMMU and APSS(Application Processor SubSystem) SMMU both implement "arm,mmu-500" in some QTI SoCs and to run through adreno smmu specific implementation such as enabling split pagetables support, we need to match the "qcom,adreno-smmu" compatible first before apss smmu or else we will be running apps smmu implementation for adreno smmu and the additional features for adreno smmu is never set. For ex: we have "qcom,sc7280-smmu-500" compatible for both apps and adreno smmu implementing "arm,mmu-500", so the adreno smmu implementation is never reached because the current sequence checks for apps smmu compatible(qcom,sc7280-smmu-500) first and runs that specific impl and we never reach adreno smmu specific implementation. Suggested-by: Akhil P Oommen Signed-off-by: Sai Prakash Ranjan Reviewed-by: Bjorn Andersson Acked-by: Jordan Crouse --- drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c index bea3ee0dabc2..03f048aebb80 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -345,11 +345,17 @@ struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu) { const struct device_node *np = smmu->dev->of_node; - if (of_match_node(qcom_smmu_impl_of_match, np)) - return qcom_smmu_create(smmu, &qcom_smmu_impl); - + /* + * Do not change this order of implementation, i.e., first adreno + * smmu impl and then apss smmu since we can have both implementing + * arm,mmu-500 in which case we will miss setting adreno smmu specific + * features if the order is changed. + */ if (of_device_is_compatible(np, "qcom,adreno-smmu")) return qcom_smmu_create(smmu, &qcom_adreno_smmu_impl); + if (of_match_node(qcom_smmu_impl_of_match, np)) + return qcom_smmu_create(smmu, &qcom_smmu_impl); + return smmu; } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation