From patchwork Fri Nov 11 13:55:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 18789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp754428wru; Fri, 11 Nov 2022 06:00:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf5GfYlTjRotMUUDLBDsdwswBcXGcuE28GL6hEakV23It2Yd7Yh27jL+NQrMrus2xyaJ/3HD X-Received: by 2002:a17:906:4085:b0:7ae:bfeb:2219 with SMTP id u5-20020a170906408500b007aebfeb2219mr1927993ejj.145.1668175234991; Fri, 11 Nov 2022 06:00:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175234; cv=none; d=google.com; s=arc-20160816; b=RWz0dfiLQZMCzmhQLQ8kIC16vs882rQPQnlwAAtrVR4gBW1qNjlDy1S8gYp4rIneL9 JVXXJlbGbvd9a2GfEHQ96S6yRIfqScm+bzuViy8dj4UD+yU50GQvQqg9GRf6tEBJeETB nYiftHMuJezohsGvyvepyIBwmDnpBY4ctSt6T8qRI9nqr4lTm4IZUfL3COWN0fEbLMPs jw7fTVXEIH4brPMK/ASN8jM67C7o0FK8YMn1bNPDhVu3sqec7cd/+MboA/85wlwvUkF+ RjuqToH9YndGvWLP6NwNrLYK2FQgM95Y0dCQbvxg5qk8sGrXxjlZaqVGrUt6saUSkfAI kffQ== 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 :dkim-signature; bh=51Wk1pk7Ye3tWxNSMA6jVgYcZgf79u9YHpBjLvPzbGc=; b=eqkr3GG65cgvUBB3GzQnj+8XQCrnKyJOZGpSfDReSyM9KsobUBkT+HExUdSjDEHjsI sa8NAjb1tfho6wM1dPwRHPgtL7XUcc7coJ0F0PzIMy88dDcwvpnUhpHqRdgZorOV/mpj 2uFqn3JKCZwdbI5uBSuTIEYtQLt8MuNyh5osJjs+ZQ+/y3XoxQcfFKRWkPgj+p10bwRf QC/CrwPy2xj9xMeELOwvX6BchqdU55u9PSjQOSi53ESXyRAcerKyDakWclsJza/97uVp /BjKs9jpt1BTllIbX9+fLHf4132/YYqQsOw80io6awGLLqfx6fV1lp50aibopZsCNuRb 6LMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="m/f3yPgS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dp17-20020a170906c15100b007a9d456583bsi2011967ejc.62.2022.11.11.06.00.07; Fri, 11 Nov 2022 06:00:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="m/f3yPgS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234142AbiKKN7R (ORCPT + 99 others); Fri, 11 Nov 2022 08:59:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234090AbiKKN6t (ORCPT ); Fri, 11 Nov 2022 08:58:49 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5295E8B2C7; Fri, 11 Nov 2022 05:55:40 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id A8CB66602A59; Fri, 11 Nov 2022 13:55:37 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668174938; bh=8u6QC8ewCCF44b8mD8drMJBXX7SLVxPYUmHoC5zpU7k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m/f3yPgSETReoDHMNiH1LRwE3tpH1o1EmyMH3Q0dnc6yVg30DS5GPvbOtdzfvDCvJ gCf/LuKLQlnckAmR9Ba1jrq3PDZ4XhyF95Em1gz6En6GReyR/j6/dkuCFqkRcREP3c xpSoLkSk1EBjMtqn73/g1bFqVgtApcgETdMUkmJc88HcQFOB3PLN0LqxOoir406tN8 xu/qahVv5ltwESbr5JUHwStAj8GweiFut91P6A75Q1QcPUUCDsUQ/1mdkVTKbtH2H1 o6PlxlTSviXhUppAq6TYz0AMBvlHHBemuEhL/ESQhN+F+y1hFmvnn7wcZ5eXil49rZ nMkKycZLcMK4Q== From: AngeloGioacchino Del Regno To: agross@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marijn.suijten@somainline.org, kernel@collabora.com, luca@z3ntu.xyz, a39.skl@gmail.com, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno Subject: [PATCH 1/7] dt-bindings: iommu: qcom,iommu: Document qcom,ctx-num property Date: Fri, 11 Nov 2022 14:55:19 +0100 Message-Id: <20221111135525.204134-2-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> References: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208515130202146?= X-GMAIL-MSGID: =?utf-8?q?1749208515130202146?= Add a new "qcom,ctx-num" property to force an ASID number on IOMMU contexts where required. Signed-off-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/iommu/qcom,iommu.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iommu/qcom,iommu.txt b/Documentation/devicetree/bindings/iommu/qcom,iommu.txt index 059139abce35..7d4e0a18b08e 100644 --- a/Documentation/devicetree/bindings/iommu/qcom,iommu.txt +++ b/Documentation/devicetree/bindings/iommu/qcom,iommu.txt @@ -46,6 +46,7 @@ to non-secure vs secure interrupt line. for routing of context bank irq's to secure vs non- secure lines. (Ie. if the iommu contains secure context banks) +- qcom,ctx-num : The ASID number associated to the context bank ** Examples: From patchwork Fri Nov 11 13:55:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 18793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp755306wru; Fri, 11 Nov 2022 06:01:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf6qyWPVR5denWTtF+kRDVtSeT8/rGD32Lw/LZG4bhwL7GANMoLsL1ZSoObF1jksjRCidLWf X-Received: by 2002:a17:906:4a4c:b0:7ad:f6ef:e6c8 with SMTP id a12-20020a1709064a4c00b007adf6efe6c8mr1782896ejv.541.1668175304550; Fri, 11 Nov 2022 06:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175304; cv=none; d=google.com; s=arc-20160816; b=gZty6u52NxLqnc3HueRx473YgLImvcjCWVIpgZuOrbndzo5ibOuTTcloZ3TDjML93W GNNI7k6/gtfP7foBat026KHsqbbBbzk01Vhw+4Snk/PiNERk3lHM1QLNlMrklUYi6r7M +IyhLIce9bdRCnF8Il7Sr02r2DcoqEc1QvuvUT5aoEpiULRV2fJsB+zH3UMs4uEv2Jcm DS4aCJ9BwK39PO7WnUT+S9OpURdwNPQLywr6UvXNG+FY8Zwo58DerFwZpT9cdBZb8uyY IQ/fQYFXo21Jz+Bswevf8pgFBAghzkpWYk1tZlPK+Hi4i1K8CFVLtpoMq80vQbT7V+5u jVCQ== 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 :dkim-signature; bh=FtEjQAlFzPE3D+19uOmzuH3QrbGa1VUDRRt/0ELKNsU=; b=SSwSO37JJJrIqlWdSSOAN6yixMY/On4sYiJdfMRoaRPN0yaScLj0DnT/XqW6Axqkab 7GeB5mStd7PwBh/QF01CBFEHtbH9QRyiai5ao3ehHsk+aoKr4HxyiQBXFO2fyaKx+EwN o/BJ4cUjG01e9EZ7xM4zvmNdC3ZTZm2G/3rd2Ulv5jXL0XHEWlqkT3n62sCJ9JNabI2W 8K3A6uAO7eafkc3h6L1F2n9irmjlG6y54TWb+nkzazocbHfhm4iaiHxSMqVEWWcF5I+V eu97SoGHI8syeEkd3rhm/CHlTnqNAkrAUSIoxkChePE+pWYYAByKyA4LHaXN1uC7gfYe SpAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mnYXIgjb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d15-20020a1709063ecf00b007ad8bc64c89si1454433ejj.701.2022.11.11.06.00.09; Fri, 11 Nov 2022 06:01:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mnYXIgjb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234064AbiKKN7V (ORCPT + 99 others); Fri, 11 Nov 2022 08:59:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59554 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234104AbiKKN6u (ORCPT ); Fri, 11 Nov 2022 08:58:50 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3357657DE; Fri, 11 Nov 2022 05:55:40 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id C60566602A3F; Fri, 11 Nov 2022 13:55:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668174939; bh=UBkv+ig7/g4aGwYjmkedbumqTxGbFTwuxpKvSYfzEUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mnYXIgjbhdmAMH95SV4rvYPVvcfa4VDDDNGgZgdldCv1h31RsIztMeFx0uvDzqG6y sZJfSQIQ3pJz+C88Req3R/NTVepKxxeDzSqH3LXJl/6IluGNxLWsoc2SFC8U2wDb7X RLXXSZKQ+HKlcSSKdF8JhOX8EKd0WvR5RT2aCtPb3qzxDOSt+xYCPFtO+fNqoL9Jp2 xy8AGxV7Dz6/j79ZIx9nVvLDg1C3cnvtEmp2EYF05mvJFaPp10OV/PBzyrq33kn1XK dz3zpvD1zGbvxtAuuBiO0ALreLdYyJDyS1u49gm721iQNiS8tdslg14a1JfQvZdIeQ rutX8glEqTBJw== From: AngeloGioacchino Del Regno To: agross@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marijn.suijten@somainline.org, kernel@collabora.com, luca@z3ntu.xyz, a39.skl@gmail.com, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno Subject: [PATCH 2/7] iommu/qcom: Use the asid read from device-tree if specified Date: Fri, 11 Nov 2022 14:55:20 +0100 Message-Id: <20221111135525.204134-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> References: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208588066466963?= X-GMAIL-MSGID: =?utf-8?q?1749208588066466963?= As specified in this driver, the context banks are 0x1000 apart but on some SoCs the context number does not necessarily match this logic, hence we end up using the wrong ASID: keeping in mind that this IOMMU implementation relies heavily on SCM (TZ) calls, it is mandatory that we communicate the right context number. Since this is all about how context banks are mapped in firmware, which may be board dependent (as a different firmware version may eventually change the expected context bank numbers), introduce a new property "qcom,ctx-num": when found, the ASID will be forced as read from the devicetree. When "qcom,ctx-num" is not found, this driver retains the previous behavior as to avoid breaking older devicetrees or systems that do not require forcing ASID numbers. Signed-off-by: AngeloGioacchino Del Regno --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index bfd7b51eb5db..491a8093f3d6 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -551,7 +551,8 @@ static int qcom_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) * index into qcom_iommu->ctxs: */ if (WARN_ON(asid < 1) || - WARN_ON(asid > qcom_iommu->num_ctxs)) { + WARN_ON(asid > qcom_iommu->num_ctxs) || + WARN_ON(qcom_iommu->ctxs[asid - 1] == NULL)) { put_device(&iommu_pdev->dev); return -EINVAL; } @@ -638,7 +639,8 @@ static int qcom_iommu_sec_ptbl_init(struct device *dev) static int get_asid(const struct device_node *np) { - u32 reg; + u32 reg, val; + int asid; /* read the "reg" property directly to get the relative address * of the context bank, and calculate the asid from that: @@ -646,7 +648,17 @@ static int get_asid(const struct device_node *np) if (of_property_read_u32_index(np, "reg", 0, ®)) return -ENODEV; - return reg / 0x1000; /* context banks are 0x1000 apart */ + /* + * Context banks are 0x1000 apart but, in some cases, the ASID + * number doesn't match to this logic and needs to be passed + * from the DT configuration explicitly. + */ + if (of_property_read_u32(np, "qcom,ctx-num", &val)) + asid = reg / 0x1000; + else + asid = val; + + return asid; } static int qcom_iommu_ctx_probe(struct platform_device *pdev) From patchwork Fri Nov 11 13:55:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 18791 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp754869wru; Fri, 11 Nov 2022 06:01:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf62XlJM2S/hETDxzuXkoR5HrInKXQobazCUIFZ9nApax5QsTGP3TSM6PBoOUr1rymBpkK24 X-Received: by 2002:a17:907:78cb:b0:78d:887f:c1 with SMTP id kv11-20020a17090778cb00b0078d887f00c1mr1984986ejc.209.1668175272195; Fri, 11 Nov 2022 06:01:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175272; cv=none; d=google.com; s=arc-20160816; b=TdyASe3vT1xkCtG3z6qN+4LJlF3rXv5vKieMdLDSB8Cs+h6eUHNYKCKBTlKRcU3/Zk QiSZpCZHdMZM0MzKBC/cp0L3HAxjEJlGiTENUeC3pJCQiHXi8SGky5paQFrLBSrh1kKu 4lo0qoaeWOG4kcopwtvBqt4uAtszH8QjG7cpamlWqv6OvUXJTupFyjA6+5O4MoMhOr2w CZtMF+1aZWBcH3/+G0neZjvCEq0L25Ysg09+kusLyBmefxTaCC539Ye/v1xS68/Cvs5k agHkujRJhTxtstWYwv83iDM1W6qMrHdSF9XiNT70nyn8GwQ8/uATUzuYV9VlwthCz0pM oxTA== 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 :dkim-signature; bh=E3FQt5lnpAxjjpDyepfA5Q3+UOz2rxOKhm3c9RaC1AY=; b=QRWfcCSPySvnHE3TnyhD0TlEATm/R3zaALmUEmbDsjObQwaT59+0EVPAfI0ZvEk0wk +QgYNjSdQ/JKt+mSCnXypxGpHd97rKfBBQGvp9LXDgbSzcWsfFfSZ+pBw/Hs3wvLaeCT fSBbM98QEKWpyVv+Q6lUYfqMA5NQcrath9mFiY9CPUuPCOCG++VjlQkcqorddy7OuTU/ wDySu3vB6a+JDeSapxPhOhChUIo89tkjII6aTWanIjMithwd4hAACdfJHhPLTCPVH6Cj 8Ms4O30EU+xnOxHcX8/UcGwnhhYU81Ta4DY59xOEwO+SWvg6yeRlEn4983+XseCu+8aQ e+SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hzM22CMb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq34-20020a1709073f2200b007a858ead52dsi2318989ejc.732.2022.11.11.06.00.42; Fri, 11 Nov 2022 06:01:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=hzM22CMb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233904AbiKKN71 (ORCPT + 99 others); Fri, 11 Nov 2022 08:59:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234109AbiKKN6v (ORCPT ); Fri, 11 Nov 2022 08:58:51 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18057742D2; Fri, 11 Nov 2022 05:55:42 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id E2ED96602A5A; Fri, 11 Nov 2022 13:55:39 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668174940; bh=XDujAn0ZeYKReEqH3WwrDRbPR8DoO7W2378dAKf4P6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzM22CMbpHIYs4+DUMrnQ2LGSeIGTK0W+D2Ep4UKA6F4EXRzhmnSSl31+Rqrn/AcC zaDhrcOdFuVXMW22Sa9JLsa3joMbb40EZjv19EC0JtZL1LD6XaJBINI8UM3JCrEAz4 +Sgz8gc01CRJNrUFxGgPO/2RhOhco0EaRjMKq+mmqSlQr/ymrvS6e4uUC+1i6IWGsf 0QIL/7MtTufaARaEameRpY/daftaQvodSUMLDtQL7KFoLNsAwDRF7vkIdlNtHvJvhe SbMKsWizdNtGIekU5ue/0P1RqAW9V7J8YQJvrPA6hmVHuHriWU/AM1BdyJ5ys+qv6D FsPY/ya6t96SQ== From: AngeloGioacchino Del Regno To: agross@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marijn.suijten@somainline.org, kernel@collabora.com, luca@z3ntu.xyz, a39.skl@gmail.com, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno Subject: [PATCH 3/7] iommu/qcom: Properly reset the IOMMU context Date: Fri, 11 Nov 2022 14:55:21 +0100 Message-Id: <20221111135525.204134-4-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> References: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208554393656996?= X-GMAIL-MSGID: =?utf-8?q?1749208554393656996?= Avoid context faults by resetting the context(s) entirely at detach_dev() time and also do the same before programming the context for domain initialization. Signed-off-by: AngeloGioacchino Del Regno --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index 491a8093f3d6..5b127ac41b5e 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -223,6 +223,20 @@ static irqreturn_t qcom_iommu_fault(int irq, void *dev) return IRQ_HANDLED; } +static void qcom_iommu_reset_ctx(struct qcom_iommu_ctx *ctx) +{ + iommu_writel(ctx, ARM_SMMU_CB_FAR, 0); + iommu_writel(ctx, ARM_SMMU_CB_FSR, 0); + iommu_writel(ctx, ARM_SMMU_CB_S1_MAIR1, 0); + iommu_writel(ctx, ARM_SMMU_CB_PAR, 0); + iommu_writel(ctx, ARM_SMMU_CB_S1_MAIR0, 0); + iommu_writel(ctx, ARM_SMMU_CB_SCTLR, 0); + iommu_writel(ctx, ARM_SMMU_CB_TCR2, 0); + iommu_writel(ctx, ARM_SMMU_CB_TCR, 0); + iommu_writeq(ctx, ARM_SMMU_CB_TTBR0, 0); + iommu_writeq(ctx, ARM_SMMU_CB_TTBR1, 0); +} + static int qcom_iommu_init_domain(struct iommu_domain *domain, struct qcom_iommu_dev *qcom_iommu, struct device *dev) @@ -273,6 +287,8 @@ static int qcom_iommu_init_domain(struct iommu_domain *domain, ctx->secure_init = true; } + qcom_iommu_reset_ctx(ctx); + /* TTBRs */ iommu_writeq(ctx, ARM_SMMU_CB_TTBR0, pgtbl_cfg.arm_lpae_s1_cfg.ttbr | @@ -401,8 +417,8 @@ static void qcom_iommu_detach_dev(struct iommu_domain *domain, struct device *de for (i = 0; i < fwspec->num_ids; i++) { struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, fwspec->ids[i]); - /* Disable the context bank: */ - iommu_writel(ctx, ARM_SMMU_CB_SCTLR, 0); + /* Disable and reset the context bank */ + qcom_iommu_reset_ctx(ctx); ctx->domain = NULL; } From patchwork Fri Nov 11 13:55:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 18801 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp756677wru; Fri, 11 Nov 2022 06:03:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf67POHhJSRfzFvNXAmuGn0wuoFjWpJ4wuxmVrTCghd7HplYqQwZ9G8wcD+JgAGoGgGvIXiD X-Received: by 2002:a63:1a0d:0:b0:457:a1d3:48c3 with SMTP id a13-20020a631a0d000000b00457a1d348c3mr1741020pga.465.1668175414875; Fri, 11 Nov 2022 06:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175414; cv=none; d=google.com; s=arc-20160816; b=yHqIlrDf7P3OLsuV99k4YQp7KcBaP9Xzi0jsOnMOjDZpbpe7jBPIbM0pwGd52es4LF P/88AioECgoS0mhtQPFsNT6y/3nLDNW9IzNAmJB2K5dNFal4nDRUrdYFtanTXmzGHjJO Ka7XDnASYHafZJldTcmt8OCkIfQr9oPuJ2kXgTr+JxGXDMt5kS/QXBy2ubpS5cwnTijR nuzT+01bxed7tsy5ux6xZx3XsdY0wy63/SDUXkKTelQ1sFNJJg5zcaHPuZVpRVAXnV5Q 5jRtNI4t/O3klugPJP2LCYF0dTWpuR2ixOIUaYdbOB2fgae/Z7XXfp/kPBS0IBn8/FKR n8oQ== 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 :dkim-signature; bh=v0BJlhxWFjsmAOzF5Ya5Lp5/57SVLREUnhdhD2C1pbk=; b=kLlEhxT39oRVwfz9VVmdsJDJN0cFYo/c78bpWOds0J8pjvOa2HcqTzM6IjJOQ/abvV 7P4i4CqAoCE65oeb6HPVgLNutEIF+4FziWe/Hg/XyiH+wuAHYXlP5Xmx9J5zO/UwqKE+ u7kne+iRDONjEyZGHXsSQfaNmyZZadUQpx/KHm09DiDFUqR3aiasApMZ0hYL1AyYkL1H 23PtJjDEtEvhRBPCXX8Ms9ymMiKU/x0YXQZgf2DAq3EH0Zq8ZmDgPwMIKGjjr3bQDwXO GZ1Q9jT549yn9XiXJ5rlu4LRsLv0R43d//qHKl4A8lluh2GlcxhXMNkwKX6nUDuHeVS6 jSfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mtmY98hV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx1-20020a17090b4b0100b001fd7cab081bsi8529331pjb.125.2022.11.11.06.02.58; Fri, 11 Nov 2022 06:03:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=mtmY98hV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233947AbiKKN7Y (ORCPT + 99 others); Fri, 11 Nov 2022 08:59:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234056AbiKKN6w (ORCPT ); Fri, 11 Nov 2022 08:58:52 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26D8A748C1; Fri, 11 Nov 2022 05:55:43 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 124406602A5B; Fri, 11 Nov 2022 13:55:41 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668174942; bh=5J9op1SHRAc7CVXi/aw9XgRw2WXyTLhdCxf9a+Y9k1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mtmY98hVSESAsKLj+JAoVSi0ZpQwDDjGfwHGD1cq09h55a5M7sEEvCNaEHvsUeb1v lKNShXEKBW2tC7U6fbPqBf5gPac5IYVa7MLRf7EiV9r831/Rp6mxdf3AANYfmJ1qqu OQnaTTYebbC7Cdc6e2nXLHhe2kGx4QM4WRHa/uGWaDGnzXD2wCEoCPb4WdzXfqSy5K a9dOeGhZhlGq9iRQEAYy1CajMgRX8keyZR1GB5aXVRcGnRcAVqFV7xl0J9xhlX3oPb 3N04zXlnb29x4Njjf8wBfipU7+v+ip+FA2n8wv2Ucpyi+ZvbBDkFne44h0OkY6fSCq 249up9nUekmng== From: AngeloGioacchino Del Regno To: agross@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marijn.suijten@somainline.org, kernel@collabora.com, luca@z3ntu.xyz, a39.skl@gmail.com, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno Subject: [PATCH 4/7] iommu/qcom: Index contexts by asid number to allow asid 0 Date: Fri, 11 Nov 2022 14:55:22 +0100 Message-Id: <20221111135525.204134-5-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> References: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208703949023984?= X-GMAIL-MSGID: =?utf-8?q?1749208703949023984?= This driver was indexing the contexts by asid-1, which is probably done under the assumption that the first ASID is always 1. Unfortunately this is not always true: at least for MSM8956 and MSM8976's GPU IOMMU, the gpu_user context's ASID number is zero. To allow using a zero asid number, index the contexts by `asid` instead of by `asid - 1`. Signed-off-by: AngeloGioacchino Del Regno --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index 5b127ac41b5e..1fcee74154f0 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -52,7 +52,7 @@ struct qcom_iommu_dev { void __iomem *local_base; u32 sec_id; u8 num_ctxs; - struct qcom_iommu_ctx *ctxs[]; /* indexed by asid-1 */ + struct qcom_iommu_ctx *ctxs[]; /* indexed by asid */ }; struct qcom_iommu_ctx { @@ -94,7 +94,7 @@ static struct qcom_iommu_ctx * to_ctx(struct qcom_iommu_domain *d, unsigned asid struct qcom_iommu_dev *qcom_iommu = d->iommu; if (!qcom_iommu) return NULL; - return qcom_iommu->ctxs[asid - 1]; + return qcom_iommu->ctxs[asid]; } static inline void @@ -563,12 +563,10 @@ static int qcom_iommu_of_xlate(struct device *dev, struct of_phandle_args *args) qcom_iommu = platform_get_drvdata(iommu_pdev); /* make sure the asid specified in dt is valid, so we don't have - * to sanity check this elsewhere, since 'asid - 1' is used to - * index into qcom_iommu->ctxs: + * to sanity check this elsewhere: */ - if (WARN_ON(asid < 1) || - WARN_ON(asid > qcom_iommu->num_ctxs) || - WARN_ON(qcom_iommu->ctxs[asid - 1] == NULL)) { + if (WARN_ON(asid >= qcom_iommu->num_ctxs) || + WARN_ON(qcom_iommu->ctxs[asid] == NULL)) { put_device(&iommu_pdev->dev); return -EINVAL; } @@ -726,7 +724,7 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev) dev_dbg(dev, "found asid %u\n", ctx->asid); - qcom_iommu->ctxs[ctx->asid - 1] = ctx; + qcom_iommu->ctxs[ctx->asid] = ctx; return 0; } @@ -738,7 +736,7 @@ static int qcom_iommu_ctx_remove(struct platform_device *pdev) platform_set_drvdata(pdev, NULL); - qcom_iommu->ctxs[ctx->asid - 1] = NULL; + qcom_iommu->ctxs[ctx->asid] = NULL; return 0; } @@ -779,7 +777,7 @@ static int qcom_iommu_device_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res; struct clk *clk; - int ret, max_asid = 0; + int ret, num_ctxs, max_asid = 0; /* find the max asid (which is 1:1 to ctx bank idx), so we know how * many child ctx devices we have: @@ -787,11 +785,13 @@ static int qcom_iommu_device_probe(struct platform_device *pdev) for_each_child_of_node(dev->of_node, child) max_asid = max(max_asid, get_asid(child)); - qcom_iommu = devm_kzalloc(dev, struct_size(qcom_iommu, ctxs, max_asid), + num_ctxs = max_asid + 1; + + qcom_iommu = devm_kzalloc(dev, struct_size(qcom_iommu, ctxs, num_ctxs), GFP_KERNEL); if (!qcom_iommu) return -ENOMEM; - qcom_iommu->num_ctxs = max_asid; + qcom_iommu->num_ctxs = num_ctxs; qcom_iommu->dev = dev; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); From patchwork Fri Nov 11 13:55:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 18792 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp755084wru; Fri, 11 Nov 2022 06:01:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf6+wzoPkMkpeMkIFW6DLTZVdNPmAh+TWMEJOH9RQUzPvGoV4qFaL3xC6vpTqjm7IsYA75x6 X-Received: by 2002:a17:907:8d1c:b0:782:6505:dec6 with SMTP id tc28-20020a1709078d1c00b007826505dec6mr1887551ejc.505.1668175287312; Fri, 11 Nov 2022 06:01:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175287; cv=none; d=google.com; s=arc-20160816; b=G/Zy8KCc5jlSlFFCwWYqLBZ2W4j1RBX1mkA3rFGO/W56F9naSFA6MWT02Sxdtl3Zkd cLq5G+sJuu/2/E9WrTnME+eo5aAgSs1hrLL9n7QHDOhiDFdYTGFg40zoQRmUWR9C983B vYZZrQy+YHmxicwKC3qBMmDEGYQHip2vMABMJhaWfn3gjAhOpcTE2Zhz7tT5yytTD6pK qeJrDREQKNFB1oRnJ8j/mZBqV8OxJhYDWexO8YXZBiky/iUObz0i/XTlYalzV8CQvy5s iUWT+SnnsJeHzpnZIPlkFOF79GlOJ/ZzdFwaODiGNqGaIJJtUYmMD/6lf8A3ecsxgmQs 7wWw== 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 :dkim-signature; bh=ydx3SgsyBedCjzkqhu8lqw3oyrOe7eYzDpIRwMViHNU=; b=qI/PwUJmR2Pkecu23pbPaIc+PMS4pAtTRWpyC+QKKMAEmL47EyZwaNXEMf3ajqgf8Z 1XANG16Qx2UHuJp9Yx2IslPOnXjaJ9DDOzPDLy7pVusCIMyIfvNttFl/SF5ch8BNihWV yNxviHMQQhmq4VxBFqkwFRIY129RDx4TNf6KF+eA7gxj6VQnFdfWuvzTiPz6bvmqtqhj XIN2NrPJ9jt4pU71usVardlsNSptYvwapYH0VM38MaaKjApi+hwLpysIMvVH5jeV1uNE LsEwOHoA9VPQ8mrWTlVPs1omg6EhtFR9K50qxu9z1+k2wUhrOjbENBLqp8/Ud8sSCuff qOIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BPprOpb8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds18-20020a170907725200b007940226fd21si2048456ejc.903.2022.11.11.06.00.56; Fri, 11 Nov 2022 06:01:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BPprOpb8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234221AbiKKN7a (ORCPT + 99 others); Fri, 11 Nov 2022 08:59:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233950AbiKKN7A (ORCPT ); Fri, 11 Nov 2022 08:59:00 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A3128B2F6; Fri, 11 Nov 2022 05:55:50 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 30BF46602A5C; Fri, 11 Nov 2022 13:55:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668174943; bh=Zf7m6jLp2JACg2AkUZYo4eLC63C+UuS3mbPUkyrlclQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BPprOpb8mi3DmWEWvZ12B4yp7ibqJPZBoEBxhEIVSFmWqYAPhsNyS+8YW/Gqa4sP+ u3pKvDOTYeS6M53Ui+0IilQ46cSjbkzd+qAmyDakpo/zaX6Jid4O+/NfWyHhjEEH0G AgChFR0zIvF0JO8LiO8Vmru5hqTLL75ATuJyWPD52NFIXtEj/9l8mxxIZOSuYQUacX hpgXR4av8vVXYu8GnQ6nxfdnE8CYNA+U5mtv079QyWCjy6vqCT+XBlTgBOxIu7oXEh nzOSIp7+mm6dvD3wCNrskSh53FzdTf1WSR+5O+LU2W6RuH80GtBOTw8KfzGbPEvUPm Wpqsi3OISLNFw== From: AngeloGioacchino Del Regno To: agross@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marijn.suijten@somainline.org, kernel@collabora.com, luca@z3ntu.xyz, a39.skl@gmail.com, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno Subject: [PATCH 5/7] dt-bindings: iommu: qcom,iommu: Document QSMMU v2 compatibles Date: Fri, 11 Nov 2022 14:55:23 +0100 Message-Id: <20221111135525.204134-6-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> References: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208570159232635?= X-GMAIL-MSGID: =?utf-8?q?1749208570159232635?= Add compatible strings for "qcom,msm-iommu-v2" for the inner node, "qcom,msm-iommu-v2-ns" and "qcom,msm-iommu-v2-sec" for the context bank nodes to support Qualcomm's secure fw "SMMU v2" implementation. Signed-off-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/iommu/qcom,iommu.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iommu/qcom,iommu.txt b/Documentation/devicetree/bindings/iommu/qcom,iommu.txt index 7d4e0a18b08e..b762772f80e7 100644 --- a/Documentation/devicetree/bindings/iommu/qcom,iommu.txt +++ b/Documentation/devicetree/bindings/iommu/qcom,iommu.txt @@ -11,7 +11,10 @@ to non-secure vs secure interrupt line. "qcom,msm8916-iommu" - Followed by "qcom,msm-iommu-v1". + Followed by one of: + + - "qcom,msm-iommu-v1" + - "qcom,msm-iommu-v2" - clock-names : Should be a pair of "iface" (required for IOMMUs register group access) and "bus" (required for @@ -36,6 +39,8 @@ to non-secure vs secure interrupt line. - compatible : Should be one of: - "qcom,msm-iommu-v1-ns" : non-secure context bank - "qcom,msm-iommu-v1-sec" : secure context bank + - "qcom,msm-iommu-v2-ns" : non-secure QSMMUv2/QSMMU500 context bank + - "qcom,msm-iommu-v2-sec" : secure QSMMUv2/QSMMU500 context bank - reg : Base address and size of context bank within the iommu - interrupts : The context fault irq. From patchwork Fri Nov 11 13:55:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 18794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp755316wru; Fri, 11 Nov 2022 06:01:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf64aSd0qDV5LzKXdvMHAOAIFceyLYBPj3jTqJBdDbq3u8Rl9KbKL1T7Xd59Iy6WDuPYWiW3 X-Received: by 2002:a05:6402:3888:b0:461:78ef:56e8 with SMTP id fd8-20020a056402388800b0046178ef56e8mr1475263edb.397.1668175305050; Fri, 11 Nov 2022 06:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175305; cv=none; d=google.com; s=arc-20160816; b=K5stDzkSUHgma0lrilx6vIK89TNvQ3ZualQWZepxhJdoP6ecZj3c0zQPuVrZlgjY9t ezUquMh4Xv4mQF2Isd55lRcBadOymdSuG3XRNldBnLCzV/7cXjUhbaF16hYZ5tEio7oD 76Wx/yd+F7Pz1aI6RZaN4kkeVFv7/CebhRnVBUjQka2tl/e8IwZNbHlY2UcUBGxHXoXJ XRVKy3U0bsoz1lxh1AXjsTHOTyx45ESGN2a9XKiS5JHw64o1L0WdOe4+AInRN1xWJtWD a2CNCXOGF1mh63JTyweYU8tn72cGCl+uWI9sdv/9KHe4ufg7uUtoM5dHo6iEH3B+i6+v sOTA== 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 :dkim-signature; bh=cvi9Pxf4O6vKq1dpY/EYHYXV7fY0AXLWYV7NS7lX0lU=; b=F3sNybRu7xs+AuLqwUWVXKGE+hn6NLf+UQAHTDJ+hxCcwxcSMIac17Ew1UaZo5O3vq tbhWWnJjgR/6eCq1IT6lGO6tQjSS78i45pzEI7GTy7BNl3knbqAwfMkfvWmuXJJ7TiWE tMQ+WpxOj41e67TvzLc2rU90WYb+rFXv9LnrJcMbVLKjl2RAJFSSqSY0dOZQxe3u1owG 0R8bWHKhjGlMs576E6d9kUdeRo+aY6pQiLFSupRhdx7T2bMHFyDHutK/jJxKEOOXEpvP d3x2WWghigmrvuS2cSa6ADWoZel62VToss3ePrcxbd6Eip/UxeAZYkdDHyGbntU3BDuE e3YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="ai8ym/FV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n26-20020aa7c45a000000b00461a3438b24si2093436edr.182.2022.11.11.06.00.57; Fri, 11 Nov 2022 06:01:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b="ai8ym/FV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234225AbiKKN7d (ORCPT + 99 others); Fri, 11 Nov 2022 08:59:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234133AbiKKN7B (ORCPT ); Fri, 11 Nov 2022 08:59:01 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B1148B2F7; Fri, 11 Nov 2022 05:55:50 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 49B006602A65; Fri, 11 Nov 2022 13:55:43 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668174944; bh=12UczH05Ev7jhUq0H7Vd4rhTl/HbVUhi5R+WAWNGpHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ai8ym/FVvL0d6sUZZf2KX25tCQ/Hjap+WYvTQsLdJ/JKLLRwCjqZ7VXcBIKDNdHMQ yHl4u2HBCz1OIKfEdOHUQU+YokkAPC3RURfNV6HwL8FB/s70o5Ps9CFpxcVpPCGWJ0 a1emeLqXXn+i4rvcuQAY9hiRlczwwKaY1r05RaolMP63E5xgyGvHDERXCJGSiZNUJc t02OI5m6LY6sK0qW6CrTrRwy1n2+P3t59+mcwaNARefuf9G4JdyjzmOHkXRlcYnE2W e4yB5n72hYtZhctu8AZuB3oRNXHeRMdTzuL46pjbQYt6Pv1Dj4ZPItnwO25G7b/Bwx vVRE3IvRTnAag== From: AngeloGioacchino Del Regno To: agross@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marijn.suijten@somainline.org, kernel@collabora.com, luca@z3ntu.xyz, a39.skl@gmail.com, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno Subject: [PATCH 6/7] iommu/qcom: Add support for QSMMUv2 and QSMMU-500 secured contexts Date: Fri, 11 Nov 2022 14:55:24 +0100 Message-Id: <20221111135525.204134-7-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> References: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208588775162819?= X-GMAIL-MSGID: =?utf-8?q?1749208588775162819?= On some SoCs like MSM8956, MSM8976 and others, secure contexts are also secured: these get programmed by the bootloader or TZ (as usual) but their "interesting" registers are locked out by the hypervisor, disallowing direct register writes from Linux and, in many cases, completely disallowing the reprogramming of TTBR, TCR, MAIR and other registers including, but not limited to, resetting contexts. This is referred downstream as a "v2" IOMMU but this is effectively a "v2 firmware configuration" instead. Luckily, the described behavior of version 2 is effective only on secure contexts and not on non-secure ones: add support for that, finally getting a completely working IOMMU on at least MSM8956/76. Signed-off-by: AngeloGioacchino Del Regno --- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c b/drivers/iommu/arm/arm-smmu/qcom_iommu.c index 1fcee74154f0..bba5274bf8d4 100644 --- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c +++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c @@ -59,6 +59,7 @@ struct qcom_iommu_ctx { struct device *dev; void __iomem *base; bool secure_init; + bool secured_ctx; u8 asid; /* asid and ctx bank # are 1:1 */ struct iommu_domain *domain; }; @@ -287,6 +288,12 @@ static int qcom_iommu_init_domain(struct iommu_domain *domain, ctx->secure_init = true; } + /* Secured QSMMU-500/QSMMU-v2 contexts cannot be programmed */ + if (ctx->secured_ctx) { + ctx->domain = domain; + continue; + } + qcom_iommu_reset_ctx(ctx); /* TTBRs */ @@ -418,7 +425,8 @@ static void qcom_iommu_detach_dev(struct iommu_domain *domain, struct device *de struct qcom_iommu_ctx *ctx = to_ctx(qcom_domain, fwspec->ids[i]); /* Disable and reset the context bank */ - qcom_iommu_reset_ctx(ctx); + if (!ctx->secured_ctx) + qcom_iommu_reset_ctx(ctx); ctx->domain = NULL; } @@ -699,10 +707,14 @@ static int qcom_iommu_ctx_probe(struct platform_device *pdev) if (irq < 0) return -ENODEV; + if (of_device_is_compatible(dev->of_node, "qcom,msm-iommu-v2-sec")) + ctx->secured_ctx = true; + /* clear IRQs before registering fault handler, just in case the * boot-loader left us a surprise: */ - iommu_writel(ctx, ARM_SMMU_CB_FSR, iommu_readl(ctx, ARM_SMMU_CB_FSR)); + if (!ctx->secured_ctx) + iommu_writel(ctx, ARM_SMMU_CB_FSR, iommu_readl(ctx, ARM_SMMU_CB_FSR)); ret = devm_request_irq(dev, irq, qcom_iommu_fault, @@ -744,6 +756,8 @@ static int qcom_iommu_ctx_remove(struct platform_device *pdev) static const struct of_device_id ctx_of_match[] = { { .compatible = "qcom,msm-iommu-v1-ns" }, { .compatible = "qcom,msm-iommu-v1-sec" }, + { .compatible = "qcom,msm-iommu-v2-ns" }, + { .compatible = "qcom,msm-iommu-v2-sec" }, { /* sentinel */ } }; @@ -761,7 +775,8 @@ static bool qcom_iommu_has_secure_context(struct qcom_iommu_dev *qcom_iommu) struct device_node *child; for_each_child_of_node(qcom_iommu->dev->of_node, child) { - if (of_device_is_compatible(child, "qcom,msm-iommu-v1-sec")) { + if (of_device_is_compatible(child, "qcom,msm-iommu-v1-sec") || + of_device_is_compatible(child, "qcom,msm-iommu-v2-sec")) { of_node_put(child); return true; } From patchwork Fri Nov 11 13:55:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 18795 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp755324wru; Fri, 11 Nov 2022 06:01:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf4EeeCW0XLjUuhC74R0gcgb08AOqIbKTroxKM1XNTvSHYTLuhq5mzsCtHYMk5dUFAyRGlxa X-Received: by 2002:a05:6402:1644:b0:461:9e30:c597 with SMTP id s4-20020a056402164400b004619e30c597mr1559961edx.150.1668175305987; Fri, 11 Nov 2022 06:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175305; cv=none; d=google.com; s=arc-20160816; b=O9YraiuPcmRBwqL6ODEpBMhr3CaFu/FnPQx2Yi7rsAOavhmu6Si4GnODRScQZPV+Fy r8VNPIBSSoxR9NaGuXE8RyUbPvH8byv3A1pyHYRvkyfY/OLQfv5mk9v9x8tTRU6H2uok t9YsqUz72W7/ZkZKCHrtRhpkhRjO7Q1QaKyZjIPmSbkWyj1pkmvQFSXh54SmGZQnyVCj aE7Z9HWNAkfEEO3SxQFZNnwOgSsMDWfyVWrn5I9lApF5yYAhvO7yfPtgCbypdxTqR3ft 7IscUecCNe4wKG/Jkw9YOOkr00LLyKkAKSKzLhGGqZBRHoL09DIvkBKI3qfYlxeuBbnJ ArsA== 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 :dkim-signature; bh=zTjMv1tR5S+sqdZ2bLPWou9dpoD759JZuvYV61ajfzs=; b=XS90jiL8d9y/SblLcjMzrm/pGQR+b9TQpOTy8Ssts80694vOXBcHqgdXWKgqfmOOKj TFVQk60jtyq7kClhoLxA+U9/Do90vetlCA1epgnV/RACk2PaeHH74T3EJULtB28hyv71 E1KwhwNmpRyvTXEg6B7Jr3tPtgmxLxtq2at3WA6Aofa9y8h+Bb9fFC5k7dcwEbLH9Pq/ 3sz8eSPpmvOpaOKENupF3sJ2j24KNow1Byozpfzkw2fRiTSkNz1TIUr4zY1ZrHefpbir UWwuD/T7QvF8feDfmeJTLypCdaERwOZIc+/V8EYbIiTaSIcKAdBhZuQrZkSd13u0WNlD PjFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cUJeBGFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk30-20020a1709077f9e00b007830f14fffesi2248713ejc.375.2022.11.11.06.01.00; Fri, 11 Nov 2022 06:01:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=cUJeBGFE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234230AbiKKN7g (ORCPT + 99 others); Fri, 11 Nov 2022 08:59:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233985AbiKKN7C (ORCPT ); Fri, 11 Nov 2022 08:59:02 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC3D8C580; Fri, 11 Nov 2022 05:55:51 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 61DE06602A55; Fri, 11 Nov 2022 13:55:44 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1668174945; bh=MdaH8KbjjoGPf2cEN4UiKaUO79dviS/rWyElqvdnnE4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cUJeBGFEK9tJM82NFtDomK6VlVFl04kG4uCim8R1xkWipIEew9uQ/HZDFlnir/yqY fGPqhsB+aOqCFVBHhHxodATBSxgl2HIF9+oMqeBpGU8twu4lRcwLkC9g5dKiw8gFNN xxIWq7+MDq9kDBNS+MxMfH3MyyUfBKuIXpjglktShKZYy0qx42pyPiTi3itAC37pbj aclVnOKQUilTgZxJZPPP357Ay8LZaHvPGVvloLylvfoIeA9KmbCtmyB73gyAJbEb2d OvYWNg5LNSK1iE44u+rGx6CtMyYIYJ0o9OLAbbstIoqcee77ZpxI8towd3g9+xvItM w8aeQvrcrnlTg== From: AngeloGioacchino Del Regno To: agross@kernel.org Cc: andersson@kernel.org, konrad.dybcio@linaro.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marijn.suijten@somainline.org, kernel@collabora.com, luca@z3ntu.xyz, a39.skl@gmail.com, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno Subject: [PATCH 7/7] dt-bindings: iommu: qcom,iommu: Document MSM8976 compatible Date: Fri, 11 Nov 2022 14:55:25 +0100 Message-Id: <20221111135525.204134-8-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> References: <20221111135525.204134-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749208589710773139?= X-GMAIL-MSGID: =?utf-8?q?1749208589710773139?= Add "qcom,msm8976-iommu" to support IOMMUs on this SoC. Signed-off-by: AngeloGioacchino Del Regno --- Documentation/devicetree/bindings/iommu/qcom,iommu.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iommu/qcom,iommu.txt b/Documentation/devicetree/bindings/iommu/qcom,iommu.txt index b762772f80e7..b7a5822ac00d 100644 --- a/Documentation/devicetree/bindings/iommu/qcom,iommu.txt +++ b/Documentation/devicetree/bindings/iommu/qcom,iommu.txt @@ -9,7 +9,8 @@ to non-secure vs secure interrupt line. - compatible : Should be one of: - "qcom,msm8916-iommu" + - "qcom,msm8916-iommu" + - "qcom,msm8976-iommu" Followed by one of: