Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2029761lqe; Tue, 9 Apr 2024 07:43:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWJbLVivjQMex2i8rvgvpQsO6FtZ/wvblRGYpZP8XULXPa52YX4AD9nQu7NNN8+9nHogk9SlhUdcZf1lT9qvF97lxt0ij0o600NjIDW+Q== X-Google-Smtp-Source: AGHT+IEJaukshBfspMFrdy/ncBGSoDBF1bn8Q6yd1c54kCoY5XrmFdbIUayoORSnujzDMx70rfYc X-Received: by 2002:a50:99d3:0:b0:56e:2c34:cfec with SMTP id n19-20020a5099d3000000b0056e2c34cfecmr8866381edb.7.1712673815786; Tue, 09 Apr 2024 07:43:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712673815; cv=pass; d=google.com; s=arc-20160816; b=IlcmtUV8vi1ZdAc6K0wpFlDaAjitzOBiSBqlOlIjoAooNas8p8Vg0S62Pqr+Wz9fFq vyz5CdAM2Hip4DMo8XVMPMAg/H2df9ngsWOWsxysEpDZ2Qz4vy2++m5GS6F/CMAnaqvz Sp8dFVp6JPOlqCy7VveRhcOOo/vikVi+/RMS/UO7g7yWuEGCd6HkUZyAXdK3RIVnRNaB 0gwoq3bT8bKdYS8/0ItjFTbZ4ZoFhmwbcobp4X2xrTWp9GUAODPpLfX2mm6uELuwsI47 NXrfslPXGvP4fq8SlUq+GQHk00TVg8rzoUaqKSNLyphyCvA+1tLdgF0h2PwU050kICNT ZHOQ== 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=Sr9qt0BbADGa89YCYwT+Bbk+dGM/AHSN1tyvYdeWW7E=; fh=gPFnMWglJDIuqXBRkA2FWOeezUaEnoB6QYStiIU+66M=; b=o8ZBWVXGp32bNDjG5gy+YaTStVgwKwRBa35kCRs6bUlILpbAX6avIXS9Lnm6KwidUw oSuhDlbjC9r+yeoUI6ZU8QxNHACRrKFhFvi8e9to6CIKTgh+j0JyNL//8J+BMcBi5mH6 rEFkvBhwWnDiVuFJ9wVt5ppR9X1Eg5N+F7z+DaWjVCwSXr81DRVHjunCQ72mZnUd8/0H ASmrOF+r2p/xS+ad5FR+L7TZBF8adqgUIX1tL8opXow7CHWWrLEh+Op30/gaWPvn6ArD keP/GZ1IhqYkcTDttNcF+EJhZl94ZYcKezn2YCQQo8pfnQbaUpbUaVPvhbN08TLgJugp msDw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CvrAYalZ; 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-137105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137105-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y89-20020a50bb62000000b0056c443b3f60si4930210ede.78.2024.04.09.07.43.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 07:43:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CvrAYalZ; 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-137105-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137105-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AFC1C1F239F6 for ; Tue, 9 Apr 2024 14:43:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CB1413173E; Tue, 9 Apr 2024 14:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CvrAYalZ" Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 837C850260 for ; Tue, 9 Apr 2024 14:39:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712673583; cv=none; b=sU9u2shb/i/+1aSU195Njn6OOtbnow5YizKGc3qrek2eK0Vlqp4w1jBfCx3yLlnT/eV4szqaJg8WaAB1wWryD3HzfcD2nBczQznzHcwPGj5XMqRIT88rQrWDzy8PvcCzvODsZ48P38EIROYz+J6dDD8F139otX5Ds3IWdgKkeng= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712673583; c=relaxed/simple; bh=rYRdF5eSZvDHg6P/v4LaA4shStXXiArZZpKdGUCyTq8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D9n4LeJshxLPs6/pqdJmuHyhFx2ZvBWclBV0N28unSN/9iWWqXKzoe1FiwWJog1Qxc9dW6J6U8XQXPUqZxDSfT5x8ITwJjtGQ1wxEH/CXwOtZKr2gFfp4fW2rOcxUMJY6DI16MEEU4fWS4haE2Fsz5WaN8Sbj1KB8yJ7vkJyESM= 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=CvrAYalZ; arc=none smtp.client-ip=209.85.167.44 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-lf1-f44.google.com with SMTP id 2adb3069b0e04-516dd07d373so2289716e87.3 for ; Tue, 09 Apr 2024 07:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712673580; x=1713278380; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Sr9qt0BbADGa89YCYwT+Bbk+dGM/AHSN1tyvYdeWW7E=; b=CvrAYalZ7tKWU+Xa7Lmfm7mkZmwJpyAkx1B/SBNTWIm/8HqvppMWwhg37j3mZ8DenL KfFnyMpw/gDbHkc9K4aY9snbI+30RqNdM5C9sN/Y9G06DTAW6sWHIJ1oQU2TVbIVc1AU MoPNFStgk3GF/rG6k97JR0bSBxI6C56EYjMft8vO1THw/h+6HAAdfh85Z1zywVmU4mZq icz8VA8P46qYN2xI+jmKRvbWUDrJCHTvexQv3d33Zq3P4m9R/TOsrSajdSGWOLFES5a6 t4KMVHBPMg08qsbCf3LdiH68z/vWSUJrYQ+7i9XkH2oZrj1JG6KsAcsKUqLjLHPGsxn7 qVOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712673580; x=1713278380; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Sr9qt0BbADGa89YCYwT+Bbk+dGM/AHSN1tyvYdeWW7E=; b=BRN1IehtkV1JaIoKYHyoTEKLWDE4m2bu5aBTWuq62Vh3wcK/R8u234/lWNos41Pf4C fFov6azbpZZWusoAN5nYeAAYYXLp29+FFjAgdHXZSeI+KXtaOkBhA34Rv/VX5AS10mLg VCtz1KZY3m9+nfeLv2a/IzmKfcCtn1r0W4tWqaXHDo3u8etpfikB+gsGNIIlimgSHOVg m4Qnjwpo2+F4UyAyC7+hZlLS2vjy93P0jWo9Ogyi2F2nzllgNbSSnS2v3EvL8AH+pcU3 22Tey3Ti2fHqFAYpcIoNKBzJGcIeIKojmJXgt+D8pJ8rjugwhajUAb8wZT8K8j4D18LC WcHg== X-Forwarded-Encrypted: i=1; AJvYcCUo9XmOXNc6rBGbvh1LN9bzm6az8ZipLUVtdA1Y5K3Z8Z3Ejm89RZTTgyLNMCeCpDMSar8LdvbPMCWlpbgcS1ap/nBX+/eq7fWr3/oc X-Gm-Message-State: AOJu0YzMIKRIL/ulOSKbqf2X9UP37EMuVViKY9kLUDdj4x0inWoGGv6i x6GDIaDXKDSeVZErTzCVJbG+n4EfFxGyR+k0ebmPqSMSzyTsqzfHZT3BMAWuoZA= X-Received: by 2002:ac2:59d0:0:b0:516:cd83:71ce with SMTP id x16-20020ac259d0000000b00516cd8371cemr7651841lfn.31.1712673579685; Tue, 09 Apr 2024 07:39:39 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzyjmhyyyyyyyyyyyykxt-3.rev.dnainternet.fi. [2001:14ba:a00e:a300::227]) by smtp.gmail.com with ESMTPSA id i16-20020ac25230000000b00513d13ede82sm1561676lfl.147.2024.04.09.07.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 07:39:39 -0700 (PDT) Date: Tue, 9 Apr 2024 17:39:37 +0300 From: Dmitry Baryshkov To: Bjorn Andersson 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 Mon, Apr 08, 2024 at 09:33:01PM -0500, Bjorn Andersson wrote: > 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? It should return the same: there is a sensible display attached. Other drivers (and drm/msm/dp internally) use !branch || (sink_count > 0). > 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). I don't probably get the question. Nothing stops the driver from accessing the AUX bus outside of the atomic_enable/disable() brackets. > > Regards, > Bjorn -- With best wishes Dmitry