From patchwork Thu May 29 23:13:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jessica Zhang X-Patchwork-Id: 893376 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 400CE1AF0C8 for ; Thu, 29 May 2025 23:15:24 +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=1748560527; cv=none; b=f/RBE3xonhUw0ZbL8lfB8IxIE5pFhrELyF+AD9jG1ziUC9AjAWz0uGBHJGuc9dgU5vcXPXGxgL/l/V/qWxt4U9p8iCvDBRDeANgeIRpv6JcjuSWYPrLW01OC7Y2AbZ2RZe1lsAVA5cIiwuPeb7n0DbN76pQoVeA+elSRXxLbgyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748560527; c=relaxed/simple; bh=ncFUgjCcjLVp47mdzw5AlWfZzY/iqv0NdO8zjQXSoI4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F7YhSBSwqUymGhJ2HjAfvRRhXjqc3Dmndphy3TFFFW322ze+HSsApT17vPoOUNBOdm1PfWzHWkF1J7rJGp2Gvc5Z2caQpQZ/3gSx4ms5TkEacd5jKK5Qw99DgRQ7RtmRj7Gx5Qkai07t+SEaE51Hsxj/b01cyLvKbxP8DVXhc+Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZcHQc3rv; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZcHQc3rv" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54TC1OtP013722 for ; Thu, 29 May 2025 23:15:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= w9T6LjH71u9zQzlGudP+qBcjCF5Cn/3FIBo8ObljvB4=; b=ZcHQc3rvA7phTslz WQBad+h15HW1V9ljZeSKT6KzIE0xo4633oqLhZPzdLJbRnPtnfw5qc5BLc6cawzt 5CxoqKAvxiSZU7dEoULAmD0ohmR31RfZwo3Y1dNauszmHoGIsOFylGhJxGovR0pE 41Ryfa4f1DtYM7TDDkSWCppkuPUenm3nQWr+tc5FlwGp1lrVv0SkfyDs8RGI96ik avhGIhnNCOwFxV1fGXy1M4pL6ddHcKKHhed9QCvhQ1ha6UB1Oeq0c5Ly7H27Dmc/ AKxCcjk3HdYUjZ7jcPMSuCARjusr0B7oMCdgi+vkR/8antwimGlXAKx807SHbSyI L5Glcw== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46wavm11te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 29 May 2025 23:15:24 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-af5310c1ac1so974653a12.2 for ; Thu, 29 May 2025 16:15:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748560523; x=1749165323; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w9T6LjH71u9zQzlGudP+qBcjCF5Cn/3FIBo8ObljvB4=; b=sWqps58HJFMarkCz4CxHuysQ8yUsMHxotgf4r49Mf+80tGIREFUHZbpSw+9Bfyzwcp XayRKlO7KgiLFX5srqFHu65Dqc5zI6FI497EQiJqLeIJIbHYQ6uuzDh6BBTB0oQWavqN RFVVGhlnFEsEN3o3kUFj/DL3qoSpkqnb3CBTeQGH71xwAGwZMly1OaFXhYFOJZM6nWFQ FeDvCkh/uFDd4FhuxJAQiUn3MZRK562cGHF+GoUa7RwSNz4NUea8ZRuQDwYNec9F24h+ Rli80ja1SCDAukSQ7ursoIZ0+VP13ONqSNs+R7dCl+LShmgtXNms6d8bdMCLr5qWGNOw C37A== X-Gm-Message-State: AOJu0YxQ8PJLKldACVegtnOIyO9W5FIUabAWhw9xNX0dhvN0tW7WCxhO /8kvF0ii1jkDxDIaZtwt5qL3QAsbAI+YqqGhY2ZAVcR1EUpSM4jifJEqIKhCtSxVRrT80z7mLSG t7tKZ5GBFA7kBHnyDWTSgXW5kS/6hYimWCG43b8cztFa/cmmqgtK9HGbl2Tvf3bHeQaeC X-Gm-Gg: ASbGncutUVaAYVLeE+2OChJ21cjyahpphdYVJqxfGw2Mv1mvaGts23BCy4eieDCr56Y 4WhEH8gL7QVrQ8yJ2SaA4JNXvyFTOKlcTxUZEQIGcTixWee7+xV8/Jze2ivICwU/DiA6kmnqsob 3KR7DFICxgHzSqogjjNgB3ajlJnYoKf/pEW36HwvaKfR27lBIB7yDJYlLwZ0jmDsrpBoMbgPvHH f6HCTcFoFtEGAJx0Lr9EGoEue0FST9E00Ckbhvn+fmTl6GyJwxYWxcedRyIRVp4Y7MEfKUdbArx HseE1LMY9b2a65K1j+xMO24BIgORXsHCaKXNskETcjNjZKeFdIf2Lj3cH3KwEstszULfbkuh X-Received: by 2002:a17:90b:180b:b0:2f6:dcc9:38e0 with SMTP id 98e67ed59e1d1-3123efab981mr2365839a91.0.1748560523483; Thu, 29 May 2025 16:15:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGO6kVlTul5XfVExNVHlCfMfXtoSx3A+pScknURIeoMKwp8UajMgtsqcqSsCFhBesXHbzaNgA== X-Received: by 2002:a17:90b:180b:b0:2f6:dcc9:38e0 with SMTP id 98e67ed59e1d1-3123efab981mr2365796a91.0.1748560523026; Thu, 29 May 2025 16:15:23 -0700 (PDT) Received: from jesszhan-linux.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3124e1f3f22sm73581a91.0.2025.05.29.16.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 May 2025 16:15:22 -0700 (PDT) From: Jessica Zhang Date: Thu, 29 May 2025 16:13:43 -0700 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: <20250529-hpd_display_off-v1-1-ce33bac2987c@oss.qualcomm.com> References: <20250529-hpd_display_off-v1-0-ce33bac2987c@oss.qualcomm.com> In-Reply-To: <20250529-hpd_display_off-v1-0-ce33bac2987c@oss.qualcomm.com> To: Rob Clark , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Abhinav Kumar , Dmitry Baryshkov Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Stephen Boyd , Doug Anderson , Johan Hovold , Bjorn Andersson , Abhinav Kumar , linux-kernel@vger.kernel.org, Yongxing Mou , Jessica Zhang , Dmitry Baryshkov X-Mailer: b4 0.15-dev-64971 X-Developer-Signature: v=1; a=ed25519-sha256; t=1748560520; l=2307; i=jessica.zhang@oss.qualcomm.com; s=20230329; h=from:subject:message-id; bh=iZ6m38kGUh6Wu9/l4YZxdyErgIvmhQUC45GosLwQHF4=; b=JzwNwtaiIIBM44Wr7k3CgOFsd6RO8xdIk4KnRV24BqdwI98BPsxzhcx12py1hq5JImcnhpaHq ewjnk+F5+XNDjmSGQssJk40wWDDN1VwB18kGz3ZAu0MJUSg9qNEa3Z9 X-Developer-Key: i=jessica.zhang@oss.qualcomm.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-Proofpoint-GUID: jy4DnrxRZpyTNgTw8yaoGAsSOz3-0PpV X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTI5MDIyNyBTYWx0ZWRfX0DszOcbG/rcT cqjYogkGlNNSlsFYkGKVvNlYLRq2BtinqSdhOvv3kq0QDkVA9zh9qkU4mEdVaUmior6IAmpb1oq vPyphDxl/CJcz33C+f+6ev8kSqqWZ5uqJtJBG79De+0/LgD1ZHy9mLA8qsE5J2VZlqsu3hL+Wk8 zQAb77BNI3mS8CSeuzQCoEa67/5R81z/Cyx9PWBzklSHsiQbCVuPZZIHTE1Z/shcUxxh0shdQRe nD4SijO4yugwrV/7xFm2WsuNJyJX4Hwt9pdO1xdFIy8sdN23Uv3uvXwnqDZavBRm5fDIWIGkhuW RgLnR4cSmD7mqUAv8hSxFBzdmVy8enQc8mCnIG2F2YU/m2SujzV0IS8EZdVpsyOvu2MFaMIjUFW POY00xBrsMiyUPXip695scB3C2X9M1skeVQjcse9oP1TlEyquytPluc4fKv0S2wDlWXpoPXi X-Authority-Analysis: v=2.4 cv=fMk53Yae c=1 sm=1 tr=0 ts=6838ea8c cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=PbHRmTaTmGSOozFvvjEA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 a=TjNXssC_j7lpFel5tvFf:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: jy4DnrxRZpyTNgTw8yaoGAsSOz3-0PpV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-29_10,2025-05-29_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 impostorscore=0 phishscore=0 suspectscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 bulkscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 definitions=main-2505290227 From: Abhinav Kumar 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 Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang --- 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 386c4669c831..1d7cda62d5fb 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -579,11 +579,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; @@ -706,11 +701,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 Thu May 29 23:13:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jessica Zhang X-Patchwork-Id: 893134 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 917D02512C3 for ; Thu, 29 May 2025 23:15:27 +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=1748560529; cv=none; b=tUlHbp0kCFrn7dAzLMs8h+uhRSe6SfHrLYWwwqIrWUo0GW33K/HN+mhyeZOCMbzMHGVd9EyeKwy2FkwsFVT+NGROhDZNv6+UTiHFE8eNQw3NptWF8jyggwsJSooqbdsyNy039xaMDg0o6aWzY7B/MjDccRvOr+mjD+bPVxGhr7Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748560529; c=relaxed/simple; bh=cT7lMKr8k0/w4t/Z5K5ELQ5zbFL0wwmPeLJNmXBBCog=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hWgpS65pDdsL350Yo0KAVzQKeW1Q5FouF9IyS1RvQeQi4b/kiiUgY/Lz2Ko2Lt3HM9jadyCO+Rny4RPCE+4iviHHRbF+uaGCLIRz9Y+BtlJmw5j1Hw6K2PEU6/JEHkJpa78/fp7dMOyLqIyFAQQ855DCCuhUD1SkcQTLf27LQBc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=VbZMlFDw; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="VbZMlFDw" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54TC1Jnw024429 for ; Thu, 29 May 2025 23:15:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= H2gYUU1FXEsiCULrNF5KO3iQkScCDInHxHlMYEUiimg=; b=VbZMlFDwU2tYYnKb uEiZxqcsXus/ZntWMn00T7ghi53tFOg4pnzuV16bQwr5oO8ug3AQhSEBEGtTSnNU JETQGD9hmiIObOPuU2n3V4BW0UOif4fV8nvwk4lYKvApsOFtcdGyi3UqgmP3OkQl T6DHmtkM9sBv2UfIix/w7VFE8GZCBF5GggyN3HMmsbLyeHn+Xe6wjonGbdTjhEEW DYbvkyTv906Thz1XTn+kJEgsR6prbzmGeqoArJuSfcG0VFqaPr84GpVCxiTQdxNR B5HB4J19utmuPKVMxAvzdKGFfZRibe8S3XL7QrNM0JzP7oHLzJgPqTwFjsjuADQm Aw1Npg== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46x03mwg0v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 29 May 2025 23:15:26 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3122368d82bso1455621a91.0 for ; Thu, 29 May 2025 16:15:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748560525; x=1749165325; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H2gYUU1FXEsiCULrNF5KO3iQkScCDInHxHlMYEUiimg=; b=BbQM+R9b/PMqGCoFNObxGfZR3GLwtAayUsRSNHVGhTofn+dv9gHDQoXej9CpExOfj8 +21fbvqmOmkNbh93p+5dTUMJUGVsPx50VkVNpdZdSgwGgrvOnowop/7IsL84GI9gIfwF 6otdNy1IN57WEZoqiB9BV1ofWQBP9SSDhN/AAOYEA6T0syvSi4gzaAN+BygZ5GT5fMat o9/J7XP1jd3Rrmzl3CTSaOOn+NlkzAjR5Z+OISxA4jt5EVl2BDtZ1CfstDneKFs9Oqgd dNyS35KJbAGiwAw5h75HXQY7/rNPfC2hpohXd5evNYo+GF//F+LnDnUM5A8/l/5ydb6d 3OYA== X-Gm-Message-State: AOJu0Yy4zm5lMbcNQ+GE0BulXwCah5atYX7W8nMkHEHHLKe7wA20UXTl 2lCGYqmtVzsp3BIJtuSs0P7GX+gttZvvI04a7WJx+5EAlkTPnVezJUoGsIxHJtMeXXC46+rQ3+a flBWhPnctHfPHVkR9zQspQW+YORC7qCfGwYaw0VCS8bYwzdH/WUhyiqXXvF0uqTSdN2Eh X-Gm-Gg: ASbGncsdxBxzCpH1aWDlLsecAjsZakzrbosDF+kpvktl2lrx0iESjwr9FORvTHQxQ8i 2gxSaqt4OmdNBkAuISxdz22L0Fc/gxpPgRwKbF1SyVISrrNRYz3281nrFGauqSWf8NmKGtKUJjM s4B9KIr/Rh2buIhrXsm0ttIBefAZzyZpQQoLhzFt2LyQFflNqFY62Udiw8FxHTb81jABZudODK6 pod8MhY+QyCpugV9IsHTvY0eobo/w+clpvAFvNoeiI12DLMCVRDiPjOjHGc8tW+M1PaJPRxNRMo /ahJLTT6Zi4/QIeOqq8MVxQG/3COwqhds6N2OCMsqkBLMpQ6yUzmaWVS8YVMrqvGa+PljM/OdOp G5b8IJcQ= X-Received: by 2002:a17:90b:2883:b0:311:e8cc:424a with SMTP id 98e67ed59e1d1-312415391b5mr2330075a91.14.1748560525003; Thu, 29 May 2025 16:15:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBfi+6PW0/stwfIr9Ji9/hRe9cqIN1QfL9pqez/UiTuvBmsR34ao61gV2YnPGnXd7GW1DHUw== X-Received: by 2002:a17:90b:2883:b0:311:e8cc:424a with SMTP id 98e67ed59e1d1-312415391b5mr2330034a91.14.1748560524621; Thu, 29 May 2025 16:15:24 -0700 (PDT) Received: from jesszhan-linux.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3124e1f3f22sm73581a91.0.2025.05.29.16.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 May 2025 16:15:24 -0700 (PDT) From: Jessica Zhang Date: Thu, 29 May 2025 16:13:44 -0700 Subject: [PATCH 2/4] drm/msm/dp: Return early from atomic_enable() if ST_DISCONNECT_PENDING Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250529-hpd_display_off-v1-2-ce33bac2987c@oss.qualcomm.com> References: <20250529-hpd_display_off-v1-0-ce33bac2987c@oss.qualcomm.com> In-Reply-To: <20250529-hpd_display_off-v1-0-ce33bac2987c@oss.qualcomm.com> To: Rob Clark , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Abhinav Kumar , Dmitry Baryshkov Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Stephen Boyd , Doug Anderson , Johan Hovold , Bjorn Andersson , Abhinav Kumar , linux-kernel@vger.kernel.org, Yongxing Mou , Jessica Zhang X-Mailer: b4 0.15-dev-64971 X-Developer-Signature: v=1; a=ed25519-sha256; t=1748560520; l=1455; i=jessica.zhang@oss.qualcomm.com; s=20230329; h=from:subject:message-id; bh=DKkTNWpb363qNZIlJK/dgUyyIUKi4hoMvgukVRHWsxk=; b=G0e1TtIX/dBusekaqwSYgj13I+GIJGnSUpuKurLZzg63+cZlKtSuWTLfX9K/Jf3SvmoD7DKSO TB2zvTXe8WuDZqo5wU9ZF52ZD7BofrsrfxkwWe6WFZojdVn4OZxeNAI X-Developer-Key: i=jessica.zhang@oss.qualcomm.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-Proofpoint-GUID: QbYMqBaH66Nt4TTkpJMYXgEWRXlWfsBu X-Authority-Analysis: v=2.4 cv=FuAF/3rq c=1 sm=1 tr=0 ts=6838ea8e cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=-ysM04AIoonzMzE-3HQA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-ORIG-GUID: QbYMqBaH66Nt4TTkpJMYXgEWRXlWfsBu X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTI5MDIyNyBTYWx0ZWRfX3VKOzoGIO3OB NgfSwINLACXIX/PJzV4uVRq7RrCfEifg82oXugiKy3sWjLcM/UXPO4wYQzRn+8jgJos8JK/Jkm6 8r+YAzFetYPzdI6QeoiUGFB8NAu2KSbxNbZde3g7dWu7NSmkzqku9t+ZhPqQJPfHMFGG3O4+lwm K3GaioHCV7MIbivuQwyksgYE6MNeiGGuANlfHTDLM76JhFi9iCz+QkAVEzNYkv1z18kw+K4gHq4 NtDMiGoYB/ckLt7i3VSWIIsd9udBU9vtzLatCX35IQf/Yezh9c9XLZAF6LFgQExbq13AImCkRXn uvwimrHnN8e8VOsQM2eXbpUudGJ9pffKnwL9dl8yxBo8y1iUSudYIkwpJqfuV58j+m4XMePRYzU arYByAjDiKNK0CKGQoPy0hyFYLbN/d/GTla7aRXZ/VjchdvMXhB6Q2n78gqMwS3utc1Oc/h4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-29_10,2025-05-29_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 bulkscore=0 spamscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 definitions=main-2505290227 From: Abhinav Kumar The checks in msm_dp_bridge_atomic_enable() 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. Since it's still possible for the state machine to transition to ST_DISCONNECT_PENDING between atomic_check() and atomic_commit(), change this check to return early if hpd_state is ST_DISCONNECT_PENDING. Signed-off-by: Abhinav Kumar Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/dp/dp_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 1d7cda62d5fb..f2820f06f5dc 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -1512,7 +1512,7 @@ void msm_dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, } hpd_state = msm_dp_display->hpd_state; - if (hpd_state != ST_DISPLAY_OFF && hpd_state != ST_MAINLINK_READY) { + if (hpd_state == ST_DISCONNECT_PENDING) { mutex_unlock(&msm_dp_display->event_mutex); return; } From patchwork Thu May 29 23:13:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jessica Zhang X-Patchwork-Id: 893375 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 2F4BC254B18 for ; Thu, 29 May 2025 23:15:27 +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=1748560529; cv=none; b=HxgdwrIaTuCLLSiWdYLwWAAhbvkBxpRkhEKHlCtX0CyUAyroa4RjVsfDRjR6fn0kwzS397VX+3+a7H34IHtOctPREH3Cvlzb8WaKhZVUCYowEFNmuTdU1qjqu4WtUoWTSIfhL9cgVFDaWTgQNb4/8kLTrbhWzSndJ7OHk9nT+dI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748560529; c=relaxed/simple; bh=ZAGZk4Y8vogmDbZftZ++ijHWg2vj1zOvE7SDTgM361I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ew1BvPn0dBIyfugy958Ge9UvC35qJQ3Q6DLSVxiKq8LfugPngFCBH/ytuJadp6pZXl3w4TW3F95T3sDPLj3pMjJMCGnBff96Q4MsWu9lTsof+sxVcDI2Licof+XlvH6YCYGMHxakrOB/LqY/uwIbUuNhz1cH54JsiW0/mX+08ds= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=eSXkEdKV; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="eSXkEdKV" 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 54TC2As1032767 for ; Thu, 29 May 2025 23:15:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kX7efsc+IS2/784jVqW415KcZ7V01+TYXKPRgFgJmG8=; b=eSXkEdKVaeU3v7Pp x5jGtq5KlfskOfsXmQ7UPlUErWjQ01zFJI7mP8oORmLZy96DYDA82kap14XFkI/L aQu4KaGOxcTdrv+pXUUhu//ti77g2G+ycy7kuf4vYY+39FtQJYjfAgWiA6dqEzgn Sw1k0vcUYUmUqC5ibN8c7LUdjlaO1SbX9k5ezZZgHLGnmN7RPSG4K9FYyVXzQn/P 59qICEAD6zD0y+Z1zu3U6XG1iwBNkErExbcjdVYup85kqGYN/YAsHE7wsYW5syRV h7in1HuTZqol5BkLTKANsLL3EL4UKQV5B/QNU3N7to7Vw/ie3LvFjco7HnqY0VKo X7bk1Q== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46u6vjy7jr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 29 May 2025 23:15:27 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-b26e73d375aso1542122a12.2 for ; Thu, 29 May 2025 16:15:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748560526; x=1749165326; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kX7efsc+IS2/784jVqW415KcZ7V01+TYXKPRgFgJmG8=; b=tiNsZ9vL9YYQ+lMNwJKVv4RBJD9XyxtvNgCzZmTHOhpWjQa2NzxZb3ImE1wsK0EXxo yOitZuXp+rvcFCJVvv1FfDQqs3sPsY+MWKTkjTXUr9uJpOsUp8Toz5+djZKREmpTQ/DN G5p6Mln1aHLFeD10Xki8W5M4qMnppNGO1FRfkjNQFxChC37cMMamMdV8GVCqszBR/SHT yZxmlf7GTd2x1Kt0my/Gq53kDF5HGG7XRxajj/vXn9v/3chriUMa0p7xN8BMvDOYa8vB mpqzutVxqjz2XUqvvHrYT++TCKR5UNgKBgfT95685E0+gkJkWdKuJRRNOJ/n/gYJB4xN BBow== X-Gm-Message-State: AOJu0Yw1rUnocYs+PX/V+cuRlBal2SjbZuKR9lP5t06uy4klzBwdBa+r kHdek5cObGxvEupMqPexVBqsEc0qBOHbHA/Gi+8jMQoRgNdvn0KXxEl12YZip/w6jOjv0dEBZe4 3YnX6l+JyFyT/+2Ho342OuRn5Qz3euJ3nmzgz/yamr7BcCZuoi14HQL8OInWFe9R5RCQr X-Gm-Gg: ASbGncurAdbjOrQkOjlJYC6Q3RqSHloJSOzFELqajYjUW+uMBIwYYX0hKIPpVLf3Pvv Vp7J+zW09/sWfTQ9EK8qHLDUqPPZJ62NSPr0g3+BS3zGaLvIXXtnCfJ5tJjU5fpPu0FAalfleVS bu2Ir3/gEw/8EzqFlFtpgsyLhEf8VoGzuoXqCPm7OEhxIuXHWxPNFfdGybdBUxShIr2WNlGUrL1 hAIJgoZbvrEcE5rklFF1Ts47/Bim5QewXwiOgNvIk1SoJ9JTXAP5qoLMppiy3QXh94EXTspPFHC vNzi7Nnf5Fw5xd0RScEjJAdlPBXg7MHRI+nEmOU43L19Btn07WRao6GkWPxjBQH5rqYzMj7V X-Received: by 2002:a17:90b:3a85:b0:310:cea4:e3b9 with SMTP id 98e67ed59e1d1-31241ea0309mr1550073a91.34.1748560526418; Thu, 29 May 2025 16:15:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEA3THCormTux9QWIgYTb/ZoeNKtEa6RR3lUUxnW6L7Kha6SEXPkeVkPdWWJIZrBpa4PAFunQ== X-Received: by 2002:a17:90b:3a85:b0:310:cea4:e3b9 with SMTP id 98e67ed59e1d1-31241ea0309mr1550058a91.34.1748560526083; Thu, 29 May 2025 16:15:26 -0700 (PDT) Received: from jesszhan-linux.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3124e1f3f22sm73581a91.0.2025.05.29.16.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 May 2025 16:15:25 -0700 (PDT) From: Jessica Zhang Date: Thu, 29 May 2025 16:13:45 -0700 Subject: [PATCH 3/4] drm/msm/dp: replace ST_DISPLAY_OFF with power_on in msm_dp_hpd_unplug_handle() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250529-hpd_display_off-v1-3-ce33bac2987c@oss.qualcomm.com> References: <20250529-hpd_display_off-v1-0-ce33bac2987c@oss.qualcomm.com> In-Reply-To: <20250529-hpd_display_off-v1-0-ce33bac2987c@oss.qualcomm.com> To: Rob Clark , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Abhinav Kumar , Dmitry Baryshkov Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Stephen Boyd , Doug Anderson , Johan Hovold , Bjorn Andersson , Abhinav Kumar , linux-kernel@vger.kernel.org, Yongxing Mou , Jessica Zhang , Dmitry Baryshkov X-Mailer: b4 0.15-dev-64971 X-Developer-Signature: v=1; a=ed25519-sha256; t=1748560520; l=1160; i=jessica.zhang@oss.qualcomm.com; s=20230329; h=from:subject:message-id; bh=fcV0U0JSd2Lf4fDNNX9R4rq8oAhewquvTnMKQsk4vw4=; b=L/EjQFUOVbqSjowt+2F3fUU1pQgDZXxeNd7PyBfGd52nFzJc3fw8rhldR4/xN61sS8wqJ+6KR nwQbP8lg2FaDS8cHgMf5lKPSyxMS6ZmgZItPDqtcoKXmLuD3U5u95KC X-Developer-Key: i=jessica.zhang@oss.qualcomm.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-Authority-Analysis: v=2.4 cv=UOXdHDfy c=1 sm=1 tr=0 ts=6838ea8f cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=8oAJioj0-2SxPtK92HsA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 a=TjNXssC_j7lpFel5tvFf:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: wnrqMM7ykQMRVRlIEwqRlYv4XoNB8tE6 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTI5MDIyNyBTYWx0ZWRfX3cRr4LuA/CNb 3TRVMunecEqD3mWVh43lX080tVxOX6ct1hkgEtgx+tFxW0P7l91awh+YibtiPAXLk2uyPXpI6vk Kw1HR81XwZZ4JYKuPZLcMaWvCWaTjGPOS4wSmCPil/dzRFWQxQLVoMpPg36o0tLdEQUnuBHkV1i 9QN7btU3TGHjUXL1pBGWqn2tDABHG32HYD4x8/HQvctwJkOEm//3QvI2yeyzlLxAUWIz6RTTikS MmSpEFzR/0NapOst5+8mXa4j/GHB/ze/Sn/YYUIlg5bL9xuc7miZRdZgM+2pIl8XXfh0pOPCxI3 3q7sEnr5dZCL6pvCSpzd8cngODXAJM7HaXENUJgjEEIhBTqXHjW/I61g7gBUT0nBRparx+v8124 x4jZ3S/Ip0AJFIjJPHcV4qK/9Mt5A8DqBT2vtb0WmlPDrJ59V8q+lycCgXUF0/sE0rRdpE9/ X-Proofpoint-GUID: wnrqMM7ykQMRVRlIEwqRlYv4XoNB8tE6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-29_10,2025-05-29_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 mlxscore=0 adultscore=0 priorityscore=1501 mlxlogscore=766 bulkscore=0 malwarescore=0 impostorscore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 definitions=main-2505290227 From: Abhinav Kumar msm_dp_hpd_unplug_handle() checks if the display was already disabled and if so does not transition to ST_DISCONNECT_PENDING state and goes directly to ST_DISCONNECTED. The same result can be achieved with the !power_on check. Replace ST_DISPLAY_OFF with !power_on to achieve the same outcome. Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/dp/dp_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index f2820f06f5dc..785c813d2b31 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -672,7 +672,7 @@ static int msm_dp_hpd_unplug_handle(struct msm_dp_display_private *dp, u32 data) */ msm_dp_display_notify_disconnect(&dp->msm_dp_display.pdev->dev); - if (state == ST_DISPLAY_OFF) { + if (!dp->msm_dp_display.power_on) { dp->hpd_state = ST_DISCONNECTED; } else { dp->hpd_state = ST_DISCONNECT_PENDING; From patchwork Thu May 29 23:13:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jessica Zhang X-Patchwork-Id: 893133 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 67489257AF8 for ; Thu, 29 May 2025 23:15:30 +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=1748560531; cv=none; b=BLziITTxecuI5sR/si5R32Oy0gzATf0vg0tFCWoz7cCviir732x+YsiKCUHhW73S4TFAgeb8nQhhqJQ/a1ItIT2md/S66oOqHwKkLP0gLp8imqWtTjeR2fqL8XPi8d1qKCzTO1GcmU75xEQqCAZOtIFLW4FQn3f5Kmh9G5/auPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748560531; c=relaxed/simple; bh=Qu9dpHlIRB4zOegYzAEmciE3+UoqCif4T5fM30oyon8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UFFnJlM0t31gScOOVJmoPYWLcpTLVCSYhgS0l2Z5Nw7acWE4+0Rym7eY8U5Md4X5HM4fEEi1ywUSlxvk9BX401huNSXDCHnx2Sc6RYh1HmUDnY2sZku3AQsRVVNiz0bs1QenPKIZn/hsvJB3injL56C8TFWbadYd8GK30VahBmU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=WlWWlbeb; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="WlWWlbeb" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 54TC1K6S024519 for ; Thu, 29 May 2025 23:15:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 4vbVMjvU68KSE4FGI+lKVINOGIspYhFfmjickrGZhQg=; b=WlWWlbebHQXU7IaB t02zhGKFXbemRqNf/kw0uIQ2ao2KMbVnBK4Vp0zi47WsA4reWndY8e7xqQ1hojRB J+qGJNVIKrXM6i05AmGI5qhB2FhX27TRfxaoDjqrfZEwOg4LXY/NPfyVxIgfRMYF HqW7vcJgbKLWqj4jhP87dYB+Ztkmk4edDm/NOqrWZJqlzS0/ZGj0wzJF9O/5Nz37 hMYt2VK5NyXch9g8NMglhWP9YjGQdW/KatJnJ6fZPXkz1UZO2Jr5/dx9I8+PxxKE zL6nFpON9riyWpNQMTmq1NwpwQEVQ+8v/or1p7451QCXHI6xxJ5GvbEthnxk46ZC YJ8sUw== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46x03mwg19-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 29 May 2025 23:15:29 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-30a59538b17so1329046a91.3 for ; Thu, 29 May 2025 16:15:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748560528; x=1749165328; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4vbVMjvU68KSE4FGI+lKVINOGIspYhFfmjickrGZhQg=; b=jaLThyBiywHAfHbNHZNSlTrToIcsrM9E8XL2Wm593YlKUAsHp9j9BZFn6mEFxKVl4/ YhTwKFX52nLilbV5zB+vnTboQlnSer/3gHtipXeQpahWe9WiBKPSp0aNFRfCbsV7w2Ng gEANDRKpA3p6EaM+V4SXbFIMVSpJfTep84vZVwKCrigBiDvZWzZLmXQdBb8uvJH93rk6 ZIyRKe3HrPe4Vgk7OqnLF7Lm0Z6F07PBrlfR27HEfjdLMsOIO9EvkA9pL2Jnxls3xHDn dknaSKW28CyEzBCi1t0zPgt1mLxt8o24lQZOj7/XsLaqRZp7mTGsAoJrH371LvsWqZMQ fJMw== X-Gm-Message-State: AOJu0Yw0Ls7KbV0Ibnf+cT41mU1SLRS3xpUg+3WmNfgtt1900VINq3dK lY7MYBunPxSa80aPttYRAHQQZElrj4qG/qqITyzrEra1qpFc+eh2YBQhsudTCrE9BBI38xfc7OW yxOM5K+f2AcR5Vw7ROHJMHnmrqv3hQXuP6ljPSnetFY4q4e1bnTaolXrKm4EKkoIOAvxK X-Gm-Gg: ASbGnctgaimehxuYE1zmvfxvjkGkGlzbe2ZNPbQjLVfO5Om6GRgLD7lMeotrPniB0My mXYrhym8t2tx+IGnUisujOvygPG8ZdnUE8uRIsU55tksnzfK/VeZ0Ej82s7/kKa5/9JDdi67MzK KzVBd620ZVBRZkQZFLxiYOuIvBfucUAq3ZX0O+Bpu+45STeEaOtmUMHII9wjwEdC8zXeF9TVPfo rzgjZMNFItwwBmRdNfsX5raSqQ1Kbg+jMz2ABOu2j/vUJTYhkzrXhCR5yX4Ug8iXdSUIPMnNGlz V0uXvkutiJFoVLpxP7Q7HBObKBRg3PuJmS5fWmUYfgvNmr9DAQwitBBgZAbRtaI7xDX3xXas X-Received: by 2002:a17:90b:47:b0:30e:6a9d:d787 with SMTP id 98e67ed59e1d1-31241532ec2mr2226134a91.11.1748560527849; Thu, 29 May 2025 16:15:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKS8hP5QDpmvy9MOsu098RPR9jWdEHOkxDAW+2Xf6gU153iGKt6qoNGu8DVdUnTocC11rWTQ== X-Received: by 2002:a17:90b:47:b0:30e:6a9d:d787 with SMTP id 98e67ed59e1d1-31241532ec2mr2226080a91.11.1748560527405; Thu, 29 May 2025 16:15:27 -0700 (PDT) Received: from jesszhan-linux.qualcomm.com (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3124e1f3f22sm73581a91.0.2025.05.29.16.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 May 2025 16:15:27 -0700 (PDT) From: Jessica Zhang Date: Thu, 29 May 2025 16:13:46 -0700 Subject: [PATCH 4/4] drm/msm/dp: remove ST_DISPLAY_OFF as a hpd_state Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250529-hpd_display_off-v1-4-ce33bac2987c@oss.qualcomm.com> References: <20250529-hpd_display_off-v1-0-ce33bac2987c@oss.qualcomm.com> In-Reply-To: <20250529-hpd_display_off-v1-0-ce33bac2987c@oss.qualcomm.com> To: Rob Clark , Sean Paul , Marijn Suijten , David Airlie , Simona Vetter , Abhinav Kumar , Dmitry Baryshkov Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Stephen Boyd , Doug Anderson , Johan Hovold , Bjorn Andersson , Abhinav Kumar , linux-kernel@vger.kernel.org, Yongxing Mou , Jessica Zhang , Dmitry Baryshkov X-Mailer: b4 0.15-dev-64971 X-Developer-Signature: v=1; a=ed25519-sha256; t=1748560520; l=1865; i=jessica.zhang@oss.qualcomm.com; s=20230329; h=from:subject:message-id; bh=LQos15gYFKCo04VJZ/As3557mLEuaumxqfi0RxOfo5Y=; b=ZyMmKPBhU5YA6EHWCvynOwpmKVsv3ib05zmarBy/e1MwPCLCy3gRO0/VTzFbpLW+pORd1zhqW Qr5/lo9J/i2Ci3LD8bTC68qtF6PkoPKgqziVkownWvT+mt52PpUs1pg X-Developer-Key: i=jessica.zhang@oss.qualcomm.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-Proofpoint-GUID: mX_0dX3JWrg9v8zbronG-AU4cryTmmWx X-Authority-Analysis: v=2.4 cv=FuAF/3rq c=1 sm=1 tr=0 ts=6838ea91 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=KKAkSRfTAAAA:8 a=EUspDBNiAAAA:8 a=zUghIR52pHC5fQqyx9gA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=TjNXssC_j7lpFel5tvFf:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: mX_0dX3JWrg9v8zbronG-AU4cryTmmWx X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTI5MDIyNyBTYWx0ZWRfX2RwVmRUN2E+Y m80bP5prSy61oXmdukQHxllc/75QNcoOhd9dI0ULS3uK2/2v8cLa8JlCdJb2+3V8bPCb4g+e6RA 7WB0q3Jo0xOKTXqNJ69OEjuFGkr8ioM+1uJ3m415FYGfklHjw8UPvtZIgbpWPylIM4987njMF4u Pzhe0/iY9G/v7WTzQAO4OAZTYYP/f9NrRX895Mkpe5TCD/gOaKt+zsssKcxzGCV+r2FucJcM41Y IxDuWmcmji56Mly7TAIQFqbV0igjliOgn04YGVPEm44a4kUJHyhd2pqEJgIO51UFRjz3gefVPPE c9d4l2M1J0ZzWiPzj8k1osxfnR3THQ+3a3gnXwSmW2n2e9X0MOY76GrTfAE8q4eN2FutSXy0yPF 9BJWxCzYFsuLiot0+ytPpj4Hks1a/S8ipL5vNym0DfZ7rKRIKODw0kJ/Zpyu37xMXq4xIq3O X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-05-29_10,2025-05-29_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 impostorscore=0 bulkscore=0 spamscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 clxscore=1015 malwarescore=0 classifier=spam authscore=0 authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 definitions=main-2505290227 From: Abhinav Kumar ST_DISPLAY_OFF check in msm_dp_bridge_atomic_enable() is used to check that if the display was disabled while still hotplugged, phy needs to be re-initialized. This can be replaced with a different check as it just means the hpd_state was still ST_CONNECTED but without display being powered on. Replace the ST_DISPLAY_OFF check with a combination of connected and power_on checks. Since all consumers of ST_DISPLAY_OFF have now been removed, drop ST_DISPLAY_OFF from the list of hpd_states as technically this was never a 'hpd' state anyway. Signed-off-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/dp/dp_display.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index 785c813d2b31..6f05a939ce9e 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -50,7 +50,6 @@ enum { ST_MAINLINK_READY, ST_CONNECTED, ST_DISCONNECT_PENDING, - ST_DISPLAY_OFF, }; enum { @@ -1526,7 +1525,7 @@ void msm_dp_bridge_atomic_enable(struct drm_bridge *drm_bridge, hpd_state = msm_dp_display->hpd_state; - if (hpd_state == ST_DISPLAY_OFF) { + if (hpd_state == ST_CONNECTED && !dp->power_on) { msm_dp_display_host_phy_init(msm_dp_display); force_link_train = true; } @@ -1584,8 +1583,6 @@ void msm_dp_bridge_atomic_post_disable(struct drm_bridge *drm_bridge, if (hpd_state == ST_DISCONNECT_PENDING) { /* completed disconnection */ msm_dp_display->hpd_state = ST_DISCONNECTED; - } else { - msm_dp_display->hpd_state = ST_DISPLAY_OFF; } drm_dbg_dp(dp->drm_dev, "type=%d Done\n", dp->connector_type);