All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/dp_mst: Check crc4 value while building sideband message
@ 2020-02-03 12:16 ` Benjamin Gaignard
  0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Gaignard @ 2020-02-03 12:16 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel
  Cc: dri-devel, linux-kernel, Benjamin Gaignard, lyude, jani.nikula

Check that computed crc value is matching the one encoded in the message.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
---
CC: lyude@redhat.com
CC: airlied@linux.ie
CC: jani.nikula@linux.intel.com
 drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 822d2f177f90..eee899d6742b 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -736,6 +736,10 @@ static bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg,
 	if (msg->curchunk_idx >= msg->curchunk_len) {
 		/* do CRC */
 		crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len - 1);
+		if (crc4 != msg->chunk[msg->curchunk_len - 1])
+			print_hex_dump(KERN_DEBUG, "wrong crc",
+				       DUMP_PREFIX_NONE, 16, 1,
+				       msg->chunk,  msg->curchunk_len, false);
 		/* copy chunk into bigger msg */
 		memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len - 1);
 		msg->curlen += msg->curchunk_len - 1;
-- 
2.15.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] drm/dp_mst: Check crc4 value while building sideband message
@ 2020-02-03 12:16 ` Benjamin Gaignard
  0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Gaignard @ 2020-02-03 12:16 UTC (permalink / raw)
  To: maarten.lankhorst, mripard, airlied, daniel
  Cc: linux-kernel, dri-devel, Benjamin Gaignard

Check that computed crc value is matching the one encoded in the message.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
---
CC: lyude@redhat.com
CC: airlied@linux.ie
CC: jani.nikula@linux.intel.com
 drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 822d2f177f90..eee899d6742b 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -736,6 +736,10 @@ static bool drm_dp_sideband_msg_build(struct drm_dp_sideband_msg_rx *msg,
 	if (msg->curchunk_idx >= msg->curchunk_len) {
 		/* do CRC */
 		crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len - 1);
+		if (crc4 != msg->chunk[msg->curchunk_len - 1])
+			print_hex_dump(KERN_DEBUG, "wrong crc",
+				       DUMP_PREFIX_NONE, 16, 1,
+				       msg->chunk,  msg->curchunk_len, false);
 		/* copy chunk into bigger msg */
 		memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len - 1);
 		msg->curlen += msg->curchunk_len - 1;
-- 
2.15.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/dp_mst: Check crc4 value while building sideband message
  2020-02-03 12:16 ` Benjamin Gaignard
@ 2020-02-04 19:00   ` Lyude Paul
  -1 siblings, 0 replies; 6+ messages in thread
From: Lyude Paul @ 2020-02-04 19:00 UTC (permalink / raw)
  To: Benjamin Gaignard, maarten.lankhorst, mripard, airlied, daniel
  Cc: dri-devel, linux-kernel, jani.nikula

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Mon, 2020-02-03 at 13:16 +0100, Benjamin Gaignard wrote:
> Check that computed crc value is matching the one encoded in the message.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
> CC: lyude@redhat.com
> CC: airlied@linux.ie
> CC: jani.nikula@linux.intel.com
>  drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 822d2f177f90..eee899d6742b 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -736,6 +736,10 @@ static bool drm_dp_sideband_msg_build(struct
> drm_dp_sideband_msg_rx *msg,
>  	if (msg->curchunk_idx >= msg->curchunk_len) {
>  		/* do CRC */
>  		crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len -
> 1);
> +		if (crc4 != msg->chunk[msg->curchunk_len - 1])
> +			print_hex_dump(KERN_DEBUG, "wrong crc",
> +				       DUMP_PREFIX_NONE, 16, 1,
> +				       msg->chunk,  msg->curchunk_len, false);
>  		/* copy chunk into bigger msg */
>  		memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len -
> 1);
>  		msg->curlen += msg->curchunk_len - 1;
-- 
Cheers,
	Lyude Paul


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/dp_mst: Check crc4 value while building sideband message
@ 2020-02-04 19:00   ` Lyude Paul
  0 siblings, 0 replies; 6+ messages in thread
From: Lyude Paul @ 2020-02-04 19:00 UTC (permalink / raw)
  To: Benjamin Gaignard, maarten.lankhorst, mripard, airlied, daniel
  Cc: linux-kernel, dri-devel

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Mon, 2020-02-03 at 13:16 +0100, Benjamin Gaignard wrote:
> Check that computed crc value is matching the one encoded in the message.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
> CC: lyude@redhat.com
> CC: airlied@linux.ie
> CC: jani.nikula@linux.intel.com
>  drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 822d2f177f90..eee899d6742b 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -736,6 +736,10 @@ static bool drm_dp_sideband_msg_build(struct
> drm_dp_sideband_msg_rx *msg,
>  	if (msg->curchunk_idx >= msg->curchunk_len) {
>  		/* do CRC */
>  		crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len -
> 1);
> +		if (crc4 != msg->chunk[msg->curchunk_len - 1])
> +			print_hex_dump(KERN_DEBUG, "wrong crc",
> +				       DUMP_PREFIX_NONE, 16, 1,
> +				       msg->chunk,  msg->curchunk_len, false);
>  		/* copy chunk into bigger msg */
>  		memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len -
> 1);
>  		msg->curlen += msg->curchunk_len - 1;
-- 
Cheers,
	Lyude Paul

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/dp_mst: Check crc4 value while building sideband message
  2020-02-04 19:00   ` Lyude Paul
@ 2020-02-28 12:16     ` Benjamin Gaignard
  -1 siblings, 0 replies; 6+ messages in thread
From: Benjamin Gaignard @ 2020-02-28 12:16 UTC (permalink / raw)
  To: Lyude Paul
  Cc: Benjamin Gaignard, Maarten Lankhorst, Maxime Ripard,
	David Airlie, Daniel Vetter, Linux Kernel Mailing List,
	ML dri-devel

Le mar. 4 févr. 2020 à 20:00, Lyude Paul <lyude@redhat.com> a écrit :
>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
>

Applied on drm-misc-next
Thanks,
Benjamin

> On Mon, 2020-02-03 at 13:16 +0100, Benjamin Gaignard wrote:
> > Check that computed crc value is matching the one encoded in the message.
> >
> > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> > ---
> > CC: lyude@redhat.com
> > CC: airlied@linux.ie
> > CC: jani.nikula@linux.intel.com
> >  drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 822d2f177f90..eee899d6742b 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -736,6 +736,10 @@ static bool drm_dp_sideband_msg_build(struct
> > drm_dp_sideband_msg_rx *msg,
> >       if (msg->curchunk_idx >= msg->curchunk_len) {
> >               /* do CRC */
> >               crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len -
> > 1);
> > +             if (crc4 != msg->chunk[msg->curchunk_len - 1])
> > +                     print_hex_dump(KERN_DEBUG, "wrong crc",
> > +                                    DUMP_PREFIX_NONE, 16, 1,
> > +                                    msg->chunk,  msg->curchunk_len, false);
> >               /* copy chunk into bigger msg */
> >               memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len -
> > 1);
> >               msg->curlen += msg->curchunk_len - 1;
> --
> Cheers,
>         Lyude Paul
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm/dp_mst: Check crc4 value while building sideband message
@ 2020-02-28 12:16     ` Benjamin Gaignard
  0 siblings, 0 replies; 6+ messages in thread
From: Benjamin Gaignard @ 2020-02-28 12:16 UTC (permalink / raw)
  To: Lyude Paul
  Cc: Benjamin Gaignard, David Airlie, Linux Kernel Mailing List, ML dri-devel

Le mar. 4 févr. 2020 à 20:00, Lyude Paul <lyude@redhat.com> a écrit :
>
> Reviewed-by: Lyude Paul <lyude@redhat.com>
>

Applied on drm-misc-next
Thanks,
Benjamin

> On Mon, 2020-02-03 at 13:16 +0100, Benjamin Gaignard wrote:
> > Check that computed crc value is matching the one encoded in the message.
> >
> > Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> > ---
> > CC: lyude@redhat.com
> > CC: airlied@linux.ie
> > CC: jani.nikula@linux.intel.com
> >  drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 822d2f177f90..eee899d6742b 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -736,6 +736,10 @@ static bool drm_dp_sideband_msg_build(struct
> > drm_dp_sideband_msg_rx *msg,
> >       if (msg->curchunk_idx >= msg->curchunk_len) {
> >               /* do CRC */
> >               crc4 = drm_dp_msg_data_crc4(msg->chunk, msg->curchunk_len -
> > 1);
> > +             if (crc4 != msg->chunk[msg->curchunk_len - 1])
> > +                     print_hex_dump(KERN_DEBUG, "wrong crc",
> > +                                    DUMP_PREFIX_NONE, 16, 1,
> > +                                    msg->chunk,  msg->curchunk_len, false);
> >               /* copy chunk into bigger msg */
> >               memcpy(&msg->msg[msg->curlen], msg->chunk, msg->curchunk_len -
> > 1);
> >               msg->curlen += msg->curchunk_len - 1;
> --
> Cheers,
>         Lyude Paul
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-02-28 12:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-03 12:16 [PATCH] drm/dp_mst: Check crc4 value while building sideband message Benjamin Gaignard
2020-02-03 12:16 ` Benjamin Gaignard
2020-02-04 19:00 ` Lyude Paul
2020-02-04 19:00   ` Lyude Paul
2020-02-28 12:16   ` Benjamin Gaignard
2020-02-28 12:16     ` Benjamin Gaignard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.