From mboxrd@z Thu Jan 1 00:00:00 1970 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 D5CB68625C; Tue, 23 Apr 2024 11:41:10 +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=1713872470; cv=none; b=RXY+CBMyTqli1phf4hDBb27ekxtJ3x+DEMp1zEKoOoclfodP2tCZf2qJBY5OqJRNclIg3lem6iZw3yaNLLb1nxN6nRK+edn5b7lJt4lgRKMCPGTj/hU/Wg+JmHKfk67FkPZhtz+WFo3ax5B+Xs8P4PA3v4a3nqADqVbaVtgUf+c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713872470; c=relaxed/simple; bh=uCPG6m19kD+YR4Q/y4RzPCRHPnyhZ5d1jJ0v2RVxk+A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DwkbvZ3qR2P7df/Y+Y+Sqjr5dZiugZt8yQ1g5JpjEFoSN0xwygTzimQKw5BY7vC0O4C7i+vaCqQRT/WltgGbDIHtZFVJyiAh9fksaEzWRNkl+mb0FwU9+s+h9xF08U3U9ocplBvF6Qud9TlLT+0QLRbX3RU/zwo7AWDcQJVjgPk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oQCQjWdx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oQCQjWdx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 401E8C2BD11; Tue, 23 Apr 2024 11:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713872470; bh=uCPG6m19kD+YR4Q/y4RzPCRHPnyhZ5d1jJ0v2RVxk+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQCQjWdxSE5DubXpRErPyxk2HvAaco97cOolhoFiXeEgNpXJBirFKbFYJTeGS51D+ pMklN1bFfj4mSuUFZQ38RJumJT2NfUKYJf98aAAfSThk281hfJYZcqMl8S8b4e0jSC X4saV8EWsyfxdoeE/d9pdjD0rbEp5gD0gAzF7Pu/ttLQgix1xmdykCxQjO2XGQSarB RWDHEpQ9v2ZSl3zJ4GS6RmeGTUfQIDnDF8RJStFbJoK+ouktilhP67njJ1WGz+eg+I 8VRV34PnL8m/R5El8BWEfymFBiny6N+SOC801VgxrTf785/MfY0BalMZWtszLC3mUA SwZxXVYUifQrA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lyude Paul , Dave Airlie , Sasha Levin , kherbst@redhat.com, dakr@redhat.com, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.1 8/9] drm/nouveau/dp: Don't probe eDP ports twice harder Date: Tue, 23 Apr 2024 07:02:14 -0400 Message-ID: <20240423110217.1658879-8-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240423110217.1658879-1-sashal@kernel.org> References: <20240423110217.1658879-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.1.87 Content-Transfer-Encoding: 8bit From: Lyude Paul [ Upstream commit bf52d7f9b2067f02efe7e32697479097aba4a055 ] I didn't pay close enough attention the last time I tried to fix this problem - while we currently do correctly take care to make sure we don't probe a connected eDP port more then once, we don't do the same thing for eDP ports we found to be disconnected. So, fix this and make sure we only ever probe eDP ports once and then leave them at that connector state forever (since without HPD, it's not going to change on its own anyway). This should get rid of the last few GSP errors getting spit out during runtime suspend and resume on some machines, as we tried to reprobe eDP ports in response to ACPI hotplug probe events. Signed-off-by: Lyude Paul Reviewed-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20240404233736.7946-3-lyude@redhat.com (cherry picked from commit fe6660b661c3397af0867d5d098f5b26581f1290) Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nouveau_dp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_dp.c b/drivers/gpu/drm/nouveau/nouveau_dp.c index 53185746fb3d1..17e1e23a780e0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_dp.c +++ b/drivers/gpu/drm/nouveau/nouveau_dp.c @@ -109,12 +109,15 @@ nouveau_dp_detect(struct nouveau_connector *nv_connector, u8 *dpcd = nv_encoder->dp.dpcd; int ret = NOUVEAU_DP_NONE, hpd; - /* If we've already read the DPCD on an eDP device, we don't need to - * reread it as it won't change + /* eDP ports don't support hotplugging - so there's no point in probing eDP ports unless we + * haven't probed them once before. */ - if (connector->connector_type == DRM_MODE_CONNECTOR_eDP && - dpcd[DP_DPCD_REV] != 0) - return NOUVEAU_DP_SST; + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) { + if (connector->status == connector_status_connected) + return NOUVEAU_DP_SST; + else if (connector->status == connector_status_disconnected) + return NOUVEAU_DP_NONE; + } mutex_lock(&nv_encoder->dp.hpd_irq_lock); if (mstm) { -- 2.43.0