Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1083097pxb; Fri, 26 Feb 2021 02:00:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzK9G/7Mg+VW6EQ1n6z9Upqdv+fSNtNmwtT91KmOkxQRlB8LkscA7CLYSoXUioPmekmlypW X-Received: by 2002:a17:906:39d9:: with SMTP id i25mr2492773eje.226.1614333616324; Fri, 26 Feb 2021 02:00:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614333616; cv=none; d=google.com; s=arc-20160816; b=OejAxzCKIzS3Kt8fKY7YZznLCzBqIWvbO7KRL4pfg9WbXGMJeOAMFhycCuhPKA/m/j fuZPs766hM4lJNJZCiDXCAEBOH4e5FFjYhJyFtA+C4HtCfqmXdcBPCStTpsJmPCPmZgj lwQFZZ+9+/GFcikPJ86Iu6zER1z9I5ipUcxMMAWVvovxrQYxtDIOj1e4XtJ9M3tesKBJ QzpCBXbVt5sKE3HaSJ5IgfBBw7Yq0WnVNDhCi3juYtsON/2yEdFBa50AkxBcXAB/XdYK KlIxkHl2HvxMqWglpV8DmO7clY9w/GluMIcASZsov3aOEjVD8T7m9ZXVsEdG6bfJQJAn hXqw== 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=trMRyJGV8+dYg3p+l6QhkEnWvTbbOoxge+SBYlBEB0I=; b=NmN/SJwm4RW7WGAe2jC7ZP7A0rH1bPNYrvljbuTORb1xQvWsHdhWg+BPC39VyCQsOs dime0dbekYAc1BV7cvNbNxTOaW88ZxWdS7y09YCX7tPv0yMmxw/nH8opADWcY81d6xBm qYTOQfnFrRClaA7i9QqzGz7qGJhm3QQrJ7OHshFAnXKw03OjtbXZn//GHCIq2QsHruqi RVIztbPxVSCfSqM3UsVljnNFYjpa1rZfJtjNRG7B1SkI8nzHJz/BPFD36YqUik8bpV1n qqOlU2CFGMuvPT7eJE6ItK1Y//EmtZmYsizSyrDA10WPmWF/GGiLTVrh5feYCZmLApDE degQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=dW9RRvNc; 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 f17si5273161edw.291.2021.02.26.01.59.53; Fri, 26 Feb 2021 02:00:16 -0800 (PST) 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=dW9RRvNc; 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 S230438AbhBZJ67 (ORCPT + 99 others); Fri, 26 Feb 2021 04:58:59 -0500 Received: from z11.mailgun.us ([104.130.96.11]:51893 "EHLO z11.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230001AbhBZJ4y (ORCPT ); Fri, 26 Feb 2021 04:56:54 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1614333395; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=trMRyJGV8+dYg3p+l6QhkEnWvTbbOoxge+SBYlBEB0I=; b=dW9RRvNcOwB9Hs3+L34xbh+8AWOnD3nlfdOybtdO27ExoHUMvy9bVmaHOHmxi0S04+fb0Ff3 JKT5VM/0kl6Da+Mc/ZxkbzqxouFtQqAX4EXkPxr4f4ry0Of/pxfJmhkiL6ItRs2V1FnPQY7O 6861B6RyGsWLlpFG6yBF0SVr4Kg= X-Mailgun-Sending-Ip: 104.130.96.11 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-n05.prod.us-east-1.postgun.com with SMTP id 6038c5b82658fcb873966edc (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 26 Feb 2021 09:56:08 GMT Sender: saiprakash.ranjan=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B68FCC43461; Fri, 26 Feb 2021 09:56:07 +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, URIBL_BLOCKED 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 E97F4C433CA; Fri, 26 Feb 2021 09:56:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E97F4C433CA 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 , Jordan Crouse , Rob Clark , Akhil P Oommen , Bjorn Andersson Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Sai Prakash Ranjan Subject: [PATCHv2 2/2] iommu/arm-smmu-qcom: Move the adreno smmu specific impl earlier Date: Fri, 26 Feb 2021 15:25:40 +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 --- 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