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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 754F7C282DD for ; Tue, 7 Jan 2020 18:57:25 +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 501772081E for ; Tue, 7 Jan 2020 18:57:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 501772081E 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=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4980B6E125; Tue, 7 Jan 2020 18:57:23 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id C93ED6E127; Tue, 7 Jan 2020 18:57:21 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 10:57:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,406,1571727600"; d="scan'208";a="233314132" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga002.jf.intel.com with SMTP; 07 Jan 2020 10:57:18 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 07 Jan 2020 20:57:15 +0200 Date: Tue, 7 Jan 2020 20:57:15 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: "Lin, Wayne" Subject: Re: [PATCH] drm/dp_mst: correct the shifting in DP_REMOTE_I2C_READ Message-ID: <20200107185715.GK1208@intel.com> References: <20191230070516.4760-1-Wayne.Lin@amd.com> <87mubaoyi1.fsf@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Zuo, Jerry" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , Jani Nikula , "Kazlauskas, Nicholas" Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Tue, Dec 31, 2019 at 03:30:47AM +0000, Lin, Wayne wrote: > [AMD Official Use Only - Internal Distribution Only] > = > > ________________________________________ > > From: Jani Nikula > > Sent: Monday, December 30, 2019 19:15 > > To: Lin, Wayne; dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesk= top.org > > Cc: Zuo, Jerry; Kazlauskas, Nicholas; Lin, Wayne > > Subject: Re: [PATCH] drm/dp_mst: correct the shifting in DP_REMOTE_I2C_= READ > > > > On Mon, 30 Dec 2019, Wayne Lin wrote: > > > [Why] > > > According to DP spec, it should shift left 4 digits for NO_STOP_BIT > > > in REMOTE_I2C_READ message. Not 5 digits. > > > > > > [How] > > > Correct the shifting value of NO_STOP_BIT for DP_REMOTE_I2C_READ case= in > > > drm_dp_encode_sideband_req(). > > > > Which commit introduced the issue? Fixes: tag. Does it need a stable > > backport? Does this fix a user visible bug? > > > > BR, > > Jani. > > > Thanks for your time and reminder. > = > It seems like the issue has been there since very beginning.(commit: ad7f= 8a1). > It doesn't introduce user visible bug under my test cases, but this affec= ts the I2C signal > between I2C master and I2C slave. Not pretty sure if there is any eeprom = will reset > the written offset once received I2C stop. If so, that might cause wrongl= y reading EDID. > I will Cc to stable. Thanks. The segment address should be reset on STOP. So large EDIDs should fail. IIRC we had a bug report of some sort about this which I tried to fix by confgiuring .no_stop_bit correctly, but apparently I failed to double check that the bit get stuffed onto the wire correctly. Ah yes, https://bugs.freedesktop.org/show_bug.cgi?id=3D108081 So you may have just fixed that one, although we seem to have closed it already. > > > Signed-off-by: Wayne Lin > > > --- > > > drivers/gpu/drm/drm_dp_mst_topology.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/= drm_dp_mst_topology.c > > > index 1d1bfa49ca2b..0557e225ff67 100644 > > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > > > @@ -393,7 +393,7 @@ drm_dp_encode_sideband_req(const struct drm_dp_si= deband_msg_req_body *req, > > > memcpy(&buf[idx], req->u.i2c_read.transactions[= i].bytes, req->u.i2c_read.transactions[i].num_bytes); > > > idx +=3D req->u.i2c_read.transactions[i].num_by= tes; > > > > > > - buf[idx] =3D (req->u.i2c_read.transactions[i].n= o_stop_bit & 0x1) << 5; > > > + buf[idx] =3D (req->u.i2c_read.transactions[i].n= o_stop_bit & 0x1) << 4; > > > buf[idx] |=3D (req->u.i2c_read.transactions[i].= i2c_transaction_delay & 0xf); > > > idx++; > > > } > > > > -- > > Jani Nikula, Intel Open Source Graphics Center > -- > Wayne Lin > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- = Ville Syrj=E4l=E4 Intel _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-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=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 83DCEC3F68F for ; Tue, 7 Jan 2020 18:57:25 +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 6384E20848 for ; Tue, 7 Jan 2020 18:57:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6384E20848 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 663FC6E127; Tue, 7 Jan 2020 18:57:23 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id C93ED6E127; Tue, 7 Jan 2020 18:57:21 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Jan 2020 10:57:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,406,1571727600"; d="scan'208";a="233314132" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga002.jf.intel.com with SMTP; 07 Jan 2020 10:57:18 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 07 Jan 2020 20:57:15 +0200 Date: Tue, 7 Jan 2020 20:57:15 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: "Lin, Wayne" Subject: Re: [PATCH] drm/dp_mst: correct the shifting in DP_REMOTE_I2C_READ Message-ID: <20200107185715.GK1208@intel.com> References: <20191230070516.4760-1-Wayne.Lin@amd.com> <87mubaoyi1.fsf@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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: "Zuo, Jerry" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "Kazlauskas, Nicholas" 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 Tue, Dec 31, 2019 at 03:30:47AM +0000, Lin, Wayne wrote: > [AMD Official Use Only - Internal Distribution Only] > = > > ________________________________________ > > From: Jani Nikula > > Sent: Monday, December 30, 2019 19:15 > > To: Lin, Wayne; dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesk= top.org > > Cc: Zuo, Jerry; Kazlauskas, Nicholas; Lin, Wayne > > Subject: Re: [PATCH] drm/dp_mst: correct the shifting in DP_REMOTE_I2C_= READ > > > > On Mon, 30 Dec 2019, Wayne Lin wrote: > > > [Why] > > > According to DP spec, it should shift left 4 digits for NO_STOP_BIT > > > in REMOTE_I2C_READ message. Not 5 digits. > > > > > > [How] > > > Correct the shifting value of NO_STOP_BIT for DP_REMOTE_I2C_READ case= in > > > drm_dp_encode_sideband_req(). > > > > Which commit introduced the issue? Fixes: tag. Does it need a stable > > backport? Does this fix a user visible bug? > > > > BR, > > Jani. > > > Thanks for your time and reminder. > = > It seems like the issue has been there since very beginning.(commit: ad7f= 8a1). > It doesn't introduce user visible bug under my test cases, but this affec= ts the I2C signal > between I2C master and I2C slave. Not pretty sure if there is any eeprom = will reset > the written offset once received I2C stop. If so, that might cause wrongl= y reading EDID. > I will Cc to stable. Thanks. The segment address should be reset on STOP. So large EDIDs should fail. IIRC we had a bug report of some sort about this which I tried to fix by confgiuring .no_stop_bit correctly, but apparently I failed to double check that the bit get stuffed onto the wire correctly. Ah yes, https://bugs.freedesktop.org/show_bug.cgi?id=3D108081 So you may have just fixed that one, although we seem to have closed it already. > > > Signed-off-by: Wayne Lin > > > --- > > > drivers/gpu/drm/drm_dp_mst_topology.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/= drm_dp_mst_topology.c > > > index 1d1bfa49ca2b..0557e225ff67 100644 > > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c > > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c > > > @@ -393,7 +393,7 @@ drm_dp_encode_sideband_req(const struct drm_dp_si= deband_msg_req_body *req, > > > memcpy(&buf[idx], req->u.i2c_read.transactions[= i].bytes, req->u.i2c_read.transactions[i].num_bytes); > > > idx +=3D req->u.i2c_read.transactions[i].num_by= tes; > > > > > > - buf[idx] =3D (req->u.i2c_read.transactions[i].n= o_stop_bit & 0x1) << 5; > > > + buf[idx] =3D (req->u.i2c_read.transactions[i].n= o_stop_bit & 0x1) << 4; > > > buf[idx] |=3D (req->u.i2c_read.transactions[i].= i2c_transaction_delay & 0xf); > > > idx++; > > > } > > > > -- > > Jani Nikula, Intel Open Source Graphics Center > -- > Wayne Lin > _______________________________________________ > 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