Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1410074rdh; Mon, 25 Sep 2023 11:52:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGYWDiwRl/P1EzFih74JzTERuM+dGFXZRrvRPz10j/VdQLgJOBdEvFo0k2nsFBITmXvzBpf X-Received: by 2002:a05:6a20:7486:b0:128:ffb7:dcfe with SMTP id p6-20020a056a20748600b00128ffb7dcfemr742083pzd.1.1695667931096; Mon, 25 Sep 2023 11:52:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695667931; cv=none; d=google.com; s=arc-20160816; b=jfB9/zsN9A7z8vhH/xrybM7ITwD8pK3FRWQDSDwVrehyhUNkXlSeWlhBPisTGnsjUu XAgcibeET3e9B0be6dl6/y8UGJtu7z6N+O0qyTPPxVslHPbv4/I3OUhnbaAy6LLwplha qDgktT/zX2HYMc9LWsihYE8k9UVXUkAVNJfakdHpDNAFC+tUX7mq6k0u7fV4VJiVYzec EiCTU+XUIKocpI3Xc2QIK+bO2BgzFTlsIpgqo4jJh9NeomJB+DPagpbq8fPGs9MPciQx eeAtFf5JvhB5BCorULrKsn4cpkAe52Pk+V7PDIU14nbeX/OqFXWTZy2rOMbfkKh/yfhe hFiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=JAoOarfwvRZXn1BQvmqwapFIbkl3fBs0IHfImvog/zI=; fh=ZZ/pYUntoo9B53723lcqkKrDwMhSCrwuaD/g6L0hA08=; b=QWn0ZZcPv7eaR75ZyMEVhUtMfpwE56bpKMeQ+wgOtR7wTMj3Gr3XK+UwUVH/ScaOM8 3et10ZwVzVET9cnYmY4nVe70Pr0Ndun5fJMcTM0W7skvRI8Gdo49Q/3CLU4WlV3gx2Qh 87ZUXjclKAq/osargFz1Oi5TLYo0yg4DXLpw98WtsJueNa1hOTEV597d0mQhRCVU0vLO IZuL4RC3eHB4xJUX6yVBYF6SoYIwFltt9Qjs/cgkZRXywEZ0XR+go6aQuR5xe9DFu9zW LdhqgzQf3gWKOf8iMh2Dn1PNMTgVOxKvuUhipwhB0RSuW2wd9ZJdAaB1UmOLGYg2A2B4 jy1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=aiOKnXcw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bu6-20020a056a00410600b006910a45a23bsi10590164pfb.366.2023.09.25.11.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 11:52:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=aiOKnXcw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 5D910807793E; Mon, 25 Sep 2023 09:07:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233159AbjIYQHx (ORCPT + 99 others); Mon, 25 Sep 2023 12:07:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233120AbjIYQHu (ORCPT ); Mon, 25 Sep 2023 12:07:50 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE85C101; Mon, 25 Sep 2023 09:07:43 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38PEGBFt007267; Mon, 25 Sep 2023 16:07:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=JAoOarfwvRZXn1BQvmqwapFIbkl3fBs0IHfImvog/zI=; b=aiOKnXcw7wl0G0ITN3J/vczi8Kh32vc1HHKXjyzgTXrA60pXUzHE2v5wHFFiEhjZde9U sRaveN32STxxQcpSuxGiUznzYM78ODWB6+pkAQtkQ0wlmXbg/ET3rfh6CpJ4eJDC97wq RmsWtKgtjtKL4aD7fUFYcXOVh4buTV+xiPO1f6SMXgpEemlTGSM1F28DCJD4sgYnkO+i SRTJAPxUSm/WtmebBRT9Ow/vBWFWQsKPPkmRIwtw66miNPKyg96bl3vUxrXz4W1Uwns+ IDrf7B8t15FOcAE5piowVGX7YBs99kLZIj/LVv/w1ErLKRkvR5ngFjxTjJTEsTfK9cod pA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tb5n89877-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Sep 2023 16:07:21 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38PG7LFQ027910 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Sep 2023 16:07:21 GMT Received: from [10.110.46.220] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Mon, 25 Sep 2023 09:07:19 -0700 Message-ID: <1d9bf80d-0267-937b-4dd9-c57db7a89cb4@quicinc.com> Date: Mon, 25 Sep 2023 09:07:18 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 6/7] drm/msm/dp: add pm_runtime_force_suspend()/resume() Content-Language: en-US To: Abhinav Kumar , Stephen Boyd , Dmitry Baryshkov CC: , , , , , , , , , , , , , , References: <1694813901-26952-1-git-send-email-quic_khsieh@quicinc.com> <1694813901-26952-7-git-send-email-quic_khsieh@quicinc.com> <2f98d5f1-57c1-d9fe-cb1c-b975db057287@quicinc.com> <65566a68-3510-2e5f-7d57-e4dba08c008c@quicinc.com> From: Kuogee Hsieh In-Reply-To: <65566a68-3510-2e5f-7d57-e4dba08c008c@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: Wij6QzDqF0P95Gh71wzbih36j-IAi5RL X-Proofpoint-GUID: Wij6QzDqF0P95Gh71wzbih36j-IAi5RL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-25_13,2023-09-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 adultscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 spamscore=0 clxscore=1015 malwarescore=0 mlxlogscore=999 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309250124 X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Mon, 25 Sep 2023 09:07:54 -0700 (PDT) On 9/22/2023 6:35 PM, Abhinav Kumar wrote: > Hi Stephen > > On 9/22/2023 2:54 PM, Stephen Boyd wrote: >> Quoting Dmitry Baryshkov (2023-09-19 02:50:12) >>> On Mon, 18 Sept 2023 at 20:48, Kuogee Hsieh >>> wrote: >>>> >>>> >>>> On 9/15/2023 6:21 PM, Dmitry Baryshkov wrote: >>>>> On Sat, 16 Sept 2023 at 00:38, Kuogee Hsieh >>>>> wrote: >>>>>> Add pm_runtime_force_suspend()/resume() to complete incorporating pm >>>>>> runtime framework into DP driver. Both dp_pm_prepare() and >>>>>> dp_pm_complete() >>>>>> are added to set hpd_state to correct state. After resume, DP >>>>>> driver will >>>>>> re training its main link after .hpd_enable() callback enabled HPD >>>>>> interrupts and bring up display accordingly. >>>>> How will it re-train the main link? What is the code path for that? >>>> >>>> 1) for edp, dp_bridge_atomic_enable(), called from framework, to start >>>> link training and bring up display. >>> >>> And this path doesn't use .hpd_enable() which you have mentioned in >>> the commit message. Please don't try to shorten the commit message. >>> You see, I have had questions to several of them, which means that >>> they were not verbose enough. >>> >>>> >>>> 2) for external DP, HPD_PLUG_INT will be generated to start link >>>> training and bring up display. >>> >>> This should be hpd_notify, who starts link training, not some event. >> >> I think this driver should train the link during atomic_enable(), not >> hpd_notify() (or directly from the irq handler). The drm_bridge_funcs >> talk a bit about when the clocks and timing signals are supposed to be >> enabled. For example, struct drm_bridge_funcs::atomic_pre_enable() says >> the "display pipe (i.e.  clocks and timing signals) feeding this bridge >> will not yet be running when this callback is called". And struct >> drm_bridge_funcs::atomic_enable() says "this callback must enable the >> display link feeding the next bridge in the chain if there is one." >> >> That looks to me like link training, i.e. the display link, should >> happen in the enable path and not hpd_notify. It looks like link >> training could fail, but when that happens I believe the driver should >> call drm_connector_set_link_status_property() with >> DRM_MODE_LINK_STATUS_BAD. The two callers of that which exist in the >> tree also call drm_kms_helper_hotplug_event() or >> drm_kms_helper_connector_hotplug_event() after updating the link so that >> userspace knows to try again. >> >> It would be nice if there was some drm_bridge_set_link_status_bad() API >> that bridge drivers could use to signal that the link status is bad and >> call the hotplug helper. Maybe it could also record some diagnostics >> about which bridge failed to setup the link and stop the atomic_enable() >> chain for that connector. > > Doing link training when we get hpd instead of atomic_enable() is a > design choice we have been following for a while because for the case > when link training fails in atomic_enable() and setting the link > status property as you mentioned, the compositor needs to be able to > handle that and also needs to try with a different resolution or take > some other corrective action. We have seen many compositors not able > to handle this complexity. So the design sends the hotplug to usermode > only after link training succeeds. > > I do not think we should change this design unless prototyped with an > existing compositor such as chrome or android at this point. > > Thanks > > Abhinav We did perform link training at atomic_enable() at eDP case since we can assume link training will always success without link rate or link lane being reduced. However for external DP case, link training can not be guarantee always success without link rate or lane being reduced as Abhinav mentioned. In addition,  CTS (compliance test) it required to complete link training within 10ms after hpd asserted. I am not sure do link training at atomic_enable() can meet this timing requirement.