Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1720147lqe; Mon, 8 Apr 2024 19:34:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVatgbNajzxj008s4LDtSZAqDD0c1oyQwU84uFWc5ls1hHw0gn9V/XFON4MowXUVJKrG6svj6aKEp8D+S3rShGmFjFQFj76EfZPJfifEA== X-Google-Smtp-Source: AGHT+IHQ0T8elgqcAsMk2YuODGRXgQmAdYQUk+XDEe+yR6+d71sJGAcvdBb1365XCS+iem2c/sHf X-Received: by 2002:a50:c348:0:b0:56e:2a7d:827c with SMTP id q8-20020a50c348000000b0056e2a7d827cmr7170717edb.18.1712630060671; Mon, 08 Apr 2024 19:34:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712630060; cv=pass; d=google.com; s=arc-20160816; b=WyRCxXO8pcM1BX06wYejITSFj3Mjb20Mnsxbuwnls0ImbWlPyql+o5kv4eCeSOI6r+ aH+GGkiyOCdJyyggjohsZ6im1Lo9PxCwi/A5UdRSqu4WfKhd36yXDen3/Vu4VahlWN4v G6yAZOx4k609B3p1aKe87cq5VDdY4lXi+LcNZj3C9/ooZDi2nWdIFwXHHlR1UHe/xkSo Z+Le7u8p/spTBnFPHn/oKyWb0JN0GW5gMN7gl+k0nna9rktFrGY/0yEVqgG1ayppnaoC vRFbsKxnlzDuHjgzZH6aQmCC7baTYfX/puvOVcR7N5yQsH1wE1y81QOyjW99LOEnlsS9 xO4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Gq349wPUr2/YnIqOeZpwhfOegAX33In8yajSQtYhRwg=; fh=oGdHpRLcGOS9g9ZOQoiWhlirOulE5ZIFxBkOENJs8KY=; b=NG6XgVVZnbJ+3dFWOLJG3fjMO2dQVXzjdqnGNS3zB9+4MT/jTQOeiWBqVJVidADzoS tqEWaJlEdl34IyiBsaAtWqkAEOKv624Ft78zn9vagqyc3mzmprIR2KD6Ux8piykOPAbN t2+KVvc6dDBV2KA5F5KtykcK19i8Hy/uv5n4VZJ8ZGgGMwWTBbt3sEPgv/9641Od5zGO JLgsBefvin6Zv0ePlwa792rNZkTr/NS4Rs1NZPQP7UyDjN9RGSeWqI7c+QtCylnE+Aqp pxIvp32r8YHFlBzBt9Tdpo8O7O4T/vdMkDNWiysYs8uGnSA6LpvHdCsBRA6Slq+yuoM3 Qp5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TfxLRoCY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-136139-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dz14-20020a0564021d4e00b0056e688f3bc0si1019274edb.533.2024.04.08.19.34.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 19:34:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-136139-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TfxLRoCY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-136139-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-136139-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 361221F21ED6 for ; Tue, 9 Apr 2024 02:34:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 532C654745; Tue, 9 Apr 2024 02:33:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TfxLRoCY" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7704553E28; Tue, 9 Apr 2024 02:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712629985; cv=none; b=TpsXPOedvDj4KiImV2k2hMtYqegEFsWx6Yl0TuRFYHG/3gf8H/IsrywkHjWwzx7P1hthW6cnRgq1LsHiwcpDDQbFyavm5O81hmFRIv0KrJAA1VUSXwkVCs6VysyJ6/CQ7qBHa8zIzfp3el9Ft/sjY1RlRYsRTG4PBJEjm+W3nxs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712629985; c=relaxed/simple; bh=kaZl5aohS6PHHFbY2k20Vr3WSpd8PK+x4cpaK0dNKmk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=t73FtQt6hCohHN1H3SF4EJBasQ+30RcCstb2m3cBTS+nZqNKc2x6rO4D7PFNdlxShNLKSelgN0JKYM89+O2oAdzee6ON4MjcSCXvi1z3suPbCXk3Y1P8+TIVwCUMa56DxMh+6KlWWAWa9UUt1M0WFr9IrKhHnBMwORKCb3oJdIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TfxLRoCY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD6ECC433F1; Tue, 9 Apr 2024 02:33:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712629985; bh=kaZl5aohS6PHHFbY2k20Vr3WSpd8PK+x4cpaK0dNKmk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TfxLRoCYZ6eJmGn+zCrqSrSkyt8vdVMAYrrgcWYfH859DTwiz0QbeOkUl2gd8W3wW tYfgW7Q4nSZAaIHPaNygIb543E+DdcPaBQWEAskTmSYqGzbSMD/tmjk9OSEZZCfn4n dDBQvkJ9RZU4L+R4pwcOegp16Xftx13uPA4ZK1/74W8iDNNzggQdMlzc09tn5Lp4ae Xw7doy/Cq5BvOhsacixw895GRwCODLpBSviiHmv1691KUlgEEfNeTholDarGPFuBee E5LCvi/ngmgTS16bEBVYBqU/pJYKTydYkHjfi4xa0VDHH3HPoDbNQhAWi+j69szgvs 8srocdUR5vi7g== Date: Mon, 8 Apr 2024 21:33:01 -0500 From: Bjorn Andersson To: Dmitry Baryshkov Cc: Abhinav Kumar , freedreno@lists.freedesktop.org, Rob Clark , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Kuogee Hsieh , dri-devel@lists.freedesktop.org, seanpaul@chromium.org, swboyd@chromium.org, quic_jesszhan@quicinc.com, quic_bjorande@quicinc.com, johan@kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] drm/msm/dp: call dp_hpd_plug_handle()/unplug_handle() directly for external HPD Message-ID: References: <20240406031548.25829-1-quic_abhinavk@quicinc.com> <01cb1c0d-a801-37f9-2f55-2bbd8d3a68b9@quicinc.com> <905222ad-612a-3eaf-d966-23c89c99e1f0@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Apr 09, 2024 at 01:07:57AM +0300, Dmitry Baryshkov wrote: > On Tue, 9 Apr 2024 at 00:23, Abhinav Kumar wrote: > > On 4/8/2024 2:12 PM, Dmitry Baryshkov wrote: > > > On Mon, 8 Apr 2024 at 22:43, Abhinav Kumar wrote: > > >> On 4/7/2024 11:48 AM, Bjorn Andersson wrote: > > >>> On Fri, Apr 05, 2024 at 08:15:47PM -0700, Abhinav Kumar wrote: > > >>>> From: Kuogee Hsieh > > >>> [..] > > >>>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c [..] > > >> > > >> I will need sometime to address that use-case as I need to see if we can > > >> handle that better and then drop the the DISCONNECT_PENDING state to > > >> address this fully. But it needs more testing. > > >> > > >> But, we will need this patch anyway because without this we will not be > > >> able to fix even the most regular and commonly seen case of basic > > >> connect/disconnect receiving complementary events. > > > > > > Hmm, no. We need to drop the HPD state machine, not to patch it. Once > > > the driver has proper detect() callback, there will be no > > > complementary events. That is a proper way to fix the code, not these > > > kinds of band-aids patches. > > > > > > > I had discussed this part too :) > > > > I totally agree we should fix .detect()'s behavior to just match cable > > connect/disconnect and not link_ready status. > > > > But that alone would not have fixed this issue. If HPD thread does not > > get scheduled and plug_handle() was not executed, .detect() would have > > still returned old status as we will update the cable status only in > > plug_handle() / unplug_handle() to have a common API between internal > > and external hpd execution. > > I think there should be just hpd_notify, which if the HPD is up, > attempts to read the DPCD. No need for separate plug/unplug_handle. > The detect() can be as simple as !drm_dp_is_branch() || sink_count != 0. > What is detect() supposed to return in the event that we have external HPD handler? The link state? While the external HPD bridge would return the HPD state? If a driver only drives the link inbetween atomic_enable() and atomic_disable() will the "connected state" then ever be reported as "connected"? (I'm sure I'm still missing pieces of this puzzle). Regards, Bjorn