From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F354B606A681 for ; Thu, 3 Dec 2026 00:04:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=WK+R8B9Q Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 616AE1126B0; Thu, 3 Dec 2026 00:04:24 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id A04A91126B0 for ; Thu, 3 Dec 2026 00:04:18 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 47817435E5; Thu, 3 Dec 2026 00:04:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C01E1F00893; Thu, 3 Dec 2026 00:04:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796256258; bh=zcIB/3SRxjGNeggG85xFSkPDT6r6nfjDMzONcFUJY3Q=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=WK+R8B9QK9h+NLvv1iKhsA25KIAjRkL5pm8f3fX5vIyO4TUckX62B/k9jrHBcMZeV VM8WHbC+/lbV040XlyWNzo+IEskDP9jP5xdwGyMJ5GYlhRDuPmGJEvDBi0eZNnHZ6K Y1qyiyrsmjNZUpxNck6F7f7kKS5DAiEp0ixMB3wQGvYusJqb2XarDQhniIHxP5vpsg qdqtT3iWZeMqO1hbOcLksILv17odLgBWjiGzRLrJP63hNaiIyUVTg63TjSn/FKvQir 08rDmMDldnAZ3wIqUF/SxZjonN0JzX8x7MioGMaVcsuLIciO3zZDF/3m/pK7ytC27r ojxJy0+JODEJg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 10/11] drm/msm/dp: guard internal HPD state checks when external HPD is used To: "Gianfranco Mariotti" Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261202234640.9379-11-gianfranco.mariotti94@gmail.com> References: <20261202234640.9379-1-gianfranco.mariotti94@gmail.com> <20261202234640.9379-11-gianfranco.mariotti94@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 00:04:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] drm/msm/dp: inverted read_link_status check in msm_dp_ctrl_on_link() -- commit 8c690997a9febc2815a307edb04f4bd93ad4035f Author: Gianfranco Mariotti drm/msm/dp: guard internal HPD state checks when external HPD is used This commit tracks whether the DP controller's internal HPD block is enabled and gates internal HPD state checks on it, while also adding an error check for drm_dp_dpcd_read_link_status() in msm_dp_ctrl_on_link(). > diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp= _ctrl.c > index ceff9a99147f2..36fc9c6bd9f45 100644 > --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c > +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c > @@ -2435,10 +2435,13 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_d= p_ctrl, > break; > } else if (training_step =3D=3D DP_TRAINING_1) { > /* link train_1 failed */ > - if (!msm_dp_aux_is_link_connected(ctrl->aux)) > + if (msm_dp_aux_is_hpd_enabled(ctrl->aux) && > + !msm_dp_aux_is_link_connected(ctrl->aux)) > break; > =20 > - drm_dp_dpcd_read_link_status(ctrl->aux, link_status); > + if (drm_dp_dpcd_read_link_status(ctrl->aux, > + link_status) <=3D 0) > + break; > =20 > rc =3D msm_dp_ctrl_link_rate_down_shift(ctrl); > if (rc < 0) { /* already in RBR =3D 1.6G */ > @@ -2460,10 +2463,13 @@ int msm_dp_ctrl_on_link(struct msm_dp_ctrl *msm_d= p_ctrl, > } > } else if (training_step =3D=3D DP_TRAINING_2) { > /* link train_2 failed */ > - if (!msm_dp_aux_is_link_connected(ctrl->aux)) > + if (msm_dp_aux_is_hpd_enabled(ctrl->aux) && > + !msm_dp_aux_is_link_connected(ctrl->aux)) > break; > =20 > - drm_dp_dpcd_read_link_status(ctrl->aux, link_status); > + if (drm_dp_dpcd_read_link_status(ctrl->aux, > + link_status) <=3D 0) > + break; > =20 > if (!drm_dp_clock_recovery_ok(link_status, > ctrl->link->link_params.num_lanes)) [Severity: High] Should both of these checks test `< 0` rather than `<=3D 0`? Since fcbb93f1e48a ("drm/display: dp: change drm_dp_dpcd_read_link_status() return value"), drm_dp_dpcd_read_link_status() returns 0 on success and a negative errno on failure. Testing `<=3D 0` is always true, so any DP_TRAINING_1 or DP_TRAINING_2 failure aborts the retry loop immediately instead of downshifting the link rate or lane count. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202234640.9379= -1-gianfranco.mariotti94@gmail.com?part=3D10