dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH] drm/mst: update the link_address_sent before sending the link address
Date: Sat,  5 Sep 2015 17:44:13 +1000	[thread overview]
Message-ID: <1441439053-1315-1-git-send-email-airlied@gmail.com> (raw)

There is a race where the reply could get processed by another
work queue before we've updated the state.

Update the state before sending the msg to close it.

Pointed out by Adam J Richter on

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91481
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index e23df5f..18c2a74 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1106,8 +1106,8 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb,
 
 		ret = drm_dp_port_setup_pdt(port);
 		if (ret == true) {
-			drm_dp_send_link_address(mstb->mgr, port->mstb);
 			port->mstb->link_address_sent = true;
+			drm_dp_send_link_address(mstb->mgr, port->mstb);
 		}
 	}
 
@@ -1203,8 +1203,8 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m
 	struct drm_dp_mst_port *port;
 	struct drm_dp_mst_branch *mstb_child;
 	if (!mstb->link_address_sent) {
-		drm_dp_send_link_address(mgr, mstb);
 		mstb->link_address_sent = true;
+		drm_dp_send_link_address(mgr, mstb);
 	}
 	list_for_each_entry(port, &mstb->ports, next) {
 		if (port->input)
-- 
2.4.3

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

                 reply	other threads:[~2015-09-05  7:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441439053-1315-1-git-send-email-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox