Re: [PATCH 2/2] drm/dp/mst: always send reply for UP request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 19 December 2015 at 08:14, Harry Wentland <harry.wentland@xxxxxxx> wrote:
> From: Mykola Lysenko <Mykola.Lysenko@xxxxxxx>
>
> We should always send reply for UP request in order
> to make downstream device clean-up resources appropriately.
>
> Issue was that reply for UP request was sent only once.

What happens though if the up reply is too big and needs to be cut into pieces,

Since the return value of process_single_tx_qlock is
-value - errno.
0 - part of msg sent
1 - all of msg sent

Does the attached patch make any difference?

It handles the queue like the down queue.

Dave.
From 5e731acaca9d58bc9fba8d34334ace09cfff04ea Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@xxxxxxxxxx>
Date: Sat, 19 Dec 2015 13:50:56 +1000
Subject: [PATCH] drm/dp/mst: check up transmission queue in transmitter work
 function.

This checks the up transmission.

Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 64a0a37..fdc3216 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1448,6 +1448,7 @@ static void process_single_up_tx_qlock(struct drm_dp_mst_topology_mgr *mgr)
 		mgr->tx_up_in_progress = false;
 		return;
 	}
+	mgr->tx_up_in_progress = true;
 
 	txmsg = list_first_entry(&mgr->tx_msg_upq, struct drm_dp_sideband_msg_tx, next);
 	ret = process_single_tx_qlock(mgr, txmsg, true);
@@ -1457,7 +1458,8 @@ static void process_single_up_tx_qlock(struct drm_dp_mst_topology_mgr *mgr)
 		kfree(txmsg);
 	} else if (ret)
 		DRM_DEBUG_KMS("failed to send msg in q %d\n", ret);
-	mgr->tx_up_in_progress = true;
+	if (list_empty(&mgr->tx_msg_upq))
+		mgr->tx_up_in_progress = false;
 }
 
 static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr,
@@ -2680,6 +2682,8 @@ static void drm_dp_tx_work(struct work_struct *work)
 	mutex_lock(&mgr->qlock);
 	if (mgr->tx_down_in_progress)
 		process_single_down_tx_qlock(mgr);
+	if (mgr->tx_up_in_progress)
+		process_single_up_tx_qlock(mgr);
 	mutex_unlock(&mgr->qlock);
 }
 
-- 
2.5.0

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

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux