Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp549673rdb; Fri, 6 Oct 2023 10:57:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4x8Lf+hyo5xq0fvCmuQYoM/0zpMBxS61haZQhgCUXUwG3RzGCyComjT/dHODhBdEviHX8 X-Received: by 2002:a17:902:7d92:b0:1c3:2ee6:3802 with SMTP id a18-20020a1709027d9200b001c32ee63802mr7287553plm.47.1696615023098; Fri, 06 Oct 2023 10:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696615023; cv=none; d=google.com; s=arc-20160816; b=ZDasBoyGvg9lYO00A/V3fGXw/UQ1Fmmton9BESaYjoYu9WJ3j4LudxApbAqDZbFvea tUKp7UkriQRw/ibqVLxnPiGIFFVhmqZXeCsd4v8jY0AMO1XXoQKgqW6v7x9tJ/nKgySc FztToFhcsDoYWBlr+dwyDQPj76Q3Y+aX/obL3a5pC3qkqX1+/FEVOeeg6+FYlfIDs3Bh D1rSA7ozA24Hyg8/173FGJackPWpJOmZ/6eI1zZkwG9RLSo0Qd0ACmTtTvjol3kkg35E KxwGbBvXWEKxRF9eFVmhCNItSdGzgjM0uRERn6X/5UaBLV5qFS+ldiNJC5WMt4TYDax2 NfOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KSCSizx6FgkyRIW0X32uY+4ZXkb204qdp7z+rYedcrk=; fh=Iu05yrOKhRyKBOIps2Mjvip7s5lelUzP4uL09HFczko=; b=ZSh5XcdMSjP0wUzAc5vufZl4KHaEuUTayzbqdVCW5kfzCSga4xOqnb1AKIeo3uWJq4 M/rLhV4JqS6sdro+qLKO/VnteAzuT66VOkBob9zxKaQ/OWtjFdfn/R18WRjxMncTmrbK u1JZ1Dt09AzZRvhH0X5NYHHio+FHUhW9X5fF/Ac/6iHfdbOd6jMW77PxbwymK1pwLMH/ 5naIhGLYuRIuygt2p1fTBPcb6YtYODdpHc7VHx2pbLZwTyh3pSTWVoF3QDsna2HfdNsF ckSD+iYWRhY4mWpNhSJm1ZzvBCdrzDYLbgyjSNJeMp+8+ZVPcm3nbNksW4pHlJusp5lY 3p/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MTcjX+Ke; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id l2-20020a170902f68200b001bba4470991si4488466plg.498.2023.10.06.10.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 10:57:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MTcjX+Ke; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C4E028172972; Fri, 6 Oct 2023 10:57:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233112AbjJFR4t (ORCPT + 99 others); Fri, 6 Oct 2023 13:56:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233086AbjJFR4r (ORCPT ); Fri, 6 Oct 2023 13:56:47 -0400 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46CEADE for ; Fri, 6 Oct 2023 10:56:46 -0700 (PDT) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-59bf1dde73fso29144247b3.3 for ; Fri, 06 Oct 2023 10:56:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696615003; x=1697219803; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KSCSizx6FgkyRIW0X32uY+4ZXkb204qdp7z+rYedcrk=; b=MTcjX+Ke6n3HSn3oK09WFhilSMt4myjWE/DRirbQquDHxdiKquS1ir45OiaHI3nxzt zmdAcjuhRrVYlY4SmZnKzq4+NvDlm0QsDfwrT9kUlccAm9Pp7oXWoP0uPzDd1x4FKiI5 Rfa4CnBCU6lEz9Vc7eDGWZ3MJ9ET8jKFvjzy/sJpdqD5ZNUB/zjj+oIfT3CikTQkHpyd cszn6kqKIVTFRsA13qcuyxnpnlwrVk1xxB3qbM0P2fYtltWg9apxjFAZKZK4SuX63Wca MEpbZeMSIOdMYqzGBEMOWJK3YyNen/Gu7ZsB3o25ZTTUuw9S7KkNWDGwa5+ltiubV0UL xjyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696615003; x=1697219803; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KSCSizx6FgkyRIW0X32uY+4ZXkb204qdp7z+rYedcrk=; b=X/2nvydJjYP67Gq808j/FT/Uwxx/8mu+cQPzX4+WqhIuiOxYR+V95hnRk1mWM+z93Q gqfmsH979kO1YgrQ+CdZ5S1/7RUY+G9nwzU+14xZe5DAkupfRs1FV21lgG10n8ShBwtv Wg3PCBF4aaTvmstL5NgkTHIgXF2CeaG0tBalV5U0ioWMk1/boQRMdqmvo/nE7ekMOh5n +CA50xfmg4El+m6a/8ijoAVWDe7MHPFbEL3pQKOIGJtXZFsQflcpXaXMRTwXnN7Iu7wf clWA9yNYDvKnNJo7newLSq60kJwIXWx/5NGK19BJOUw3ZIHTUx3dz9ozVW5WMMZMkR9d bvSQ== X-Gm-Message-State: AOJu0Yy2BJc5q8XLMwUxhpu0PNiClhYOei+fg2tWGYQsyig4L+nn9oMw W01CDz/aam6odhh2yYIpittPx5cqL/hmjuySsqrjHg== X-Received: by 2002:a0d:d611:0:b0:577:1560:9e17 with SMTP id y17-20020a0dd611000000b0057715609e17mr9380421ywd.35.1696615002833; Fri, 06 Oct 2023 10:56:42 -0700 (PDT) MIME-Version: 1.0 References: <1696436821-14261-1-git-send-email-quic_khsieh@quicinc.com> <1696436821-14261-6-git-send-email-quic_khsieh@quicinc.com> In-Reply-To: <1696436821-14261-6-git-send-email-quic_khsieh@quicinc.com> From: Dmitry Baryshkov Date: Fri, 6 Oct 2023 20:56:31 +0300 Message-ID: Subject: Re: [PATCH v5 5/7] drm/msm/dp: incorporate pm_runtime framework into DP driver To: Kuogee Hsieh Cc: dri-devel@lists.freedesktop.org, robdclark@gmail.com, sean@poorly.run, swboyd@chromium.org, dianders@chromium.org, vkoul@kernel.org, daniel@ffwll.ch, airlied@gmail.com, agross@kernel.org, andersson@kernel.org, quic_abhinavk@quicinc.com, quic_jesszhan@quicinc.com, quic_sbillaka@quicinc.com, marijn.suijten@somainline.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 06 Oct 2023 10:57:00 -0700 (PDT) X-Spam-Level: ** On Wed, 4 Oct 2023 at 19:27, Kuogee Hsieh wrote: > > Currently DP driver is executed independent of PM runtime framework. > This leads msm eDP panel can not being detected by edp_panel driver during > generic_edp_panel_probe() due to AUX DPCD read failed at edp panel driver. > Incorporate PM runtime framework into DP driver so that host controller's > power and clocks are enable/disable through PM runtime mechanism. > Once PM runtime framework is incorporated into DP driver, waking up device > from power up path is not necessary. Hence remove it. > > After incorporating pm_runtime framework into eDP/DP driver, dp_pm_suspend() > to handle power off both DP phy and controller during suspend and > dp_pm_resume() to handle power on both DP phy and controller during resume > are not necessary. Therefore both dp_pm_suspend() and dp_pm_resume() are > dropped and replace with dp_pm_runtime_suspend() and dp_pm_runtime_resume() > respectively. > > Changes in v5: > -- remove pm_runtime_put_autosuspend feature, use pm_runtime_put_sync() directly > -- squash add pm_runtime_force_suspend()/resume() patch into this patch > > Changes in v4: > -- reworded commit text to explain why pm_framework is required for edp panel > -- reworded commit text to explain autosuspend is choiced > -- delete EV_POWER_PM_GET and PM_EV_POWER_PUT from changes #3 > -- delete dp_display_pm_get() and dp_display_pm_Put() from changes #3 > -- return value from pm_runtime_resume_and_get() directly > -- check return value of devm_pm_runtime_enable() > -- delete pm_runtime_xxx from dp_display_remove() > -- drop dp_display_host_init() from EV_HPD_INIT_SETUP > -- drop both dp_pm_prepare() and dp_pm_compete() from this change > -- delete ST_SUSPENDED state > -- rewording commit text to add more details regrading the purpose > of this change > > Changes in v3: > -- incorporate removing pm_runtime_xx() from dp_pwer.c to this patch > -- use pm_runtime_resume_and_get() instead of pm_runtime_get() > -- error checking pm_runtime_resume_and_get() return value > -- add EV_POWER_PM_GET and PM_EV_POWER_PUT to handle HPD_GPIO case > -- replace dp_pm_suspend() with pm_runtime_force_suspend() > -- replace dp_pm_resume() with pm_runtime_force_resume() > > Signed-off-by: Kuogee Hsieh > Reported-by: kernel test robot > --- > drivers/gpu/drm/msm/dp/dp_aux.c | 5 ++ > drivers/gpu/drm/msm/dp/dp_display.c | 166 ++++++++++++------------------------ > drivers/gpu/drm/msm/dp/dp_power.c | 16 ---- > drivers/gpu/drm/msm/dp/dp_power.h | 11 --- > 4 files changed, 59 insertions(+), 139 deletions(-) [skipped] > @@ -1702,6 +1638,12 @@ void dp_bridge_hpd_enable(struct drm_bridge *bridge) > struct dp_display_private *dp = container_of(dp_display, struct dp_display_private, dp_display); > > mutex_lock(&dp->event_mutex); > + if (pm_runtime_resume_and_get(&dp->pdev->dev)) { > + DRM_ERROR("failed to start power\n"); It was in the previous review comment: "failed to resume". > + mutex_unlock(&dp->event_mutex); > + return; > + } > + -- With best wishes Dmitry