Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1562718lql; Wed, 13 Mar 2024 01:18:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUX1+DJurvotm6DyH32IGNN5FKEULAhElx44JIiJaNtOwtWHxbX0isZ1TtcNx/kSkP4miwMHS6zGCHlBZNaKQQ++mFZ2xhKNxwJdxDIZA== X-Google-Smtp-Source: AGHT+IGpyc1N7PY3vjh+PS1RavRs7l3c18gpqEfriMYHHIK1V9Z/GJiws9CNde68jffhPQ6maoq4 X-Received: by 2002:a05:6808:3c98:b0:3c2:3afc:d710 with SMTP id gs24-20020a0568083c9800b003c23afcd710mr3466474oib.42.1710317916145; Wed, 13 Mar 2024 01:18:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710317916; cv=pass; d=google.com; s=arc-20160816; b=0HvYzVY3mgXxzFSMQl6Uj6DaYUZTOBc2GhAqeekz62ty9qzH0bg/9WUTvw7og4WJti zDjh/PcR/bn6qy4FR7cYc2Vfp/MsXnDYJ+zCJqcjBAVswVnsv5oCcfF7WN2YSY376f9P G4z0iei961l2SjUfqtBpnXA/I2caJg12yPwNF8hX696nZkr7sOFZTt+1n4XSGxrQ88l8 ixFJlvRLAp8/toED6RFft4gqD5S6zEya/RYA5M63oAWPT+w628TZDshTb3afox5ZvCDR It30EX94iDgXQ/AjumN4LorjRASO5GyCB4T8tnQFcxZZOuQueCrECHePF8ce9dQWOBBo wD1w== 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=gsC76vBcScUxSVSwIRXuFfWQfOQd1CFpI1x7ufJYucU=; fh=/Tvl+uDAQ0HiiOTkl8shMIh6FPVPcGwJkfACwg8QSrE=; b=fKIMY+CBvlGiJK3JvG3u/GjttyGctE9lsvUbcA1TZp18OEfK9od0f9gc27IHDE/LhD HdJYVFZz6pKG6K9cgIp9v8ZCAVadWXkIT/ICcpzYafqTO/PNVMnCQ3mN8NL6nyLsTo95 yc2wNNMWGKy+B5c3cww4mu+Af5dqMcqKbDH+5mD4Z/MFcsFhqk4RQDq9ADqvPE/yvRjA k3fnehE/WPOnfNuO0nBdlufaUkXJEx+4FLHOtWbkP1Byye7N1j2zwGOQRDlAtrRTRG+s fZ7nqaDbIBAKelFVEOzjmKGnc3kswf383kGjE4hxKXaLbTBtUfUXy5Uf5MRRDniA7vaN fWUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kfvaO2p/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101211-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101211-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r16-20020a63ce50000000b005e4b0710537si8821105pgi.562.2024.03.13.01.18.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 01:18:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-101211-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=@kernel.org header.s=k20201202 header.b="kfvaO2p/"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-101211-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-101211-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5DD80282AFB for ; Wed, 13 Mar 2024 08:18:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68EC91A286; Wed, 13 Mar 2024 08:18:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kfvaO2p/" 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 793651946B; Wed, 13 Mar 2024 08:18:30 +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=1710317910; cv=none; b=ibMbPwqk4Rjh75H+MNil4HeLMdZz+EstgaEqFyEJGa9BLVxF1jbPkcjXs5FeoCrSI9dqegTaA03QYedIRkP7J8NGofdYCLkHUnXW0WmD/NoVjj2KSrVZv6PC9sas2+LjZM8QC1AxwDHUf7jV/6g1bxsW8QnbUNrjnEc+X7Ak7yI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710317910; c=relaxed/simple; bh=zE7IZcvHdDf3t51MnDNR20hcSgbHGaXRCq5k//ri3Dk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=p/CpqescJNZVMXdiez7FtqYIv07ZEoxEL/7ANPvnp0ZM6PP8aX1W1n57RiZ93TiVeIVcgkDnlca3jldVkjC8+TMuWfrWTz6TJW8/Nf3GgXVjDKt2eEEDeaksfly/i13CSrSFHZt1+dW9ykhBNvwFkwXwO1TUXdtTDwVG7ruSJRY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kfvaO2p/; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A1C0C433F1; Wed, 13 Mar 2024 08:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710317910; bh=zE7IZcvHdDf3t51MnDNR20hcSgbHGaXRCq5k//ri3Dk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kfvaO2p/xA/6WQYMqWpUtHkwzvcv435FG1luuy0SdnIxrdLGbVbBn1xJkO86ckMdk ngqqHAzFfuK1K98SoFG4lRGOm45/HcSs58eq0NmXtEYaudEvOsjWBS7nZFaGjx9tEr 4PBWv7NK1l8Q1718PUvdFR+0O9Jq9OrCuVvOArDJLbdEnRCX+uurBgu2Gh/x39ijev O9sjQebpCmyWLZBYdR2hCo4NwZ35Aboml0wzmJBlJ6yVxyEdyrnHGK9GWaIEAmwAWW tNXeLWq6Y662cuLDXmsz7LfduvXoz7JAbchyI1mW7Pk6xFHCYYxU6c+YXW0XanwQ4q H/ax0Le7rdWPg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rkJoq-000000007Vb-2jag; Wed, 13 Mar 2024 09:18:36 +0100 Date: Wed, 13 Mar 2024 09:18:36 +0100 From: Johan Hovold To: Abhinav Kumar Cc: freedreno@lists.freedesktop.org, Rob Clark , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Kuogee Hsieh , dri-devel@lists.freedesktop.org, swboyd@chromium.org, quic_jesszhan@quicinc.com, quic_parellan@quicinc.com, quic_bjorande@quicinc.com, Rob Clark , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/msm/dp: move link_ready out of HPD event thread Message-ID: References: <20240308214532.1404038-1-quic_abhinavk@quicinc.com> <8e125a99-543d-8328-a2a9-100e223e4faf@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: <8e125a99-543d-8328-a2a9-100e223e4faf@quicinc.com> On Tue, Mar 12, 2024 at 10:39:46AM -0700, Abhinav Kumar wrote: > On 3/12/2024 9:59 AM, Johan Hovold wrote: > >> Heh. This is getting ridiculous. I just tried running with this patch > >> and it again breaks hotplug detect in a VT console and in X (where I > >> could enable a reconnected external display by running xrandr twice > >> before). > >> > >> So, please, do not apply this one. > > > > To make things worse, I indeed also hit the reset when disconnecting > > after such a failed hotplug. > Ack, I will hold off till I analyze your issues more which you have > listed in separate replies. Especially about the spurious connect, I > believe you are trying to mention that, by adding logs, you are able to > delay the processing of a connect event to *make* it like a spurious > one? In case, I got this part wrong, can you pls explain the spurious > connect scenario again? No, I only mentioned the debug printks in passing as instrumentation like that may affect race conditions (but I'm also hitting the resets also with no printks in place). The spurious connect event comes directly from the pmic firmware, and even if we may optimise things by implementing some kind of debounce, the hotplug implementation needs to be robust enough to not kill the machine if such an event gets through. Basically what I see is that during physical disconnect there can be multiple hpd notify events (e.g. connect, disconnect, connect): [ 146.910195] usb 5-1: USB disconnect, device number 4 [ 146.931026] msm-dp-display ae98000.displayport-controller: dp_bridge_hpd_notify - link_ready = 1, status = 2 [ 146.934785] msm-dp-display ae98000.displayport-controller: dp_hpd_unplug_handle [ 146.938114] msm-dp-display ae98000.displayport-controller: dp_bridge_hpd_notify - link_ready = 1, status = 1 [ 146.940245] [CONNECTOR:35:DP-2] status updated from disconnected to connected [ 146.955193] msm-dp-display ae98000.displayport-controller: dp_bridge_hpd_notify - link_ready = 0, status = 2 And it is the spurious connect event while the link is being tore down that triggers the hotplug processing that leads to the reset. Similarly, I've seen spurious disconnect events while the plug in being inserted. > A short response on why this change was made is that commit can be > issued by userspace or the fbdev client. So userspace involvement only > makes commit happen from a different path. It would be incorrect to > assume the issues from the earlier bug and the current one are different > only because there was userspace involvement in that one and not this. > > Because in the end, it manifests itself in the same way that > atomic_enable() did not go through after an atomic_disable() and the > next atomic_disable() crashes. Right, but your proposed fix would not actually fix anything and judging from the sparse commit message and diff itself it is clearly only meant to mitigate the case where user space is involved, which is *not* the case here. Johan