Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4055763pxj; Tue, 8 Jun 2021 05:33:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZYEOVePqLJxLWSxaw5Ekfe5oME48z3iWOyDLuL8/S905PIo6m4py9nxCnS/ImAmZV0CE0 X-Received: by 2002:a17:906:1912:: with SMTP id a18mr23330229eje.117.1623155635845; Tue, 08 Jun 2021 05:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623155635; cv=none; d=google.com; s=arc-20160816; b=NCQcs3vtZAfAK6DMgUXkKUehJctf/MSScUPAcLk3xOaOjxlk9qdgrej6i4T+bPOFkp xAprCQewacmdt8pVNpvdp2KhawqVNRxpbxydYRfPk6qynU1eVRRSeQIozF+m5u3wd4Ws d0ooYXmUu2AFEQ83dl+FBQezR2YaCn8vPS1c5Nha2SKDtRve3e8I/Zbz37ORgs35KlC0 FGdPjmB/gdKw83WMCS2C1ZK5yy6btGfUg8U+0PYqETvzUEodFgEVs34b+emuBQuu+xfo dolzz+K0W8BnFdURK9ON/J4OwPaCEVfSovPqgNZPoZY2jLGXBaj5BWRhXtvd2tQYtVdE 6eKA== 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=UenV7iSFYEAFZ8DRh0vWD0hvTbYkw2dn+QBSNeAfUeI=; b=aCfbh421ACSKejRZa0VqD6vkZMf5/2r/YWkeGW311lRxHrjS95RgGMrQRBknVnzkjk Se7al3O419LSz2pCfwaaRPxTYuAIJ4Wji98Ez7SEEXWKDOXqUGtBljfPlJwm+qbr3BG5 20fZq7oBVelLfL8gTJi6CT+zvLfghK0yJh7D8b55OmyjIYVflAIVU3ZSqCuQxg0t/Ehp K/D8ZvD8PG9syVub9yAwA74M/FpZdaCyk7ZlN+W3GZYLRUVJ5u+M9lQR41CvNN24OZPX 01zS1s5JU6OzaLOZ2p1FwBALBFXbdiWkjw0GlMputMmHGuGA58b5Z/xshbS8IIbEcPPn xDUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=OqMXFn5d; 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 m19si3883149edd.490.2021.06.08.05.33.32; Tue, 08 Jun 2021 05:33:55 -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=OqMXFn5d; 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 S232673AbhFHMdG (ORCPT + 99 others); Tue, 8 Jun 2021 08:33:06 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:16238 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232642AbhFHMdA (ORCPT ); Tue, 8 Jun 2021 08:33:00 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623155467; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=UenV7iSFYEAFZ8DRh0vWD0hvTbYkw2dn+QBSNeAfUeI=; b=OqMXFn5dQW7MkdOz6hDc7RAPzS4UzhCRP18+Igxdj3j8jiPT/nFaIlhT2jF+AW/vDzYtlFuC 7aW8UzPs3onl5BemOnLx4jqb1lT2W2wJiy6GyGRxtxJ6d9GLYhLMXWqikTQ7ABEL2uszok+6 UdgcpOJFOx2tNd2tA2oQ8Y2bsXc= X-Mailgun-Sending-Ip: 69.72.43.7 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-n02.prod.us-west-2.postgun.com with SMTP id 60bf62e82eaeb98b5ebe2521 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 08 Jun 2021 12:30:32 GMT Sender: saiprakash.ranjan=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 6A642C43460; Tue, 8 Jun 2021 12:30:32 +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 D17CDC43217; Tue, 8 Jun 2021 12:30:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D17CDC43217 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 , Sai Prakash Ranjan , Bjorn Andersson , Jordan Crouse Subject: [PATCHv4 2/2] iommu/arm-smmu-qcom: Move the adreno smmu specific impl Date: Tue, 8 Jun 2021 18:00:07 +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 e93b5dbda7de..83c32566bf64 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu-qcom.c @@ -370,11 +370,17 @@ struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu) return qcom_smmu_create(smmu, &qcom_smmu_impl); } - 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