From patchwork Tue Dec 3 00:39:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Kumar X-Patchwork-Id: 847037 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD6524C60B for ; Tue, 3 Dec 2024 00:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733186375; cv=none; b=cBr82Ml+o4HK6+lYTKlIXFrEsk7Negv13h9dYKsDo6sjNWIkMEV+eWbBOk2cYm1lF5Sw9C8OcIIFcBhOEHO2zcldT4i5pmUI7Qgoup5NTJ97sjUYaXDIOAcmj5j79gs185We8z/LuQY4rzKz5Xf3N0r4ha1+XUN7AfAdn5aJ/eE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733186375; c=relaxed/simple; bh=k6S3Lu59R/9ciU62ibkq8v6vGFAAGJ1GQLJwhNWGZfY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=OrO4qKjbiHBhmXthBbjxvTMgO1/EnOOlBIWMfNJA0nnp3OnuChU7EqxaYOYkkaKC/PkspfjlrfslEl87tvbpyLopQPZy1M3mKBOFaIMFLSAeo8fEg2uVxmcoRMSve3yOJvzq3YLRJ55TRjsrOul1WlTGt7xDBO/hVZ/jHYc/vwk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=CaZfIE4n; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="CaZfIE4n" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4B2JPsRV014902; Tue, 3 Dec 2024 00:39:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= T99r+fggIaiJDv4ZZEfajlyRMvGy1uBjJpJWNGUiOGo=; b=CaZfIE4naZqj+Ki5 jHTa2iHVnJ3ZBQPYcnmoTXTcF7EnnGRDvSuhMmeAA07D81ncXJFUfn/TVAd0NI+4 jP5ttOsHRUc8NsMJjUzfzGxHZyT9/dUsXXoQ8yTVFnHkTDQFO8fYnarvbG/GYgRX tMDXSZQCISdiu7hguyukOrkyZ20ZzhwCpuMJ1Bwl8b//i85vjJbty0V2mQ/o24JT aTeDsWo4isHWhbqiS0oB9jQbqU0/xz8yI14qh785n3zDzGeiHkyB7mhboAlUV8Mn E0wyuQjVnpi0VceWvjPiIF18G48Ap2LYzJL/vWeIB84zHmaXSE+wfms1tx9NaUKW v8ny8w== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 437ufe687t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Dec 2024 00:39:21 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4B30dLZ8020547 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Dec 2024 00:39:21 GMT Received: from abhinavk-linux1.qualcomm.com (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.1544.9; Mon, 2 Dec 2024 16:39:20 -0800 From: Abhinav Kumar Date: Mon, 2 Dec 2024 16:39:00 -0800 Subject: [PATCH 1/4] drm/msm/dp: remove redundant checks related to ST_DISPLAY_OFF in plug/irq_ipd handlers Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241202-hpd_display_off-v1-1-8d0551847753@quicinc.com> References: <20241202-hpd_display_off-v1-0-8d0551847753@quicinc.com> In-Reply-To: <20241202-hpd_display_off-v1-0-8d0551847753@quicinc.com> To: Rob Clark , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , "Simona Vetter" CC: , , , Stephen Boyd , "Doug Anderson" , Johan Hovold , "Bjorn Andersson" , Abhinav Kumar X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733186360; l=2183; i=quic_abhinavk@quicinc.com; s=20240509; h=from:subject:message-id; bh=k6S3Lu59R/9ciU62ibkq8v6vGFAAGJ1GQLJwhNWGZfY=; b=HRIUS08QeGieuPsk8SUbQeMZRovX3EJvs5R4Br5Dq16Txx4lC8iY+/Cj7VIP+lwlF7P/qBovs HPleih41xC8CfGWeY9eqMMviWJDB5LhzQCzzyY54aZxeO4wmAwuqGNq X-Developer-Key: i=quic_abhinavk@quicinc.com; a=ed25519; pk=SD3D8dOKDDh6BoX3jEYjsHrTFwuIK8+o0cLPgQok9ys= 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: wGCrok6LtKIQRxwFqoKeG7xcBgSeOM5Y X-Proofpoint-GUID: wGCrok6LtKIQRxwFqoKeG7xcBgSeOM5Y X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 mlxlogscore=999 clxscore=1015 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412030002 In commit 8ede2ecc3e5ee ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets"), checks were introduced to avoid handling any plug or irq hpd events in ST_DISPLAY_OFF state. Even if we do get hpd events, after the bridge was disabled, it should get handled. Moreover, its unclear under what circumstances these events will fire because ST_DISPLAY_OFF means that the link was still connected but only the bridge was disabled. If the link was untouched, then interrupts shouldn't fire. Even in the case of the DP compliance equipment, it should be raising these interrupts during the start of the test which is usually accompanied with either a HPD pulse or a IRQ HPD but after the bridge is disabled it should be fine to handle these anyway. In the absence of a better reason to keep these checks, drop these and if any other issues do arise, it should be handled in a different way. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/dp/dp_display.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index aba925aab7ad..992184cc17e4 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -562,11 +562,6 @@ static int msm_dp_hpd_plug_handle(struct msm_dp_display_private *dp, u32 data) drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n", dp->msm_dp_display.connector_type, state); - if (state == ST_DISPLAY_OFF) { - mutex_unlock(&dp->event_mutex); - return 0; - } - if (state == ST_MAINLINK_READY || state == ST_CONNECTED) { mutex_unlock(&dp->event_mutex); return 0; @@ -689,11 +684,6 @@ static int msm_dp_irq_hpd_handle(struct msm_dp_display_private *dp, u32 data) drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n", dp->msm_dp_display.connector_type, state); - if (state == ST_DISPLAY_OFF) { - mutex_unlock(&dp->event_mutex); - return 0; - } - if (state == ST_MAINLINK_READY || state == ST_DISCONNECT_PENDING) { /* wait until ST_CONNECTED */ msm_dp_add_event(dp, EV_IRQ_HPD_INT, 0, 1); /* delay = 1 */ From patchwork Tue Dec 3 00:39:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhinav Kumar X-Patchwork-Id: 847039 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0AB102E400 for ; Tue, 3 Dec 2024 00:39:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733186374; cv=none; b=tEt2Z6BlUZJU/wty2G8UTBqe4S86d1Uw2OGIPuDunYncxlHPyMTwm5BmdQabLMT+yfld2RYOkvo4LHEPdJ7Vzku4sdsL/F8P2Q4EW89Bvg85B7ghA8OtHqlcq/qwOiZ8jtulsRRHCVPNZ+18trpXMTLCbOZHc5KAYFnzLbmMh5w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733186374; c=relaxed/simple; bh=Lo+jEu6NU9rKNs+Uk5OmK6M5JhK/oIZ9xIDOah2jISc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=dYjIHkYo9t19oljf66josLLSPVArTD84SDMF+QPTa9dcomA3iRmuvTY/PnAC/lcTA9uI53+RabBLuPneEmYbauLn14WV23sBhuYXhTqSQf5l3DernRURb5ZrgHHzlCZ8EgZ4PB9ZoRvmPfD3hK4U93yXUPqiP2VyQrlP0807/+4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=iVj+t04v; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="iVj+t04v" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4B2JEGYe013776; Tue, 3 Dec 2024 00:39:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= emBE/dXkUbQ+cYxv1OOkpqDM3k/VkdW+f7SjxZ0FhbI=; b=iVj+t04vzllhUvSy dai/Sh5970E6dG2ntNW/Y5MKRpciJ0TEJhB0IN0T5vVG13+MZlEq0Kjl/TUeEYfl d1rzSLTEclqmiNykiK7sgK7jFlzOl6BD/i63XgGCuuf3cuGYdhkLrctddjkkXvtz plmhdHoiGiOPcocS33uR5yFc8qgB+Hcuw530A8KhZIcGtiRu7Zp2SG29EDYC/xiv /bb57v3lbP9KBP6MoW8nCP4gGCHAGXlF+uQNbcf/DAgOOGWF5UWlFuQuulZY8pm3 B/cF4HxhrrygXULZAB3w2/Bu7i+v35ccDMboH3uXDaeAq41qtKiQ5+V9MLh7w0cQ O2O4og== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 437ta2xb2q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 03 Dec 2024 00:39:22 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 4B30dLte012048 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 3 Dec 2024 00:39:21 GMT Received: from abhinavk-linux1.qualcomm.com (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.1544.9; Mon, 2 Dec 2024 16:39:21 -0800 From: Abhinav Kumar Date: Mon, 2 Dec 2024 16:39:01 -0800 Subject: [PATCH 2/4] drm/msm/dp: remove redundant ST_DISPLAY_OFF checks in msm_dp_bridge_atomic_enable() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20241202-hpd_display_off-v1-2-8d0551847753@quicinc.com> References: <20241202-hpd_display_off-v1-0-8d0551847753@quicinc.com> In-Reply-To: <20241202-hpd_display_off-v1-0-8d0551847753@quicinc.com> To: Rob Clark , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , "Simona Vetter" CC: , , , Stephen Boyd , "Doug Anderson" , Johan Hovold , "Bjorn Andersson" , Abhinav Kumar X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1733186360; l=1315; i=quic_abhinavk@quicinc.com; s=20240509; h=from:subject:message-id; bh=Lo+jEu6NU9rKNs+Uk5OmK6M5JhK/oIZ9xIDOah2jISc=; b=cP3XY3IFnRQrDA0sgS+gkSQ0ipJkyloChlhbfx1AJhr9SVCpDt25B+kRFqZvpsAzmk38jR6Se Ah1Xo4PpQn4AfytiUf+kwxYiNnRtVNUcsHL7CnH5Z79DNEiJSo52joK X-Developer-Key: i=quic_abhinavk@quicinc.com; a=ed25519; pk=SD3D8dOKDDh6BoX3jEYjsHrTFwuIK8+o0cLPgQok9ys= 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: UnQ3Ihbn1eGL4UaK8NYdAmc7XIQgpCbu X-Proofpoint-GUID: UnQ3Ihbn1eGL4UaK8NYdAmc7XIQgpCbu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 impostorscore=0 malwarescore=0 adultscore=0 priorityscore=1501 mlxlogscore=960 phishscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412030002 The checks in msm_dp_display_prepare() for making sure that we are in ST_DISPLAY_OFF OR ST_MAINLINK_READY seem redundant. DRM fwk shall not issue any commits if state is not ST_MAINLINK_READY as msm_dp's atomic_check callback returns a failure if state is not ST_MAINLINK_READY. For the ST_DISPLAY_OFF check, its mainly to guard against a scenario that there is an atomic_enable() without a prior atomic_disable() which once again should not really happen. To simplify the code, get rid of these checks. Signed-off-by: Abhinav Kumar --- drivers/gpu/drm/msm/dp/dp_display.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 992184cc17e4..614fff09e5f2 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1513,12 +1513,6 @@ void msm_dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, return; } - state = msm_dp_display->hpd_state; - if (state != ST_DISPLAY_OFF && state != ST_MAINLINK_READY) { - mutex_unlock(&msm_dp_display->event_mutex); - return; - } - rc = msm_dp_display_set_mode(dp, &msm_dp_display->msm_dp_mode); if (rc) { DRM_ERROR("Failed to perform a mode set, rc=%d\n", rc);