aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-06-22 14:40:44 +1000
committerDave Airlie <airlied@redhat.com>2015-06-23 10:32:12 +1000
commit9eb1e57f564d4e6e10991402726cc83fe0b9172f (patch)
treeabe327d3a99e89347d22bcc5c61958fd915f70f2 /drivers/gpu
parentdrm/dp/mst: make sure mst_primary mstb is valid in work function (diff)
downloadlinux-dev-9eb1e57f564d4e6e10991402726cc83fe0b9172f.tar.xz
linux-dev-9eb1e57f564d4e6e10991402726cc83fe0b9172f.zip
drm/dp/mst: take lock around looking up the branch device on hpd irq
If we are doing an MST transaction and we've gotten HPD and we lookup the device from the incoming msg, we should take the mgr lock around it, so that mst_primary and mstb->ports are valid. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_dp_mst_topology.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index 1c9670665281..f7213497ad6c 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1163,6 +1163,8 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_
struct drm_dp_mst_port *port;
int i;
/* find the port by iterating down */
+
+ mutex_lock(&mgr->lock);
mstb = mgr->mst_primary;
for (i = 0; i < lct - 1; i++) {
@@ -1182,6 +1184,7 @@ static struct drm_dp_mst_branch *drm_dp_get_mst_branch_device(struct drm_dp_mst_
}
}
kref_get(&mstb->kref);
+ mutex_unlock(&mgr->lock);
return mstb;
}