Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp800493pxf; Thu, 11 Mar 2021 15:33:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJzGuC5JGEZfT2q4US8cdWePdZ152aHgsLu5bCGlN7cEc6Zn+gxpIwoHdOSLdCfNOhXjUZVj X-Received: by 2002:a17:906:13c4:: with SMTP id g4mr5609108ejc.390.1615505587488; Thu, 11 Mar 2021 15:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615505587; cv=none; d=google.com; s=arc-20160816; b=060V/Rt0goN5NTr1xKUa/+vBMjk2xZyPZ48VeJA9ifw3H00tRoksIcqDJ3kRNS3MqP rUzKs2UiPkg8OZDJAi4NUcHyP97lWGph0u/WjDBGpKQKroCYYnCJl/WGYBDqt/lAdnjy VxifDaHTeNOx8muIusNqx+Di1nrMbtRklIHhV/yEskm9SriMqnICEGNvlWjuTOsnawd5 FQKAegDLak6bV0uM5mV3PdAkyxB6M6mWilgd3WqJiDdqVkDgRIWotJV6WT9GhZValq44 EE57PhdnKaSvOCM/u6wonH/9fEGHBftGyHE8fMbhjKNWLfuq69nYCRgWgkHdFWwbUIeW DtDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=491rIB6TbnxYKUbmp43lo7687n1uls9e/9Yv3zZ/+/M=; b=qGQ8Ys4BvbZdD3g7vWbytdA0DL4Lt8wy5Pqe3YYkmtbgypn1jnsHhB1a3dJg7nGu/M vQ/A2dPSfBTR6UCC0WCf9K0CHTHF9JRohSbfgqF+G2sih95VToQoEYQpWsCKmjQi6zSO HEDS44y745Tv7zXBXmsOL1HUINluE+0A3WfBt/wLN73uao9+nc0Zpb3MOH3nHHWKTRju 6Fh5UYv7K1Cr5L8aVyHHJAQWC6LnswWQTDUdjS3zxr7v+kOFCV6DbOTIp17syfrO2TiN 1zlw3kdnPPJuQEQBGpG4jXA41u3ppRdUdyi4gbGK807OFK+khOrXHn8i94/uoJyGkuvP LI2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SMNVB6H5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si2777628ejt.132.2021.03.11.15.32.45; Thu, 11 Mar 2021 15:33:07 -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=@linaro.org header.s=google header.b=SMNVB6H5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229488AbhCKX3v (ORCPT + 99 others); Thu, 11 Mar 2021 18:29:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbhCKX32 (ORCPT ); Thu, 11 Mar 2021 18:29:28 -0500 Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com [IPv6:2607:f8b0:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 582E4C061574 for ; Thu, 11 Mar 2021 15:29:28 -0800 (PST) Received: by mail-ot1-x331.google.com with SMTP id t23-20020a0568301e37b02901b65ab30024so485959otr.4 for ; Thu, 11 Mar 2021 15:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=491rIB6TbnxYKUbmp43lo7687n1uls9e/9Yv3zZ/+/M=; b=SMNVB6H5xpNSP+Ntt/E41bnstJS/mub/pjKkhJYxD/9m/0JdTt1Sc/JeacWsclnhIa saZlM35oEZUGd6GLJc1B0Z8fOHlmarLVRa320OirgMyuk3CMzsKTN3VBH5KUOauAu923 d2ymYxIDPYCBsoGohPV+44DV5Vg2pH3P1pSno36NGadsaTHK9d6OhoL/AnG1QXTXQjq6 WfezMMjeqBUM6N2bVJmXtEz+LPF75d9wrFoBjlOAkTBvA8q7hY2kgy7D9mi3SqDP3npX UArOx0eMWnVGobKk8hawyEDO7rE3C0zoYDGB3jhrj15GrhugPdE6laoOn+2Xy00KuXrQ srhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=491rIB6TbnxYKUbmp43lo7687n1uls9e/9Yv3zZ/+/M=; b=rrG1WEyn/Iw7ri3ZZ3bxwoG4n5LTFGcD3ovSpyGsX/iswa2/CyV1w/RNeyFXV/GMLM RE5KvVTiFdCfMXsorYouKNp5/G91bN98QhMpAADuL8GqnGCXsPFpbR/W1mKLEH99DMnl /O3xVlO13lJDWQTJPuh/47bQeJ5P8ZneWWaMIBudiS7ZglAXIpXaqsnCYEQBTKCOOhd0 qwYuxqMuF5p6pUMsq7Oz3smyO7ruopO4jlJacHNY94PC33Zn2HwjeZD5aRlgYXJESrKp nEj6m/TK31HQ04QmTC377ouRc8qpOJtKO/wMFAZPh41OCJRzfYEPWYPTslWh7QzwQy8v EVwQ== X-Gm-Message-State: AOAM531bXrNDkKa9KIzKmeUYclH+PDQsxR5pT8JJlMGmSw82DhsdoUy5 yOJ1fWMQnyR9lPimevu0zxAn5A== X-Received: by 2002:a05:6830:101a:: with SMTP id a26mr1116383otp.68.1615505367766; Thu, 11 Mar 2021 15:29:27 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id l190sm639403oig.39.2021.03.11.15.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 15:29:27 -0800 (PST) Date: Thu, 11 Mar 2021 17:29:25 -0600 From: Bjorn Andersson To: Sai Prakash Ranjan Cc: akhilpo@codeaurora.org, iommu@lists.linux-foundation.org, jcrouse@codeaurora.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, robdclark@gmail.com, robin.murphy@arm.com, will@kernel.org Subject: Re: [PATCHv2 2/2] iommu/arm-smmu-qcom: Move the adreno smmu specific impl earlier Message-ID: References: <20210227135321.420-1-saiprakash.ranjan@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210227135321.420-1-saiprakash.ranjan@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 27 Feb 07:53 CST 2021, Sai Prakash Ranjan wrote: > Hi Bjorn, > > On 2021-02-27 00:44, Bjorn Andersson wrote: > > On Fri 26 Feb 12:23 CST 2021, Rob Clark wrote: > > > > > > The current logic picks one of: > > 1) is the compatible mentioned in qcom_smmu_impl_of_match[] > > 2) is the compatible an adreno > > 3) no quirks needed > > > > The change flips the order of these, so the only way I can see this > > change affecting things is if we expected a match on #2, but we got one > > on #1. > > > > Which implies that the instance that we want to act according to the > > adreno impl was listed in qcom_smmu_impl_of_match[] - which either is > > wrong, or there's a single instance that needs both behaviors. > > > > (And I believe Jordan's answer confirms the latter - there's a single > > SMMU instance that needs all them quirks at once) > > > > Let me go through the problem statement in case my commit message wasn't > clear. There are two SMMUs (APSS and GPU) on SC7280 and both are SMMU500 > (ARM SMMU IP). > > APSS SMMU compatible - ("qcom,sc7280-smmu-500", "arm,mmu-500") > GPU SMMU compatible - ("qcom,sc7280-smmu-500", "qcom,adreno-smmu", "arm,mmu-500") > > Now if we take SC7180 as an example, GPU SMMU was QSMMU(QCOM SMMU IP) > and APSS SMMU was SMMU500(ARM SMMU IP). > > APSS SMMU compatible - ("qcom,sc7180-smmu-500", "arm,mmu-500") > GPU SMMU compatible - ("qcom,sc7180-smmu-v2", "qcom,adreno-smmu", "qcom,smmu-v2") > > Current code sequence without this patch, > > if (of_match_node(qcom_smmu_impl_of_match, np)) > return qcom_smmu_create(smmu, &qcom_smmu_impl); > > if (of_device_is_compatible(np, "qcom,adreno-smmu")) > return qcom_smmu_create(smmu, &qcom_adreno_smmu_impl); > > Now if we look at the compatible for SC7180, there is no problem because > the APSS SMMU will match the one in qcom_smmu_impl_of_match[] and GPU SMMU > will match "qcom,adreno-smmu" because the compatible strings are different. > But for SC7280, both the APSS SMMU and GPU SMMU compatible("qcom,sc7280-smmu-500") > are same. So GPU SMMU will match with the one in qcom_smmu_impl_of_match[] > i.e.., "qcom,sc7280-smmu-500" which functionally doesn't cause any problem > but we will miss settings for split pagetables which are part of GPU SMMU > specific implementation. > > We can avoid this with yet another new compatible for GPU SMMU something like > "qcom,sc7280-adreno-smmu-500" but since we can handle this easily in the > driver and since the IPs are same, meaning if there was a hardware quirk > required, then we would need to apply to both of them and would this additional > compatible be of any help? > No, I think you're doing the right thing of having them both. I just didn't remember us doing that. > Coming to the part of quirks now, you are right saying both SMMUs will need > to have the same quirks in SC7280 and similar others where both are based on > same IPs but those should probably be *hardware quirks* and if they are > software based like the S2CR quirk depending on the firmware, then it might > not be applicable to both. In case if it is applicable, then as Jordan mentioned, > we can add the same quirks in GPU SMMU implementation. > I do suspect that at some point (probably sooner than later) we'd have to support both inheriting of stream from the bootloader and the Adreno "quirks" in the same instance. But for now this is okay to me. Regards, Bjorn