Patch "drm/dp/mst: make sure mst_primary mstb is valid in work function" has been added to the 4.1-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    drm/dp/mst: make sure mst_primary mstb is valid in work function

to the 4.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-dp-mst-make-sure-mst_primary-mstb-is-valid-in-work-function.patch
and it can be found in the queue-4.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 9254ec496a1dbdddeab50021a8138dc627a8166a Mon Sep 17 00:00:00 2001
From: Daniel Vetter <daniel.vetter@xxxxxxxx>
Date: Mon, 22 Jun 2015 17:31:59 +1000
Subject: drm/dp/mst: make sure mst_primary mstb is valid in work function

From: Daniel Vetter <daniel.vetter@xxxxxxxx>

commit 9254ec496a1dbdddeab50021a8138dc627a8166a upstream.

This validates the mst_primary under the lock, and then calls
into the check and send function. This makes the code a lot
easier to understand the locking rules in.

Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx>
Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
Signed-off-by: Dave Airlie <airlied@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/gpu/drm/drm_dp_mst_topology.c |   24 +++++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1200,7 +1200,7 @@ static void drm_dp_check_and_send_link_a
 					       struct drm_dp_mst_branch *mstb)
 {
 	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;
@@ -1215,17 +1215,31 @@ static void drm_dp_check_and_send_link_a
 		if (!port->available_pbn)
 			drm_dp_send_enum_path_resources(mgr, mstb, port);
 
-		if (port->mstb)
-			drm_dp_check_and_send_link_address(mgr, port->mstb);
+		if (port->mstb) {
+			mstb_child = drm_dp_get_validated_mstb_ref(mgr, port->mstb);
+			if (mstb_child) {
+				drm_dp_check_and_send_link_address(mgr, mstb_child);
+				drm_dp_put_mst_branch_device(mstb_child);
+			}
+		}
 	}
 }
 
 static void drm_dp_mst_link_probe_work(struct work_struct *work)
 {
 	struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, work);
+	struct drm_dp_mst_branch *mstb;
 
-	drm_dp_check_and_send_link_address(mgr, mgr->mst_primary);
-
+	mutex_lock(&mgr->lock);
+	mstb = mgr->mst_primary;
+	if (mstb) {
+		kref_get(&mstb->kref);
+	}
+	mutex_unlock(&mgr->lock);
+	if (mstb) {
+		drm_dp_check_and_send_link_address(mgr, mstb);
+		drm_dp_put_mst_branch_device(mstb);
+	}
 }
 
 static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr,


Patches currently in stable-queue which might be from daniel.vetter@xxxxxxxx are

queue-4.1/drm-vgem-set-unique-to-vgem.patch
queue-4.1/drm-dp-mst-take-lock-around-looking-up-the-branch-device-on-hpd-irq.patch
queue-4.1/drm-i915-declare-the-swizzling-unknown-for-l-shaped-configurations.patch
queue-4.1/drm-dp-mst-make-sure-mst_primary-mstb-is-valid-in-work-function.patch
queue-4.1/drm-provide-compat-ioctl-for-addfb2.1.patch
queue-4.1/drm-atomic-fix-out-of-bounds-read-in-for_each_-_in_state-helpers.patch
queue-4.1/revert-drm-i915-declare-the-swizzling-unknown-for-l-shaped-configurations.patch
queue-4.1/drm-i915-forward-all-core-drm-ioctls-to-core-compat-handling.patch
queue-4.1/drm-stop-resetting-connector-state-to-unknown.patch
queue-4.1/drm-i915-snapshot-seqno-of-most-recently-submitted-request.patch
queue-4.1/drm-i915-use-two-32bit-reads-for-select-64bit-reg_read-ioctls.patch
queue-4.1/drm-rockchip-use-drm_gem_mmap-helpers.patch
queue-4.1/drm-dp-mst-close-deadlock-in-connector-destruction.patch
queue-4.1/drm-add-a-check-for-x-y-in-drm_mode_setcrtc.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]