aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2018-09-14 16:44:03 -0400
committerBen Skeggs <bskeggs@redhat.com>2018-10-05 02:43:15 -0400
commite46368cf77f2cb6304c51d9ff5f147cfb7dc0074 (patch)
treed6780c58593e2973fb528ce8af5a33b41eeb2549
parent3483f08106fcd0e8edad2b9f2fc4726d25177799 (diff)
drm/nouveau/drm/nouveau: Grab runtime PM ref in nv50_mstc_detect()
While we currently grab a runtime PM ref in nouveau's normal connector detection code, we apparently don't do this for MST. This means if we're in a scenario where the GPU is suspended and userspace attempts to do a connector probe on an MSTC connector, the probe will fail entirely due to the DP aux channel and GPU not being woken up: [ 316.633489] nouveau 0000:01:00.0: i2c: aux 000a: begin idle timeout ffffffff [ 316.635713] nouveau 0000:01:00.0: i2c: aux 000a: begin idle timeout ffffffff [ 316.637785] nouveau 0000:01:00.0: i2c: aux 000a: begin idle timeout ffffffff ... So, grab a runtime PM ref here. Signed-off-by: Lyude Paul <lyude@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Karol Herbst <kherbst@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/dispnv50/disp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 5691dfa1db6f..041e7daf8a33 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -900,9 +900,22 @@ static enum drm_connector_status
900nv50_mstc_detect(struct drm_connector *connector, bool force) 900nv50_mstc_detect(struct drm_connector *connector, bool force)
901{ 901{
902 struct nv50_mstc *mstc = nv50_mstc(connector); 902 struct nv50_mstc *mstc = nv50_mstc(connector);
903 enum drm_connector_status conn_status;
904 int ret;
905
903 if (!mstc->port) 906 if (!mstc->port)
904 return connector_status_disconnected; 907 return connector_status_disconnected;
905 return drm_dp_mst_detect_port(connector, mstc->port->mgr, mstc->port); 908
909 ret = pm_runtime_get_sync(connector->dev->dev);
910 if (ret < 0 && ret != -EACCES)
911 return connector_status_disconnected;
912
913 conn_status = drm_dp_mst_detect_port(connector, mstc->port->mgr,
914 mstc->port);
915
916 pm_runtime_mark_last_busy(connector->dev->dev);
917 pm_runtime_put_autosuspend(connector->dev->dev);
918 return conn_status;
906} 919}
907 920
908static void 921static void