diff mbox series

[2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast

Message ID 20210222040027.23505-3-Wayne.Lin@amd.com (mailing list archive)
State New, archived
Headers show
Series Set CLEAR_PAYLOAD_ID_TABLE as broadcast request | expand

Commit Message

Lin, Wayne Feb. 22, 2021, 4 a.m. UTC
[Why & How]
According to DP spec, CLEAR_PAYLOAD_ID_TABLE is a path broadcast request
message and current implementation is incorrect. Fix it.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ville Syrjala Feb. 22, 2021, 5 p.m. UTC | #1
On Mon, Feb 22, 2021 at 12:00:27PM +0800, Wayne Lin wrote:
> [Why & How]
> According to DP spec, CLEAR_PAYLOAD_ID_TABLE is a path broadcast request
> message and current implementation is incorrect. Fix it.
> 
> Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 713ef3b42054..6d73559046e5 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -1072,6 +1072,7 @@ static void build_clear_payload_id_table(struct drm_dp_sideband_msg_tx *msg)
>  
>  	req.req_type = DP_CLEAR_PAYLOAD_ID_TABLE;
>  	drm_dp_encode_sideband_req(&req, msg);
> +	msg->path_msg = true;
>  }
>  
>  static int build_enum_path_resources(struct drm_dp_sideband_msg_tx *msg,
> @@ -2722,7 +2723,8 @@ static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
>  
>  	req_type = txmsg->msg[0] & 0x7f;
>  	if (req_type == DP_CONNECTION_STATUS_NOTIFY ||
> -		req_type == DP_RESOURCE_STATUS_NOTIFY)
> +		req_type == DP_RESOURCE_STATUS_NOTIFY ||
> +		req_type == DP_CLEAR_PAYLOAD_ID_TABLE)
>  		hdr->broadcast = 1;

Looks correct.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Hmm. Looks like we're missing DP_POWER_DOWN_PHY and DP_POWER_UP_PHY
here as well. We do try to send them as path requests, but apparently
forget to mark them as broadcast messages.

>  	else
>  		hdr->broadcast = 0;
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Lin, Wayne Feb. 23, 2021, 5:32 a.m. UTC | #2
[AMD Public Use]

> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Tuesday, February 23, 2021 1:00 AM
> To: Lin, Wayne <Wayne.Lin@amd.com>
> Cc: dri-devel@lists.freedesktop.org; Brol, Eryk <Eryk.Brol@amd.com>; Zhuo, Qingqing <Qingqing.Zhuo@amd.com>;
> stable@vger.kernel.org; Zuo, Jerry <Jerry.Zuo@amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Dhinakaran
> Pandiyan <dhinakaran.pandiyan@intel.com>
> Subject: Re: [PATCH 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast
>
> On Mon, Feb 22, 2021 at 12:00:27PM +0800, Wayne Lin wrote:
> > [Why & How]
> > According to DP spec, CLEAR_PAYLOAD_ID_TABLE is a path broadcast
> > request message and current implementation is incorrect. Fix it.
> >
> > Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> > Cc: stable@vger.kernel.org
> > ---
> >  drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 713ef3b42054..6d73559046e5 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -1072,6 +1072,7 @@ static void build_clear_payload_id_table(struct
> > drm_dp_sideband_msg_tx *msg)
> >
> >  req.req_type = DP_CLEAR_PAYLOAD_ID_TABLE;
> >  drm_dp_encode_sideband_req(&req, msg);
> > +msg->path_msg = true;
> >  }
> >
> >  static int build_enum_path_resources(struct drm_dp_sideband_msg_tx
> > *msg, @@ -2722,7 +2723,8 @@ static int set_hdr_from_dst_qlock(struct
> > drm_dp_sideband_msg_hdr *hdr,
> >
> >  req_type = txmsg->msg[0] & 0x7f;
> >  if (req_type == DP_CONNECTION_STATUS_NOTIFY ||
> > -req_type == DP_RESOURCE_STATUS_NOTIFY)
> > +req_type == DP_RESOURCE_STATUS_NOTIFY ||
> > +req_type == DP_CLEAR_PAYLOAD_ID_TABLE)
> >  hdr->broadcast = 1;
>
> Looks correct.
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Hmm. Looks like we're missing DP_POWER_DOWN_PHY and DP_POWER_UP_PHY here as well. We do try to send them as path
> requests, but apparently forget to mark them as broadcast messages.
Hi Ville,
I also look up the spec but DP_POWER_DOWN_PHY & DP_POWER_UP_PHY seems to be defined as path or node request only. Not broadcast message. Please correct me if I'm wrong here.
Appreciate for your time!
>
> >  else
> >  hdr->broadcast = 0;
> > --
> > 2.17.1
> >
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> > s.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=04%7C01%7C
> > Wayne.Lin%40amd.com%7C372bbed7b5354ca05f5608d8d753533a%7C3dd8961fe4884
> > e608e11a82d994e183d%7C0%7C0%7C637496100180287539%7CUnknown%7CTWFpbGZsb
> > 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
> > 7C1000&amp;sdata=2uhm9Nf31hfhf%2FbmwfqYW7b6ay9swWb8oS10Uc%2FVFRQ%3D&am
> > p;reserved=0
>
> --
> Ville Syrjälä
> Intel
Regards,
Wayne Lin
Ville Syrjala Feb. 23, 2021, 1:21 p.m. UTC | #3
On Tue, Feb 23, 2021 at 05:32:36AM +0000, Lin, Wayne wrote:
> [AMD Public Use]
> 
> > -----Original Message-----
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Sent: Tuesday, February 23, 2021 1:00 AM
> > To: Lin, Wayne <Wayne.Lin@amd.com>
> > Cc: dri-devel@lists.freedesktop.org; Brol, Eryk <Eryk.Brol@amd.com>; Zhuo, Qingqing <Qingqing.Zhuo@amd.com>;
> > stable@vger.kernel.org; Zuo, Jerry <Jerry.Zuo@amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Dhinakaran
> > Pandiyan <dhinakaran.pandiyan@intel.com>
> > Subject: Re: [PATCH 2/2] drm/dp_mst: Set CLEAR_PAYLOAD_ID_TABLE as broadcast
> >
> > On Mon, Feb 22, 2021 at 12:00:27PM +0800, Wayne Lin wrote:
> > > [Why & How]
> > > According to DP spec, CLEAR_PAYLOAD_ID_TABLE is a path broadcast
> > > request message and current implementation is incorrect. Fix it.
> > >
> > > Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
> > > Cc: stable@vger.kernel.org
> > > ---
> > >  drivers/gpu/drm/drm_dp_mst_topology.c | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > > index 713ef3b42054..6d73559046e5 100644
> > > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > > @@ -1072,6 +1072,7 @@ static void build_clear_payload_id_table(struct
> > > drm_dp_sideband_msg_tx *msg)
> > >
> > >  req.req_type = DP_CLEAR_PAYLOAD_ID_TABLE;
> > >  drm_dp_encode_sideband_req(&req, msg);
> > > +msg->path_msg = true;
> > >  }
> > >
> > >  static int build_enum_path_resources(struct drm_dp_sideband_msg_tx
> > > *msg, @@ -2722,7 +2723,8 @@ static int set_hdr_from_dst_qlock(struct
> > > drm_dp_sideband_msg_hdr *hdr,
> > >
> > >  req_type = txmsg->msg[0] & 0x7f;
> > >  if (req_type == DP_CONNECTION_STATUS_NOTIFY ||
> > > -req_type == DP_RESOURCE_STATUS_NOTIFY)
> > > +req_type == DP_RESOURCE_STATUS_NOTIFY ||
> > > +req_type == DP_CLEAR_PAYLOAD_ID_TABLE)
> > >  hdr->broadcast = 1;
> >
> > Looks correct.
> > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Hmm. Looks like we're missing DP_POWER_DOWN_PHY and DP_POWER_UP_PHY here as well. We do try to send them as path
> > requests, but apparently forget to mark them as broadcast messages.
> Hi Ville,
> I also look up the spec but DP_POWER_DOWN_PHY & DP_POWER_UP_PHY seems to be defined as path or node request only. Not broadcast message. Please correct me if I'm wrong here.

Doh. Yeah, you're correct. Not sure what section I was reading earlier
when I came to that conclusion.

> Appreciate for your time!
> >
> > >  else
> > >  hdr->broadcast = 0;
> > > --
> > > 2.17.1
> > >
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> > > s.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=04%7C01%7C
> > > Wayne.Lin%40amd.com%7C372bbed7b5354ca05f5608d8d753533a%7C3dd8961fe4884
> > > e608e11a82d994e183d%7C0%7C0%7C637496100180287539%7CUnknown%7CTWFpbGZsb
> > > 3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%
> > > 7C1000&amp;sdata=2uhm9Nf31hfhf%2FbmwfqYW7b6ay9swWb8oS10Uc%2FVFRQ%3D&am
> > > p;reserved=0
> >
> > --
> > Ville Syrjälä
> > Intel
> Regards,
> Wayne Lin
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 713ef3b42054..6d73559046e5 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1072,6 +1072,7 @@  static void build_clear_payload_id_table(struct drm_dp_sideband_msg_tx *msg)
 
 	req.req_type = DP_CLEAR_PAYLOAD_ID_TABLE;
 	drm_dp_encode_sideband_req(&req, msg);
+	msg->path_msg = true;
 }
 
 static int build_enum_path_resources(struct drm_dp_sideband_msg_tx *msg,
@@ -2722,7 +2723,8 @@  static int set_hdr_from_dst_qlock(struct drm_dp_sideband_msg_hdr *hdr,
 
 	req_type = txmsg->msg[0] & 0x7f;
 	if (req_type == DP_CONNECTION_STATUS_NOTIFY ||
-		req_type == DP_RESOURCE_STATUS_NOTIFY)
+		req_type == DP_RESOURCE_STATUS_NOTIFY ||
+		req_type == DP_CLEAR_PAYLOAD_ID_TABLE)
 		hdr->broadcast = 1;
 	else
 		hdr->broadcast = 0;