drm/dp/mst: deallocate payload on port destruction
authorMykola Lysenko <Mykola.Lysenko@amd.com>
Wed, 27 Jan 2016 14:39:36 +0000 (09:39 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 13 Apr 2016 21:14:25 +0000 (17:14 -0400)
commite159282ea85a27ebeb4d9c4869b41bf192bcf5f8
treee45496452f247bc76faa9c372094af4ba26d9ab3
parent9cc696013c324d36c1ffbc4160d5cdf698ee490b
drm/dp/mst: deallocate payload on port destruction

[ Upstream commit 91a25e463130c8e19bdb42f2d827836c7937992e ]

This is needed to properly deallocate port payload
after downstream branch get unplugged.

In order to do this unplugged MST topology should
be preserved, to find first alive port on path to
unplugged MST topology, and send payload deallocation
request to branch device of found port.

For this mstb and port kref's are used in reversed
order to track when port and branch memory could be
freed.

Added additional functions to find appropriate mstb
as described above.

Signed-off-by: Mykola Lysenko <Mykola.Lysenko@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/gpu/drm/drm_dp_mst_topology.c