From patchwork Fri Oct 15 23:13:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 515855 Delivered-To: patch@linaro.org Received: by 2002:ac0:da11:0:0:0:0:0 with SMTP id d17csp1002748imi; Fri, 15 Oct 2021 16:11:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfdUgnoScklWEDTDBoRv0nyHhVrVpPSK5w8F68C2L/e44aiBKFr0+pEuD8c4vnsG8Rv5V8 X-Received: by 2002:a65:5082:: with SMTP id r2mr11143272pgp.353.1634339484115; Fri, 15 Oct 2021 16:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634339484; cv=none; d=google.com; s=arc-20160816; b=En+V6IH5xQXAqP1F8YP8L38mI4aTWqxJkv+nkr9o1E0G+6E/aO/9sEJDHdjQFCmmBV LkjmrcADkUOOf4SOQYk+EOjupXJTUHo7VrBP7XkYt2EL/zx9plVa8MT24dY9KKpNojmv xsL3O4ngv5XXVGMOyEaxsIp3nP+efqKLkz5Lr17lRKtMf8FfwQ993Dq3QYSxGNsfCnRT Eu5W9BNoL7rZ3ELh8gfhRjYg3tOo2oPYsuZyH1Uw+Egmdp6ZfKVSy9g4byz6L5JTWGxi Uo39uyMS3B4zHCuWIjE8w3vJyhNPuZv2of9sxgeIVbmDSzPgtrZqcsQ5PVLsfa3UyZ3b J7yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :delivered-to; bh=HUmZDgtmuXy7pQJ38Tzw5qxbkrp4xNejQK3lDNZjLFg=; b=s8nJ0ujTSDKNmbuO5tjOS3hvUs47yBC10/pn6sW8n5HZDXQF6dwOSc6k5SZjJSiKz0 nwbLDlBTi69U0iTafU2aia9BD2oP3ipA+XhxagjfU+DXhzyOQVSKf3dBdJdhRFjNpOmZ yWLLshoV7O9+F3FwMOdj3Vp2vFv8Xtcti7Pu6YUDgGlOLcm1UYhAUAdo4WNsveLI6K8C 0nr0pf/2+/MTZwHtt8kQlGHEEOv1WTtof9m0UxCnbRErchjfoo+e7QMQBx175wtkO5bA TQxjhRHIWV8Jo7BhWdBLuvRbELCXzOSFoBioYubaxd1XVhCLx7EESYlxkpeAaM6cvaj+ nOXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vkr6f/Hn"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id u9si13005179ple.97.2021.10.15.16.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 16:11:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vkr6f/Hn"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E7F66EE06; Fri, 15 Oct 2021 23:11:20 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) by gabe.freedesktop.org (Postfix) with ESMTPS id 541946EE06 for ; Fri, 15 Oct 2021 23:11:19 +0000 (UTC) Received: by mail-ot1-x336.google.com with SMTP id 34-20020a9d0325000000b00552cae0decbso4629556otv.0 for ; Fri, 15 Oct 2021 16:11:19 -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:mime-version :content-transfer-encoding; bh=HUmZDgtmuXy7pQJ38Tzw5qxbkrp4xNejQK3lDNZjLFg=; b=vkr6f/Hnqm9g23KalLp7H/Lvpczy/LuFqXn7egw6IF25H2KapElTrVg3Oqh1ajaUZY ulzMIZfZog772rpAe5L1W7zbyXfyvIJ+b8YfW/EWJ/n7Ono02IFwDP58Tl7GGuhp3RNn a/IUG0Fj6kytSJpwHC6E9t/JWfxDXMxBV5F3XYTdPqwAWsIsIor7koJ8WK5B5Pv3jmSU rOOEO8VcI2OecCLlM/twc+zcaPYuWkg+Q9q13hisWtswSTJK5QRvsD7VxwS6nNUcSIgB pipXe5b7SwCtu69ZrAhp/LhgXR6gPTNVPqedmym1S5l34I4IvmgPInmbyuYxoH28qvkF O1fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HUmZDgtmuXy7pQJ38Tzw5qxbkrp4xNejQK3lDNZjLFg=; b=8FYdg5HAZArnPRS32z32oameQUgMtiCZkKRqouK+VqgOZ/r7ydNRIkyixa5YNQMKJP IWkoYMhij2crclVshjpP00q7fNLP7OiVimAegfWotiyULIYbTlWzqm3DW+Xi5d1eLS1H N96HbWrNAKcg3JxuwQnHp7UbpwcJb7DI3jl+CcmxB3oyE2OQIbeslso5TG3zStLTk4ou ykfXOgH/QBITo4qbnXdD4ojdmunDxaCkDzMuZk9jlovcDi2GcRItoasB1Fjtxnl84E5G GL2eUNugdJhQKDmyZFItj1dYhJ11lGXMfTCUUk92Ie2zuWdevQezuX0/tdzDFPTj2Fx6 fyvg== X-Gm-Message-State: AOAM533PGU5fXBIm3iyUZWmPRuGEzGblZshcQMDrohdxA9nJaqJPU+4Z 2hGx2Si7hJgPe2/PBr4zlMOCRg== X-Received: by 2002:a9d:a61:: with SMTP id 88mr10612502otg.152.1634339478519; Fri, 15 Oct 2021 16:11:18 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:a0:3dc8:205:1bff:fec0:b9b3]) by smtp.gmail.com with ESMTPSA id 103sm1527969otj.44.2021.10.15.16.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 16:11:18 -0700 (PDT) From: Bjorn Andersson To: Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Kuogee Hsieh , Stephen Boyd , Dmitry Baryshkov , Abhinav Kumar Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/msm/dp: Only create debugfs for PRIMARY minor Date: Fri, 15 Oct 2021 16:13:07 -0700 Message-Id: <20211015231307.1784165-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" dpu_kms_debugfs_init() and hence dp_debug_get() gets invoked for each minor being registered. But dp_debug_get() will allocate a new struct dp_debug for each call and this will be associated as dp->debug. As such dp_debug will create debugfs files in both the PRIMARY and the RENDER minor's debugfs directory, but only the last reference will be remembered. The only use of this reference today is in the cleanup path in dp_display_deinit_sub_modules() and the dp_debug_private object does outlive the debugfs entries in either case, so there doesn't seem to be any adverse effects of this, but per the code the current behavior is unexpected, so change it to only create dp_debug for the PRIMARY minor. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_display.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.29.2 diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 3aa67c53dbc0..06773b58bb60 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "msm_drv.h" @@ -1463,6 +1464,10 @@ void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor *minor) dp = container_of(dp_display, struct dp_display_private, dp_display); dev = &dp->pdev->dev; + /* Only create one set of debugfs per DP instance */ + if (minor->type != DRM_MINOR_PRIMARY) + return; + dp->debug = dp_debug_get(dev, dp->panel, dp->usbpd, dp->link, dp->dp_display.connector, minor);