From patchwork Tue May 16 22:20:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 13243935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8172CC77B75 for ; Tue, 16 May 2023 22:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229534AbjEPWUs (ORCPT ); Tue, 16 May 2023 18:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230056AbjEPWUr (ORCPT ); Tue, 16 May 2023 18:20:47 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1968859D2; Tue, 16 May 2023 15:20:46 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1ae3fe67980so1982395ad.3; Tue, 16 May 2023 15:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684275645; x=1686867645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=osWWYYQseCvJCBZt1Q3stKtUhhbUrnP9MQ0pNGBM3gY=; b=g/foAuQVywceUd2vkSxoKCros6/PiFyEdDf5xt0p72vPNe9I4bSzLoL/vquN64+kAD PIkh7655q/gv4B8jOrPmVQlN/bsS1vdzytkxuf48LAxUxusGEFxr+xwaYdlOxwY72/yU Szl7+Z0lsWtCdv9nKJsAYYHnM9MBsgspJF/D+8jB3XYolmMJScMNxoukf/IPm4rfIz/K guK7/lKMtpkPlutb6AkiP6MbGLEzrr4gPv1zLv0Nd3h6uk+q8kV2nKJ3BT0uz2IWaeds K24z8j6WONz7FwK7TnPP4CIWOUnaWp1+dNOjYb1VCYrdz6QFl7FFkq6ULV9TImhSprkV 75xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684275645; x=1686867645; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=osWWYYQseCvJCBZt1Q3stKtUhhbUrnP9MQ0pNGBM3gY=; b=Jc2ivd5bDxwpCKI5IQo2HMB/ANOK2PYMgQsoptJf9Pl84uNWQ/GmqF1XQNSp5DHGcZ ls+1ct1m1qXTfDAA275YhDxljwSKni1SpoIfEd1XemucxCN/S0hUZbiwOJ1kM0zS5jFW mBRHZvGFKbA1YtO2uzeOpWmOkD/FHIOUT4HuWRRvwCDwZQ3tAwgV8By27Lg04SbPgLvF RHBoyEB054VWD0vXYwjVtjgJpY8gvE+5XJ6FbYddmuBMxiBADkrELIUO/JX1c7KKMqgB 3JUYjcMfjiQyWVerK2dFbA0v7SD3/ejJmomyCKbF04dVkSbDAdV7hYkqE7KBUI/jySGM VItw== X-Gm-Message-State: AC+VfDzEjsLmCU+MtS8SKf5Av5cfus6+VlMwdeE3TaqdVYlepGg52U4i 9t4TAJakf8+0KigqRMjBo0M= X-Google-Smtp-Source: ACHHUZ56Oy1tbNsnATMkInzMat6wSqCNeaSNNYU8KTeCB983x8CWAKSUxkzxAs2XGLpr4nqa/v4LaA== X-Received: by 2002:a17:902:d491:b0:1ad:faf7:5c93 with SMTP id c17-20020a170902d49100b001adfaf75c93mr13955599plg.5.1684275645520; Tue, 16 May 2023 15:20:45 -0700 (PDT) Received: from localhost ([2a00:79e1:abd:4a00:61b:48ed:72ab:435b]) by smtp.gmail.com with ESMTPSA id n10-20020a170902e54a00b001ac741dfd29sm16001971plf.295.2023.05.16.15.20.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 15:20:45 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org, iommu@lists.linux-foundation.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Dmitry Baryshkov , Konrad Dybcio , Will Deacon , Rob Clark , Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v4 2/2] drm/msm: Be more shouty if per-process pgtables aren't working Date: Tue, 16 May 2023 15:20:37 -0700 Message-Id: <20230516222039.907690-2-robdclark@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230516222039.907690-1-robdclark@gmail.com> References: <20230516222039.907690-1-robdclark@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark Otherwise it is not always obvious if a dt or iommu change is causing us to fall back to global pgtable. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_iommu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c index 418e1e06cdde..9b19124c9bd0 100644 --- a/drivers/gpu/drm/msm/msm_iommu.c +++ b/drivers/gpu/drm/msm/msm_iommu.c @@ -227,21 +227,26 @@ struct msm_mmu *msm_iommu_pagetable_create(struct msm_mmu *parent) struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(parent->dev); struct msm_iommu *iommu = to_msm_iommu(parent); struct msm_iommu_pagetable *pagetable; const struct io_pgtable_cfg *ttbr1_cfg = NULL; struct io_pgtable_cfg ttbr0_cfg; int ret; /* Get the pagetable configuration from the domain */ if (adreno_smmu->cookie) ttbr1_cfg = adreno_smmu->get_ttbr1_cfg(adreno_smmu->cookie); - if (!ttbr1_cfg) + + /* + * If you hit this WARN_ONCE() you are probably missing an entry in + * qcom_smmu_impl_of_match[] in arm-smmu-qcom.c + */ + if (WARN_ONCE(!ttbr1_cfg, "No per-process page tables")) return ERR_PTR(-ENODEV); pagetable = kzalloc(sizeof(*pagetable), GFP_KERNEL); if (!pagetable) return ERR_PTR(-ENOMEM); msm_mmu_init(&pagetable->base, parent->dev, &pagetable_funcs, MSM_MMU_IOMMU_PAGETABLE); /* Clone the TTBR1 cfg as starting point for TTBR0 cfg: */