From patchwork Thu Jun 24 17:17:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 12342663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39681C49EA5 for ; Thu, 24 Jun 2021 17:20:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0B2D061166 for ; Thu, 24 Jun 2021 17:20:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B2D061166 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=08ajThNFm2L/fzXw7MRN151ae8HS0VC3JR+FECJYdLA=; b=XGJLlTFgr+lVHM YxNk8K1OOBgQIXSqoIh+0sb++wuJGRcw0cIZPnAg9IT+S1l/gaL1h+xsvbrEAgcm+Bk6RkMpZlCu9 pdeTjli5s5s1ls84dWFP29hu8WHZLzslqCpe76NiC1767L2rLTXyfW4PVzT3o5mglF4AMsTFdYNhk NK8bDvbIeL1lRKowvUqXYLFU+R+53X9f+FqpnLOdWNT9OCDuuPotkFdxClAEvdL78P/yC8OEDIU6G tzCc1MzRVDwLqjv5nGtdjdcSMqgQJF4OsWBRf3lQPNqTGlBNpaqzOjtThyV4NOV4iDh3fhPloKq7F PZNNeHdQ4U0loAsWDYiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwSzy-00FbjU-U8; Thu, 24 Jun 2021 17:18:43 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwSzl-00FbfU-MB for linux-arm-kernel@lists.infradead.org; Thu, 24 Jun 2021 17:18:32 +0000 Received: by mail-pg1-x529.google.com with SMTP id v7so5293766pgl.2 for ; Thu, 24 Jun 2021 10:18:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ltzQtO7QGv7ihuZ03SI1P6XFOPcuSJGUvlCT/41r+iE=; b=E3OBm6d+DSXVCCSeW92dikvGwmwuqWU/DsoUwEYgJrR2tlg8YH4d/NZF7DVqR7/He+ LenZJUO1mfAjegUrPWjAnmmG5S7PCCZ42geQk165WsFmQEdnb0Ad39+HwartwwMFYgMQ 9jjJUrS+i22102pFcWK6Q0jsikCiBKGzI6+UY= 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=ltzQtO7QGv7ihuZ03SI1P6XFOPcuSJGUvlCT/41r+iE=; b=NIHriaHGerpUYQ9EoOFsY5gmd7vaf05xgdd/SS3mAyawL22N7bdUX3gJ8hWj//GFDV /Hnq0xh45cR3s9+0UFuJVC5/zBywSTq0BssLtcVZ1xQbVYusk0Bn1uyhYpMuiE5bpzuC NY+/p8YZrHghXYMBvt6ZmyACAi4OUhzlHJeRMTZIrhkIUJqOWdTI/jnrH1bDWdGawy6n 83gD2+lKGBK6NN21dY048mTU1VopNdMOnu9/qPv8SBkwT27orn66MAKcXxFPfsNCvgJ+ Lc4H6Sv75mT+GJMLiC3fx26g0cawNjQbeoqVPKv5UMn/OlqIMNJoyI3WwompXsy19yAR vKwg== X-Gm-Message-State: AOAM531tLyLOce0CY6kxC0+1usR3gtyYad/nmrFsp76UpZ0cCvUMQNFB AshB1HsJALJ1uuhSYiBqdrSLwg== X-Google-Smtp-Source: ABdhPJy3hQDCnPl6h1dVLCWoQFoDYGjFrg2/1rsYH0TJwFbq3jVshaM62dCqdnk2IUlzQb/NxFXZ3A== X-Received: by 2002:a63:1263:: with SMTP id 35mr5496773pgs.221.1624555108972; Thu, 24 Jun 2021 10:18:28 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:201:fd74:62bc:19e3:a43b]) by smtp.gmail.com with ESMTPSA id z9sm3365960pfa.2.2021.06.24.10.18.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 10:18:28 -0700 (PDT) From: Douglas Anderson To: will@kernel.org, robin.murphy@arm.com, joro@8bytes.org, bjorn.andersson@linaro.org, ulf.hansson@linaro.org, adrian.hunter@intel.com, bhelgaas@google.com Subject: [PATCH v2 2/3] iommu/arm-smmu: Check for strictness after calling impl->init_context() Date: Thu, 24 Jun 2021 10:17:58 -0700 Message-Id: <20210624101557.v2.2.I0ddf490bdaa450eb50ab568f35b1cae03bf358f0@changeid> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog In-Reply-To: <20210624171759.4125094-1-dianders@chromium.org> References: <20210624171759.4125094-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210624_101829_765358_1F97AD13 X-CRM114-Status: GOOD ( 13.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robdclark@chromium.org, saiprakash.ranjan@codeaurora.org, linux-kernel@vger.kernel.org, saravanak@google.com, Jordan Crouse , linux-arm-msm@vger.kernel.org, john.garry@huawei.com, linux-mmc@vger.kernel.org, quic_c_gdjako@quicinc.com, Douglas Anderson , Nicolin Chen , iommu@lists.linux-foundation.org, Thierry Reding , linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, joel@joelfernandes.org, rajatja@google.com, sonnyrao@chromium.org, vbadigan@codeaurora.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Implementations should be able to affect the strictness so reorder a little bit so we call them before we look at the strictness. Signed-off-by: Douglas Anderson --- Changes in v2: - Patch moving check for strictness in arm-smmu new for v2. drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 6f72c4d208ca..659d3fddffa5 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -761,15 +761,15 @@ static int arm_smmu_init_domain_context(struct iommu_domain *domain, .iommu_dev = smmu->dev, }; - if (!iommu_get_dma_strict(domain)) - pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT; - if (smmu->impl && smmu->impl->init_context) { ret = smmu->impl->init_context(smmu_domain, &pgtbl_cfg, dev); if (ret) goto out_clear_smmu; } + if (!iommu_get_dma_strict(domain)) + pgtbl_cfg.quirks |= IO_PGTABLE_QUIRK_NON_STRICT; + if (smmu_domain->pgtbl_quirks) pgtbl_cfg.quirks |= smmu_domain->pgtbl_quirks;