Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1036646rdb; Tue, 19 Sep 2023 19:22:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHp62LLixldG/yaoEZmzSoVscC+8Tim+QRrt3zcc3ACvCFPeH+ValD2lRtv7KV/TZp8+qpq X-Received: by 2002:a05:6830:1393:b0:6b8:f588:2c79 with SMTP id d19-20020a056830139300b006b8f5882c79mr1167892otq.1.1695176536477; Tue, 19 Sep 2023 19:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695176536; cv=none; d=google.com; s=arc-20160816; b=BF3D+gbq5JXf38dS2EvSoPBPOsZV8rvR0bUjAZWf9fEd2Klf3rABdmNkWpMMqYHBt1 z1eKfOYPj8yZxJwqmPQ143Ytng+G2rJD5JHGhSJo1ej182KGCUM5Bm5uJRum6NOdP+vY /sT+d340J1nDF5A5gp+C1qOBaRQA4JbdSgAY9iVJvGrJ0CRa137YpyhxRygGCbB2MjIq 0mL724XekoSr9NV+F6WKExUihlr/dpqXTS3qdkipObyXt+UfZLwjlZKvxW+qIMyj7S83 bukYh91XY1XLrUz3XzZBtf3kLG3m0+R5+PekpL8R6q7UVz4nkhscfum7eOKXy4egHAfP agNQ== 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=yFvkAN2U77GZQzYs3I/vg/aVIL6xZ9s/4RXI0DI68lo=; fh=iudels89fK5wwNHQ5Lfpf0E+Ph0rY5HVLkGrsCWt3vk=; b=h7lFVD52S5aIA1KeagP9L2ec/jceCKVWtBT+awjmiR1jILPwvH9cQnotROEBVi49tf 3rUZxXLVhQL3YytbkdyH/UFmh6cUzeXT9ixGMslOckZ3q3EB1j+acZFQXCQfk+nDTFB5 5WQt7mjPUxhX52izhUTSPuNcS3bjj052M9MtXmyK7oxPHplkilB6YGS0pIzLgSj+f4fr dxElaIjMHk5x3sLirs4HRFbgsso/a2iamlBtdvO2E/n8Jp5KM8gen9iqlqIzplx/pXdK 9CVFJFrYTO/cT+UUiVmIwUhBvIk6c6ibpp88kUHVhO4f2zWX/tnYEe9HjEOXUfp65Sa7 sXjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WPCKnLsY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u64-20020a638543000000b00578cc95d3fbsi1197515pgd.635.2023.09.19.19.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 19:22:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=WPCKnLsY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 477E880752A4; Tue, 19 Sep 2023 15:53:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232649AbjISWxo (ORCPT + 99 others); Tue, 19 Sep 2023 18:53:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjISWxn (ORCPT ); Tue, 19 Sep 2023 18:53:43 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 904CBBA for ; Tue, 19 Sep 2023 15:53:37 -0700 (PDT) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38JLOoaq007293; Tue, 19 Sep 2023 22:53:18 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=yFvkAN2U77GZQzYs3I/vg/aVIL6xZ9s/4RXI0DI68lo=; b=WPCKnLsYZhN6BwmrysIUYUlg90n9pWY/zcmazsA2k1asDuyTBSfdqCB2T0CoCdonBLTt oVydH4SMZxnL5NzSStxs272Uz14shqozZ1YDHXvMRi8p0hS97mzxydYps5p/Q8IMphNZ DXMNDAQyAgH/mXY7KaklugF9Jw6ddo0xNzEKc/pGb5f1RL53IkdOYCZlU6RY3Qje4FVZ 3XnwUS9bAYHtOI+y4tpNV1ng7t3mHEzm41nsaDT+LPeVnW/a5RKSdVi6XXknUA61ie1p g6I/SsGHTPO6/jbjOX1VGDROTNmktoqo0jjWip63Vv/6IaWZTEXrQsYiEw0smy3rp9Nm vw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t6pmq3upq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 22:53:18 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38JMrHU5027195 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2023 22:53:17 GMT Received: from [10.71.111.102] (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; Tue, 19 Sep 2023 15:53:16 -0700 Message-ID: <24afa449-afe5-fdf4-0ad4-f2174e412569@quicinc.com> Date: Tue, 19 Sep 2023 15:53:16 -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] drm: remove drm_bridge_hpd_disable() from drm_bridge_connector_destroy() Content-Language: en-US To: Laurent Pinchart CC: , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , , , , , , Dmitry Baryshkov , References: <20230919174813.26958-1-quic_abhinavk@quicinc.com> <20230919181246.GA24325@pendragon.ideasonboard.com> From: Abhinav Kumar In-Reply-To: <20230919181246.GA24325@pendragon.ideasonboard.com> 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: -C_-drNL20fqcxiFF3LbtRn6farci87o X-Proofpoint-ORIG-GUID: -C_-drNL20fqcxiFF3LbtRn6farci87o X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-19_12,2023-09-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=813 mlxscore=0 phishscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309190195 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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 15:53:47 -0700 (PDT) Hi Laurent On 9/19/2023 11:12 AM, Laurent Pinchart wrote: > Hi Abhinav, > > Thank you for the patch. > > On Tue, Sep 19, 2023 at 10:48:12AM -0700, Abhinav Kumar wrote: >> drm_bridge_hpd_enable()/drm_bridge_hpd_disable() callbacks call into >> the respective driver's hpd_enable()/hpd_disable() ops. These ops control >> the HPD enable/disable logic which in some cases like MSM can be a >> dedicate hardware block to control the HPD. >> >> During probe_defer cases, a connector can be initialized and then later >> destroyed till the probe is retried. During connector destroy in these >> cases, the hpd_disable() callback gets called without a corresponding >> hpd_enable() leading to an unbalanced state potentially causing even >> a crash. >> >> This can be avoided by the respective drivers maintaining their own >> state logic to ensure that a hpd_disable() without a corresponding >> hpd_enable() just returns without doing anything. >> >> However, to have a generic fix it would be better to avoid the >> hpd_disable() callback from the connector destroy path and let >> the hpd_enable() / hpd_disable() balance be maintained by the >> corresponding drm_bridge_connector_enable_hpd() / >> drm_bridge_connector_disable_hpd() APIs which should get called by >> drm_kms_helper_disable_hpd(). > > The change makes sense to me, but I'm a bit worried this could introduce > a regression by leaving HPD enabled in some cases. > > I agree that bridges shouldn't track the HPD state, it should be tracked > by the core and the .enable_hpd() and .disable_hpd() operations should > be balanced. Their documentation, however, doesn't clearly state this, > and the documentation of the callers of these operations is also fairly > unclear. > > Could you perhaps try to improve the documentation ? With that, > Yes, sure, Let me upload another patch to improve the documentation of .enable_hpd(), .disable_hpd() and its callers. > Reviewed-by: Laurent Pinchart > > for this patch. > Thanks Abhinav >> changes in v2: >> - minor change in commit text (Dmitry) >> >> Signed-off-by: Abhinav Kumar >> Reviewed-by: Dmitry Baryshkov >> --- >> drivers/gpu/drm/drm_bridge_connector.c | 6 ------ >> 1 file changed, 6 deletions(-) >> >> diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c >> index 1da93d5a1f61..c4dba39acfd8 100644 >> --- a/drivers/gpu/drm/drm_bridge_connector.c >> +++ b/drivers/gpu/drm/drm_bridge_connector.c >> @@ -187,12 +187,6 @@ static void drm_bridge_connector_destroy(struct drm_connector *connector) >> struct drm_bridge_connector *bridge_connector = >> to_drm_bridge_connector(connector); >> >> - if (bridge_connector->bridge_hpd) { >> - struct drm_bridge *hpd = bridge_connector->bridge_hpd; >> - >> - drm_bridge_hpd_disable(hpd); >> - } >> - >> drm_connector_unregister(connector); >> drm_connector_cleanup(connector); >> >