Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3694626rdh; Thu, 28 Sep 2023 22:26:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEDTnTlzgxPZncT5wADrvRS943gBhPV5zpKlzlqeNBaAqxgP2+K6spclTvsnEFnBxSrYwxH X-Received: by 2002:a05:6830:12d5:b0:6bc:b8d9:476e with SMTP id a21-20020a05683012d500b006bcb8d9476emr3262476otq.16.1695965184548; Thu, 28 Sep 2023 22:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695965184; cv=none; d=google.com; s=arc-20160816; b=R6XH4SlxHBZzfnU64G08A515UvzkJVB47YSpjMmPFUXo6u4ejGlxWJeMUoC7SnmDwA HBvWLLcwfkNdOJfLzaHN7Q2XHZP3HObPRubsb9nN/IsdarFRZY2HpPF6siJu9qBgxWXM tz4ssSf0OyKNS1xwNEa+qrmoznZHHjAfgZ4dhR0VLcLb3OU2xRT2TmWrYSMI6fHb6iAD KwUxmCIae9uwLFRJA1rg3q1V2KBQy7p130xAo8M7jvOf/ziv67RQE+1uNogOIBckruit H04Z63DOGadmLM+YXwzOGuXC1jS9VD8aeAu5S84YYpQ3G0taphG+ZtnPaA6q8MFz3LfQ cmcw== 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=afqAn7dGHUrlAfXXYIxYiEc20eODfjmPGA+l2AIO5QA=; fh=h7qU5fspdOU2y40hULAa6AL6l1E80wvlvBv2V+GJu6E=; b=JnP1Udd7iK8pqgxXujjP5KREGzlkdwMD8AMbXW/m2aMkMZsMaJTipTCypNaF8o0Ua2 iC9DNtcbUr12rH26PZi2kQYNRuCzKN0qUjY3UrROMJvYW0Sbfocn6oqltTD7gQY0yUBM WB5DmDUVbcpPa+GOYtYv8xfTaBJKcNHJ7RiFo+EU1KyvYweFeRnBHD97XktgWzIsxwiZ Yr6HSaYWeLy6b2Jx568dWyL7Ocuwvl5oO9oQNgPU7LEjythzSt4MnCAydV5cG71gSivN +XEJBPBu24nJyGj0EnoHuSJhRp99iKlilAwYcT3I24Xi5ZEcqCNbpNPsF780OGDPDG5E I8Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=lQCH7OLO; 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=quicinc.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z19-20020a63e113000000b005859e22461csi1026816pgh.817.2023.09.28.22.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 22:26:24 -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=@quicinc.com header.s=qcppdkim1 header.b=lQCH7OLO; 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=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 03C92825A0D3; Thu, 28 Sep 2023 17:46:56 -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 S231880AbjI2Aql (ORCPT + 99 others); Thu, 28 Sep 2023 20:46:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229653AbjI2Aqj (ORCPT ); Thu, 28 Sep 2023 20:46:39 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60148B4; Thu, 28 Sep 2023 17:46:38 -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 38SNvgNl026356; Fri, 29 Sep 2023 00:46:17 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=afqAn7dGHUrlAfXXYIxYiEc20eODfjmPGA+l2AIO5QA=; b=lQCH7OLOzUdEnhZzixzvQz5U/EUMM82fB4kCv8ctjF/XnzOVjKc7wTj7REpsvwunQDbQ muVpMkt9FwQbPY3x/DP92fM+jkWSjezxXWS3G997LNu/0eH+kEfQNvleb15T/XQDcj0R EDPDYRbHrM0wQWBe992gMUYCB8xXK431197vg2gnebESjYBAnuvVf/poqAvDrc6kfuHv yDzTBw9/lJXZDZSpP9y0SvztOii9YipwceqHpKZ9pTzddTZaedespblTWLHKqGiZU+eL 5pT4Gc5LP3lnS8LjL6J4YM2xJBPTHob0nC+N4i4qKy5XRntVqvJ6G5ZHs+s6W+1KCGka uQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tdfbrrgh3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Sep 2023 00:46:17 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38T0kGXO005113 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Sep 2023 00:46:16 GMT Received: from [10.110.70.158] (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; Thu, 28 Sep 2023 17:46:13 -0700 Message-ID: <58701008-bb93-e5c6-9ca0-5bc43f9a46f0@quicinc.com> Date: Thu, 28 Sep 2023 17:46:11 -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> <65566a68-3510-2e5f-7d57-e4dba08c008c@quicinc.com> <1d9bf80d-0267-937b-4dd9-c57db7a89cb4@quicinc.com> From: Abhinav Kumar In-Reply-To: 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: f0UFRBg3XnK49yRbyxc7x5Rx8Tc3NF6g X-Proofpoint-GUID: f0UFRBg3XnK49yRbyxc7x5Rx8Tc3NF6g 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-28_24,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 malwarescore=0 impostorscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 adultscore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309290004 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 autolearn=unavailable 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]); Thu, 28 Sep 2023 17:46:56 -0700 (PDT) On 9/27/2023 3:01 PM, Stephen Boyd wrote: > Quoting Kuogee Hsieh (2023-09-25 09:07:18) >> >> On 9/22/2023 6:35 PM, Abhinav Kumar wrote: >>> >>> 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. > > Is it possible to change that timeout? I have to look around for the CTS > parameters because I'm pretty confused how it can work. What do we do if > DP wakes the system from suspend and asserts HPD? We need resume time to > be < 10ms? That's not realistic. > No, the CTS doesnt say we need to finish link training within 10ms after HPD is asserted. It says it must be completed in 10ms after TRAINING_PATTERN_SET dpcd write. "Wait until the Source DUT writes 00h to the TRAINING_PATTERN_SET byte of Reference Sink DPCD Link Configuration Field to indicate the end of the link training. Stop the link training timer. Verify that link training completed in 10ms or less" That needs to be done independent of HPD so we can ignore the CTS point. >> >> I am not sure do link training at atomic_enable() can meet this timing >> requirement. >> > > At least in the DP spec itself it doesn't require the link to be trained > within 10ms of HPD being asserted. Instead it simply recommends that the > OS start configuring the display promptly after HPD is asserted, e.g. > within 100ms. There's some strict timing on IRQ_HPD, so the driver must > read DPCD registers within 100ms of IRQ_HPD rising edge; maybe that is > what CTS is checking for? > > TL;DR: I don't see why CTS should stop us from link training in > atomic_enable(). It would be beneficial to do so to make eDP and DP the > same. It would also help to report a drm connector being connected > _before_ link training so that userspace knows the link itself is the > bad part of the equation (and not that the DP connector looks > disconnected to userspace when in fact it really is connected and the > monitor is asserting HPD, just the link training failed). Its the corrective action of the userspace when it finds link is bad is the concern as I highlighted in the other response. Just reading and resetting link_status is not enough to recover.