Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1116997ybt; Wed, 8 Jul 2020 22:04:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoX9/6DCjpTVIBb5YTobsrdgYiqLYN/7t75LgFFTXuKu9H1L3CskOoSG4sTNwy0TPuDP1B X-Received: by 2002:a17:906:f183:: with SMTP id gs3mr52021424ejb.361.1594271047233; Wed, 08 Jul 2020 22:04:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594271047; cv=none; d=google.com; s=arc-20160816; b=kNw7cJGGv13z7HqmfpxEDAk/gu4NNlChgnMpsq6ieskz2jaKjguKJtRPWb3wI3Ldoh mgSJxqajCYSid5viQpH4lr7drlGFNghwuomeAfAMKdDlEO5TZfpwk3wgkQTf+VX6ppNr fyNl0TWw93pwDWmjAsy+CxX3/HMYYcElAfm6c1i0YFcLHNdSxwtltUHJA8w8jb1d1xhj xNVeY3bg/DBEXyJG//Xz6FlvijsHe5OQnriHlhmWint5pbTRjSwceetYcgSi/t3N5ieE UzffXlvIJoit5+wM9+LpQJ0KVZh8ZyiryzFE8sRexJbTNhoKaNQpOJZVKKoOE7W7Ut0f HCmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T+6WxJ1O6k89NNQZzhHWgQkm03zUeIAl0iKHL4vPlUk=; b=t+ORHAjjdQEmLGZNzQtd4fxm0KD5BygXmekrujQRhtDJ5Bd1jn0lSGaLAffcAag4If KFqoEVeV4dXmOBUzzt7rpgzbky1KV4NWjAuu5onc1c9HftPci8Vzs0XZocE3rlpDcZDJ /UWzTdJtFkiWoEzvCO8AsuA0TNGtOy6OLnIh2xVfCONDfUte5T2eNzRCxBI9NYwr3Ivp 9gnR05I9xTAjMpiUMUeWVPggOgP/zC7sqOTo3cHIpYZKaBWH3oVCmPPt/dQ1mHUGeGH3 AzPL0VyrGv2SULAOHMluUTTQ0M6G+KbXWHp5iauWe1Hsop1mHOpWWhVRTEu0ag9FIgx4 KkEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AOLHWt2G; 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 ca11si1099199ejb.252.2020.07.08.22.03.44; Wed, 08 Jul 2020 22:04:07 -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=@linaro.org header.s=google header.b=AOLHWt2G; 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 S1726433AbgGIFCE (ORCPT + 99 others); Thu, 9 Jul 2020 01:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbgGIFBm (ORCPT ); Thu, 9 Jul 2020 01:01:42 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38C38C08C5DD for ; Wed, 8 Jul 2020 22:01:42 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id cv18so2902884pjb.1 for ; Wed, 08 Jul 2020 22:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T+6WxJ1O6k89NNQZzhHWgQkm03zUeIAl0iKHL4vPlUk=; b=AOLHWt2GPk9pGPq6HPxBOiLg8IkaE8fySTF+79CaOlFbY/Ii9OChxP90kbGu1Kpp4g 1geiQB3FJADTo1pUFgW3Sxa65geoU2CT5za4/L0HfEdsLOAuiS/hjjGJAhLd5WpirmZf FtqNIv1CQKnyDdPXdmuFBCNC6yhLvo2cYc6qSM5QnmTXkmdX5EeDxnIrVvTmG4ZIadtN 9Wc0sp5jXMyQsZ3p/wY2QYy7Ht2049b7nCZwdk1eGIpkU//mzH2EjylQGA8lOiKrtshJ LlRfr/5BOfigasYH241F2AoEDk2ymoYdc1UD+9rYiSk5J9TrKnHdKxLfuGL8+sE3Lbxw Lrdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T+6WxJ1O6k89NNQZzhHWgQkm03zUeIAl0iKHL4vPlUk=; b=OWDQpDm8XYy+lfdByixMfpRNPZ866PBeao+KLVxb/9iyR4j8Gugm98L0ADDSCV6ekP H8wwSa19zRj8Cr5Aq8VR9ngtbVfNjQ8nBZOrsKBLcuLZ2qMtlAoJjHGpSrNbRORjh/yU 41dz0yMSJk0jSaeiBW2Z/+QV+8XIk1qErKL/wt+NdSamFNuLylWQypTdVDTuY2xpyZcz jgJ3aN2ndx0GNAKnPDLMbkFoPCJPsXupj1OT4gVsQ14RGp1Bn3gkkaxmcnjwr3fLmYJH hBK64OMASUvlRsB876pM4qtH3fj4+5eG1jQqMJbPY7ikbw/tdcdT+YSDre3EL/GWw74t LGzg== X-Gm-Message-State: AOAM530eqGP+9Gi6lowIwPpKbyqvaErk7igSHgDkxg8tTycf2DdhdTaU tEPBfjR5XfA99I3rE6uaCW6zaQ== X-Received: by 2002:a17:90b:4d08:: with SMTP id mw8mr12970883pjb.119.1594270901682; Wed, 08 Jul 2020 22:01:41 -0700 (PDT) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id h15sm999974pjc.14.2020.07.08.22.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 22:01:41 -0700 (PDT) From: Bjorn Andersson To: Will Deacon , Robin Murphy , Joerg Roedel , Thierry Reding , Laurentiu Tudor Cc: linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jonathan Marek , linux-arm-msm@vger.kernel.org Subject: [PATCH 1/5] iommu/arm-smmu: Make all valid stream mappings BYPASS Date: Wed, 8 Jul 2020 22:01:41 -0700 Message-Id: <20200709050145.3520931-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200709050145.3520931-1-bjorn.andersson@linaro.org> References: <20200709050145.3520931-1-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Turn all stream mappings marked as valid into BYPASS. This allows the platform specific implementation to configure stream mappings to match the boot loader's configuration for e.g. display to continue to function through the reset of the SMMU. Suggested-by: Robin Murphy Signed-off-by: Bjorn Andersson --- drivers/iommu/arm-smmu.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index 243bc4cb2705..2e27cf9815ab 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -1924,6 +1924,22 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) return 0; } +int arm_smmu_setup_identity(struct arm_smmu_device *smmu) +{ + int i; + + for (i = 0; i < smmu->num_mapping_groups; i++) { + if (smmu->smrs[i].valid) { + smmu->s2crs[i].type = S2CR_TYPE_BYPASS; + smmu->s2crs[i].privcfg = S2CR_PRIVCFG_DEFAULT; + smmu->s2crs[i].cbndx = 0xff; + smmu->s2crs[i].count++; + } + } + + return 0; +} + struct arm_smmu_match_data { enum arm_smmu_arch_version version; enum arm_smmu_implementation model; @@ -2181,6 +2197,10 @@ static int arm_smmu_device_probe(struct platform_device *pdev) if (err) return err; + err = arm_smmu_setup_identity(smmu); + if (err) + return err; + if (smmu->version == ARM_SMMU_V2) { if (smmu->num_context_banks > smmu->num_context_irqs) { dev_err(dev, -- 2.26.2