Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1024761lqt; Tue, 19 Mar 2024 10:28:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+TPNODIRPLj7OiXZSpez2w8RuIoSm+XJZV7Gy3PATJF7GmcsrIFhIK5ICl+CdXdPkrkaptIvPZGyo88cM9OeYSKgq6u1nCL+cpj3qTQ== X-Google-Smtp-Source: AGHT+IEJGAUwPP69Ua6/Gf1f2Ad9cOziUZzRNBR9PV587iUaIdK6otr3wsK2PxLZCe7sw9gAOTl2 X-Received: by 2002:a17:90a:69c3:b0:29b:90e6:cd8b with SMTP id s61-20020a17090a69c300b0029b90e6cd8bmr14293913pjj.37.1710869315655; Tue, 19 Mar 2024 10:28:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710869315; cv=pass; d=google.com; s=arc-20160816; b=L7zHD0eo2CYUv+BFlZiIqCu6sCSdCBfJWKvJ2H+gq+qDpyxDZDj0AXrGzuQgPsAmMx EVkYWfiALqU0Fe8JVDn4vJm2AtfnX6C6P3SZijyeTQOaDv+dszRWb8vsGOf2zxeJlsTY 0HK2GmgBcMRc/Xb6gB15bF1ycJOiOeVg5Fezc6qIJDvtaPySpg7ALRVhMuUTxYQZ7Miz yuBUu4uWRv1RhzrleJ6yWEawAMWglOJK+2XSE5JmJ0NeFOiuwmlbvTbLeVkBWRm8cwJ0 qyIX/5kyXGi+auzV2MZ3svq640tFUzdFupIhMaSSKLGHKnT3C1cxKLZ8JcCG5QET6j57 4daQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=m3LUxRWYnP2OsrqcQiSZ4h3vPEbmfkyWm4/8PP80DFo=; fh=jxEupJzmkcVWSKgIxykOwiDODycgQVzwYiA5LEUrsgc=; b=QqGhDEv9mKzDyxs8taYjvIwxKOQJX4Kb+fR5T3n69ff0byaveKMD2eX0qvJruqQVwe 8sxR5XCA7cZ3bENYMsFyi7X9n4KkYPP5+kP/JCvtdhsruBV/uGqC0B/gcyZlbvbV0g81 2u3ET4xv46WmWiYjqguCXW6UC5Y6CMBT8IgGTOo4+xdHjVmmqblOZdVOG35Lb7BxyOx8 pTWIiSLQh40yoMSaP1ufpAp+JStpl77Drg+i7+12F/BKUqPFTjcOHVIpCc71tvIkrxjr OCLhydB7j9Rn5299a5hso49cUzChZmhuANiPsTBSHkANKa1EI2fv0oUoQl42GrzvFGFh yOZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LJUx9fug; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-107914-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x3-20020a17090a8a8300b0029bb34db082si10667458pjn.26.2024.03.19.10.28.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 10:28:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107914-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LJUx9fug; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-107914-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107914-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3A43F280D69 for ; Tue, 19 Mar 2024 17:28:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C791A3A29F; Tue, 19 Mar 2024 17:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LJUx9fug" Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF8173A1B0 for ; Tue, 19 Mar 2024 17:27:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710869261; cv=none; b=eG6kPNoIhcVa/KnG1HUWMVgmC1mQNaNlqQPFTGXd03DF7dHjFASFC0BV0gAZHAHzDgU+KOU0cms6exYjNtBnvOKQU9JGvlSVtt54NXCgCYNeVZ+agmy2f96UNFU63UrhQbptCDH8KRkKOcelH/DFStITkkRBRmfeCwOuGx6HE6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710869261; c=relaxed/simple; bh=6W1qCWnz+7Z3YETqKXCygOfNK9YBMFA6YOC7DWIPqLY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=SCNnrUERLLdS++0kapigJrlvBG0Nzd6UZae5+xdLaNt5eBuL3KL9f/WyG5XlU71ifxGae5FFBj9eF5XywcuW/JjOKR25X71nTvw1AoYHFrPZN9KE7YzfE5dUC0SehsG1D9b6EIIO1sCX5kuNf04xGvF/h9hGlGDy+jXiV2lIQd4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=LJUx9fug; arc=none smtp.client-ip=209.85.128.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-60fff981e2aso37183967b3.3 for ; Tue, 19 Mar 2024 10:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710869257; x=1711474057; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=m3LUxRWYnP2OsrqcQiSZ4h3vPEbmfkyWm4/8PP80DFo=; b=LJUx9fugAG8ZdURQOqDNnOVESUII9+gBD/r2O9H+LDMsQHWNWHE/1IGb3xMWE74XGs rEOwl7BxZRY/GXe7TSRXVw+sY1M2EHlCDA6Ic/UaVWTW95Xr8iHMkyhYKt/fP+ufjkCK 6WnTIZajjc+xshX5kfKLDsdEL4IEGJub0DLn3rdhlp8YNocClG/AbAvk2KYwVm8wgUX3 u2Br84V54aAFUMLrSEjNzSG7G2EBsP7DBP7K9EKou3rmUk/lET0ojFYg2tBaye17fAwg Tj/rnf2Rhr+2gE4Cat7MYr5govgo9nsi6936c1gPGK6yToPeYJ3O47pyNvGXVkxB3pFV H3lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710869257; x=1711474057; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m3LUxRWYnP2OsrqcQiSZ4h3vPEbmfkyWm4/8PP80DFo=; b=qbH5xuT3rbZfGK6bDd0jHnZZlRC7vAfehgTc1BduhNrpGSQzpyIO3K+/KGdxlfWX/O ciSe4NL7oQG5k6d0eLYxnuxZ7fut6Bld2D5YLpCfMuLci8hi4ggaW6YkEM9WJFN+5Pjh kHSaP92exu6gMnxH8uXnNmi1AdUr29zjXuNIHbxSYtIqTck5gnS9trlpqDUVY8DAies2 nzjWAOFFude9tTSQya7AdnSW9FkNqFhR8DU/3cWGfhnlAAN5qQcsgDbOnZX8FuPsCfGM bRmiFWWjnoaCRyRJUV0OzmVtidZIeo+YV5NDntcUjZf0nfKxmOGAzMkBGXBDXTvJB5GU 67Sg== X-Forwarded-Encrypted: i=1; AJvYcCUN4GkF7wqiZYciG+tHOjSZOkwZyWWHZbh7XCbuCrjsKxISgalgkIiw8ZB5NLRRNbrJjGY9Twrx0fadi5rmOkCYewfNhgQ3L1IiDwBS X-Gm-Message-State: AOJu0Yys1rlsOYhkamGdfdion6f1E5aAAAZ8drcRY8sU0TbckvvwlSN+ 0ODQ0E0lmd86VIDqmRXrv6w6xn0YCOOsI7m7oYKV9rXAzJ6VhiEjM1H+DPbdMRRfa5W1kxgfMuk Dwx+Vd0jb/D2Vov+d0TaNnYCpmaA79sQ/kkBnZH9yGV9ZHRk4vkE= X-Received: by 2002:a81:6f05:0:b0:610:d431:9408 with SMTP id k5-20020a816f05000000b00610d4319408mr5599507ywc.42.1710869257519; Tue, 19 Mar 2024 10:27:37 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240315213717.1411017-1-dianders@chromium.org> <20240315143621.v2.3.I535606f6d4f7e3e5588bb75c55996f61980183cd@changeid> In-Reply-To: From: Dmitry Baryshkov Date: Tue, 19 Mar 2024 19:27:25 +0200 Message-ID: Subject: Re: [PATCH v2 3/4] drm/msm/dp: Delete the old 500 ms wait for eDP HPD in aux transfer To: Abhinav Kumar Cc: Douglas Anderson , Rob Clark , Daniel Vetter , David Airlie , Kuogee Hsieh , Marijn Suijten , Sean Paul , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Johan Hovold Content-Type: text/plain; charset="UTF-8" On Tue, 19 Mar 2024 at 19:13, Abhinav Kumar wrote: > > > > On 3/18/2024 5:55 PM, Dmitry Baryshkov wrote: > > On Tue, 19 Mar 2024 at 02:19, Abhinav Kumar wrote: > >> > >> +bjorn, johan as fyi for sc8280xp > >> > >> On 3/15/2024 2:36 PM, Douglas Anderson wrote: > >>> Before the introduction of the wait_hpd_asserted() callback in commit > >>> 841d742f094e ("drm/dp: Add wait_hpd_asserted() callback to struct > >>> drm_dp_aux") the API between panel drivers and DP AUX bus drivers was > >>> that it was up to the AUX bus driver to wait for HPD in the transfer() > >>> function. > >>> > >>> Now wait_hpd_asserted() has been added. The two panel drivers that are > >>> DP AUX endpoints use it. See commit 2327b13d6c47 ("drm/panel-edp: Take > >>> advantage of wait_hpd_asserted() in struct drm_dp_aux") and commit > >>> 3b5765df375c ("drm/panel: atna33xc20: Take advantage of > >>> wait_hpd_asserted() in struct drm_dp_aux"). We've implemented > >>> wait_hpd_asserted() in the MSM DP driver as of commit e2969ee30252 > >>> ("drm/msm/dp: move of_dp_aux_populate_bus() to eDP probe()"). There is > >>> no longer any reason for long wait in the AUX transfer() function. > >>> Remove it. > >>> > >>> NOTE: the wait_hpd_asserted() is listed as "optional". That means it's > >>> optional for the DP AUX bus to implement. In the case of the MSM DP > >>> driver we implement it so we can assume it will be called. > >>> > >> > >> How do we enforce that for any new edp panels to be used with MSM, the > >> panels should atleast invoke wait_hpd_asserted()? > >> > >> I agree that since MSM implements it, even though its listed as > >> optional, we can drop this additional wait. So nothing wrong with this > >> patch for current users including sc8280xp, sc7280 and sc7180. > >> > >> But, does there need to be some documentation that the edp panels not > >> using the panel-edp framework should still invoke wait_hpd_asserted()? > >> > >> Since its marked as optional, what happens if the edp panel driver, > >> skips calling wait_hpd_asserted()? > > > > It is optional for the DP AUX implementations, not for the panel to be called. > > > > Yes, I understood that part, but is there anything from the panel side > which mandates calling wait_hpd_asserted()? > > Is this documented somewhere for all edp panels to do: > > if (aux->wait_hpd_asserted) > aux->wait_hpd_asserted(aux, wait_us); That's obviously not true, e.g. if panel-edp.c handled HPD signal via the GPIO pin. But the documentation explicitly says that the host will be powered up automatically, but the caller must ensure that the panel is powered on. `It's up to the caller of this code to make sure that the panel is powered on if getting an error back is not OK.' > > >> > >> Now, since the wait from MSM is removed, it has a potential to fail. > >> > >>> ALSO NOTE: the wait wasn't actually _hurting_ anything and wasn't even > >>> causing long timeouts, but it's still nice to get rid of unneeded > >>> code. Specificaly it's not truly needed because to handle other DP > >>> drivers that can't power on as quickly (specifically parade-ps8640) we > >>> already avoid DP AUX transfers for eDP panels that aren't powered > >>> on. See commit 8df1ddb5bf11 ("drm/dp: Don't attempt AUX transfers when > >>> eDP panels are not powered"). > >>> > >>> Signed-off-by: Douglas Anderson > >>> --- > >>> > >>> (no changes since v1) > >>> > >>> drivers/gpu/drm/msm/dp/dp_aux.c | 17 ----------------- > >>> 1 file changed, 17 deletions(-) > >>> > >>> diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c > >>> index 75c51f3ee106..ecefd1922d6d 100644 > >>> --- a/drivers/gpu/drm/msm/dp/dp_aux.c > >>> +++ b/drivers/gpu/drm/msm/dp/dp_aux.c > >>> @@ -313,23 +313,6 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, > >>> goto exit; > >>> } > >>> > >>> - /* > >>> - * For eDP it's important to give a reasonably long wait here for HPD > >>> - * to be asserted. This is because the panel driver may have _just_ > >>> - * turned on the panel and then tried to do an AUX transfer. The panel > >>> - * driver has no way of knowing when the panel is ready, so it's up > >>> - * to us to wait. For DP we never get into this situation so let's > >>> - * avoid ever doing the extra long wait for DP. > >>> - */ > >>> - if (aux->is_edp) { > >>> - ret = dp_catalog_aux_wait_for_hpd_connect_state(aux->catalog, > >>> - 500000); > >>> - if (ret) { > >>> - DRM_DEBUG_DP("Panel not ready for aux transactions\n"); > >>> - goto exit; > >>> - } > >>> - } > >>> - > >>> dp_aux_update_offset_and_segment(aux, msg); > >>> dp_aux_transfer_helper(aux, msg, true); > >>> > > > > > > -- With best wishes Dmitry