From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D8F0C433ED for ; Mon, 3 May 2021 03:13:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 008E7611CE for ; Mon, 3 May 2021 03:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232401AbhECDOF (ORCPT ); Sun, 2 May 2021 23:14:05 -0400 Received: from mga12.intel.com ([192.55.52.136]:32498 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232377AbhECDOF (ORCPT ); Sun, 2 May 2021 23:14:05 -0400 IronPort-SDR: aRFKyM+uLGO7XrRuSstfc01ekQ+C2HoQgJsB2kY1KOJPR/YVg6TsFAsLb+0CGLUTv5UAgFGczV BY0oGo8mlnSw== X-IronPort-AV: E=McAfee;i="6200,9189,9972"; a="177182983" X-IronPort-AV: E=Sophos;i="5.82,268,1613462400"; d="scan'208";a="177182983" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2021 20:13:12 -0700 IronPort-SDR: DlWEuVc0GsZ3l2+sap/HNaJbO6bnemkBr3ic7xwnaYf3UstWJiIJgYMNDV7JDDnl61Yd449exs SRFm40MiPnQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,268,1613462400"; d="scan'208";a="389370171" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by orsmga006.jf.intel.com with SMTP; 02 May 2021 20:13:08 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 03 May 2021 06:13:08 +0300 Date: Mon, 3 May 2021 06:13:08 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Lyude Paul Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, =?iso-8859-1?B?Suly9G1l?= de Bretagne , David Airlie , open list , Jani Nikula , stable@vger.kernel.org, Thomas Zimmermann , Sean Paul Subject: Re: [PATCH 1/2] drm/dp: Handle zeroed port counts in drm_dp_read_downstream_info() Message-ID: References: <20210430223428.10514-1-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210430223428.10514-1-lyude@redhat.com> X-Patchwork-Hint: comment Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, Apr 30, 2021 at 06:34:27PM -0400, Lyude Paul wrote: > While the DP specification isn't entirely clear on if this should be > allowed or not, some branch devices report having downstream ports present > while also reporting a downstream port count of 0. So to avoid breaking > those devices, we need to handle this in drm_dp_read_downstream_info(). > > So, to do this we assume there's no downstream port info when the > downstream port count is 0. > > Signed-off-by: Lyude Paul > Tested-by: Jérôme de Bretagne > Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3416 > Fixes: 3d3721ccb18a ("drm/i915/dp: Extract drm_dp_read_downstream_info()") > Cc: # v5.10+ > --- > drivers/gpu/drm/drm_dp_helper.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c > index cb56d74e9d38..27c8c5bdf7d9 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -682,7 +682,14 @@ int drm_dp_read_downstream_info(struct drm_dp_aux *aux, > !(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT)) > return 0; > > + /* Some branches advertise having 0 downstream ports, despite also advertising they have a > + * downstream port present. The DP spec isn't clear on if this is allowed or not, but since > + * some branches do it we need to handle it regardless. > + */ > len = drm_dp_downstream_port_count(dpcd); > + if (!len) > + return 0; > + Seems sane enough. Reviewed-by: Ville Syrjälä > if (dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DETAILED_CAP_INFO_AVAILABLE) > len *= 4; > > -- > 2.30.2 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrjälä Intel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA59AC433B4 for ; Mon, 3 May 2021 03:13:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 64F41613AA for ; Mon, 3 May 2021 03:13:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 64F41613AA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9BD166E863; Mon, 3 May 2021 03:13:15 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 431F66E861; Mon, 3 May 2021 03:13:14 +0000 (UTC) IronPort-SDR: Oanb9atMp55jV4XK0oX/zqdwCGjjMoWIRArnuRoDcoJzAzpS9BHoDHiqKj7Siu+b3+Cz2wmteE XggAPQ/ZDrsw== X-IronPort-AV: E=McAfee;i="6200,9189,9972"; a="258941310" X-IronPort-AV: E=Sophos;i="5.82,268,1613462400"; d="scan'208";a="258941310" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2021 20:13:12 -0700 IronPort-SDR: DlWEuVc0GsZ3l2+sap/HNaJbO6bnemkBr3ic7xwnaYf3UstWJiIJgYMNDV7JDDnl61Yd449exs SRFm40MiPnQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,268,1613462400"; d="scan'208";a="389370171" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by orsmga006.jf.intel.com with SMTP; 02 May 2021 20:13:08 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 03 May 2021 06:13:08 +0300 Date: Mon, 3 May 2021 06:13:08 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Lyude Paul Message-ID: References: <20210430223428.10514-1-lyude@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210430223428.10514-1-lyude@redhat.com> X-Patchwork-Hint: comment Subject: Re: [Intel-gfx] [PATCH 1/2] drm/dp: Handle zeroed port counts in drm_dp_read_downstream_info() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?iso-8859-1?B?Suly9G1l?= de Bretagne , David Airlie , intel-gfx@lists.freedesktop.org, open list , dri-devel@lists.freedesktop.org, Jani Nikula , stable@vger.kernel.org, Thomas Zimmermann Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, Apr 30, 2021 at 06:34:27PM -0400, Lyude Paul wrote: > While the DP specification isn't entirely clear on if this should be > allowed or not, some branch devices report having downstream ports present > while also reporting a downstream port count of 0. So to avoid breaking > those devices, we need to handle this in drm_dp_read_downstream_info(). > = > So, to do this we assume there's no downstream port info when the > downstream port count is 0. > = > Signed-off-by: Lyude Paul > Tested-by: J=E9r=F4me de Bretagne > Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3416 > Fixes: 3d3721ccb18a ("drm/i915/dp: Extract drm_dp_read_downstream_info()") > Cc: # v5.10+ > --- > drivers/gpu/drm/drm_dp_helper.c | 7 +++++++ > 1 file changed, 7 insertions(+) > = > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_hel= per.c > index cb56d74e9d38..27c8c5bdf7d9 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -682,7 +682,14 @@ int drm_dp_read_downstream_info(struct drm_dp_aux *a= ux, > !(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT)) > return 0; > = > + /* Some branches advertise having 0 downstream ports, despite also adve= rtising they have a > + * downstream port present. The DP spec isn't clear on if this is allow= ed or not, but since > + * some branches do it we need to handle it regardless. > + */ > len =3D drm_dp_downstream_port_count(dpcd); > + if (!len) > + return 0; > + Seems sane enough. Reviewed-by: Ville Syrj=E4l=E4 > if (dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DETAILED_CAP_INFO_AVAILABLE) > len *=3D 4; > = > -- = > 2.30.2 > = > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A711C433B4 for ; Mon, 3 May 2021 03:13:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7533611CE for ; Mon, 3 May 2021 03:13:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A7533611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AE5A6E861; Mon, 3 May 2021 03:13:15 +0000 (UTC) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 431F66E861; Mon, 3 May 2021 03:13:14 +0000 (UTC) IronPort-SDR: Oanb9atMp55jV4XK0oX/zqdwCGjjMoWIRArnuRoDcoJzAzpS9BHoDHiqKj7Siu+b3+Cz2wmteE XggAPQ/ZDrsw== X-IronPort-AV: E=McAfee;i="6200,9189,9972"; a="258941310" X-IronPort-AV: E=Sophos;i="5.82,268,1613462400"; d="scan'208";a="258941310" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 May 2021 20:13:12 -0700 IronPort-SDR: DlWEuVc0GsZ3l2+sap/HNaJbO6bnemkBr3ic7xwnaYf3UstWJiIJgYMNDV7JDDnl61Yd449exs SRFm40MiPnQQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.82,268,1613462400"; d="scan'208";a="389370171" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.171]) by orsmga006.jf.intel.com with SMTP; 02 May 2021 20:13:08 -0700 Received: by stinkbox (sSMTP sendmail emulation); Mon, 03 May 2021 06:13:08 +0300 Date: Mon, 3 May 2021 06:13:08 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Lyude Paul Subject: Re: [PATCH 1/2] drm/dp: Handle zeroed port counts in drm_dp_read_downstream_info() Message-ID: References: <20210430223428.10514-1-lyude@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210430223428.10514-1-lyude@redhat.com> X-Patchwork-Hint: comment X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?iso-8859-1?B?Suly9G1l?= de Bretagne , David Airlie , intel-gfx@lists.freedesktop.org, open list , dri-devel@lists.freedesktop.org, Jani Nikula , stable@vger.kernel.org, Thomas Zimmermann , Sean Paul Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Apr 30, 2021 at 06:34:27PM -0400, Lyude Paul wrote: > While the DP specification isn't entirely clear on if this should be > allowed or not, some branch devices report having downstream ports present > while also reporting a downstream port count of 0. So to avoid breaking > those devices, we need to handle this in drm_dp_read_downstream_info(). > = > So, to do this we assume there's no downstream port info when the > downstream port count is 0. > = > Signed-off-by: Lyude Paul > Tested-by: J=E9r=F4me de Bretagne > Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3416 > Fixes: 3d3721ccb18a ("drm/i915/dp: Extract drm_dp_read_downstream_info()") > Cc: # v5.10+ > --- > drivers/gpu/drm/drm_dp_helper.c | 7 +++++++ > 1 file changed, 7 insertions(+) > = > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_hel= per.c > index cb56d74e9d38..27c8c5bdf7d9 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -682,7 +682,14 @@ int drm_dp_read_downstream_info(struct drm_dp_aux *a= ux, > !(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT)) > return 0; > = > + /* Some branches advertise having 0 downstream ports, despite also adve= rtising they have a > + * downstream port present. The DP spec isn't clear on if this is allow= ed or not, but since > + * some branches do it we need to handle it regardless. > + */ > len =3D drm_dp_downstream_port_count(dpcd); > + if (!len) > + return 0; > + Seems sane enough. Reviewed-by: Ville Syrj=E4l=E4 > if (dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DETAILED_CAP_INFO_AVAILABLE) > len *=3D 4; > = > -- = > 2.30.2 > = > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Ville Syrj=E4l=E4 Intel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel