Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp114173rdh; Sat, 23 Sep 2023 03:57:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHbrxwF8bLDIySyN6J/wm7nsqD+5qnFBwZqe4QRVzdyHTgKwSNJ6Ijajec4GhngnCSvcc3u X-Received: by 2002:a05:6808:14a:b0:3ab:7f46:ecc5 with SMTP id h10-20020a056808014a00b003ab7f46ecc5mr2518930oie.35.1695466674968; Sat, 23 Sep 2023 03:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695466674; cv=none; d=google.com; s=arc-20160816; b=WVtj0PSQdr09oyL8nCgW2WLwOfz04xasS/0yRcnBXWutvyvlIAF7IjvLM4edZwCMoJ nBejwVsUeCqrOOkkgAzpfwc1Z/RYUdf2tbX/vquRi2f1X9BgfuDTDGfM6W1m0gPDk/9F T0QUxPM/eel+kg1zxghq8ef6NdJe78tQYt/HfexiOhKTtDBu5OoaoZyXsQRFcyuMPGdG 53nnizZ0HhmyrNGadh5lIigPbIiBj1rn8wTK8L/n94lu38HXar2fOnZWgKtSCpz916km eX02uDP9MIy0SkrZmLBsln+a4ELtZ7FI3im1YbqG6UgYAgHU2pSShZqo1ITJY7oBtkDb fimw== 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=C5Pi/Hiu81gwHXsRnreMP9dALYwD5nvn3uXY+FzJ5CU=; fh=h7qU5fspdOU2y40hULAa6AL6l1E80wvlvBv2V+GJu6E=; b=eNWqFfYlEyXIpmzUplEnEb3UTVK0c/9PsuHANPIrODJoZusk4/t4ln0jgkzbfuy9mn YK8KvdMw5c3BDhP+lUvNvuDu8eo2b5K3zcdxtSgMwr+oMJTZvD+IS0mqDNTxEcegm4ms yxhIQGJEwaAF35FOvV1HJy7WhvCTVex54e8XwIaWjKrgbCyGLeyms2Ja7NohEkqzHsi5 ITBb2ieFBi3JhX9KeiF2ASIKkagsBgGhzjPTnjOYWlmhenQzZIvCPX39GFUhhnJ0DUF/ MwElcaclpsFc9yNorwJxkkfbvHlp1r3ck7h5URUocLoC5DEv/SbFQQ3UldHsbcku+/XM pKoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="UR/I0rfH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id dw27-20020a056a00369b00b0068e3baee27esi5739160pfb.266.2023.09.23.03.57.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 03:57:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="UR/I0rfH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 89C9C837EA62; Fri, 22 Sep 2023 18:36:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbjIWBgA (ORCPT + 99 others); Fri, 22 Sep 2023 21:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjIWBgA (ORCPT ); Fri, 22 Sep 2023 21:36:00 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A168CE8; Fri, 22 Sep 2023 18:35:53 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38N16bxV006809; Sat, 23 Sep 2023 01:35:31 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=C5Pi/Hiu81gwHXsRnreMP9dALYwD5nvn3uXY+FzJ5CU=; b=UR/I0rfH5D+g0vFQjL3/9zWDvCQgqo3aCrSWEtKcbrdDnwAX4m1qrAIet41PNXQ8pYiH p6elEErFhNZmClpyoo4ELt75aqRgBb9VuUflbvgVaIqmGlAzV/Ci1FlwztYmaNH9lagT 9C6QuKLVm4/5+ee2fyQYp9Mc99tYxNJNQlvqypZDVBmv/EGRIeyxjEz9/BQVzmcNcJCR YIWBFaphfAMVTpPZbjaQxe1387SzlynkTwmVIPQLLHRvhss96t3Ywra2CRy1h63xE0wO lJcl6kjTyB1Z35MzalJsK+h77ELyxO8LnqXhBbdQypVoCRa5ESCLIhDpA0yvjCob42RL iA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t9nqnr1ve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 23 Sep 2023 01:35:30 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38N1ZThO017144 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 23 Sep 2023 01:35:29 GMT Received: from [10.110.28.191] (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; Fri, 22 Sep 2023 18:35:28 -0700 Message-ID: <65566a68-3510-2e5f-7d57-e4dba08c008c@quicinc.com> Date: Fri, 22 Sep 2023 18:35:27 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3 6/7] drm/msm/dp: add pm_runtime_force_suspend()/resume() Content-Language: en-US To: Stephen Boyd , Dmitry Baryshkov , Kuogee Hsieh 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> From: Abhinav Kumar In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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-GUID: UlklZ01rmbcdcrNvAHp9SEp5pFYq-myZ X-Proofpoint-ORIG-GUID: UlklZ01rmbcdcrNvAHp9SEp5pFYq-myZ 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-22_21,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 phishscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 spamscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309230013 X-Spam-Status: No, score=1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 22 Sep 2023 18:36:08 -0700 (PDT) X-Spam-Level: * 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