summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLyude Paul <lyude@redhat.com>2018-09-14 16:44:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-18 09:18:19 +0200
commit7088776eb06a8000c1a6360ccd47d6925ad0120d (patch)
tree26d9c7834d97d9e9530bcc4b190b2721d3c3da2e /drivers
parentca45da09bc32fd1241fde1fa1e3b30dde48823e1 (diff)
downloadlinux-stable-7088776eb06a8000c1a6360ccd47d6925ad0120d.tar.gz
linux-stable-7088776eb06a8000c1a6360ccd47d6925ad0120d.tar.bz2
linux-stable-7088776eb06a8000c1a6360ccd47d6925ad0120d.zip
drm/nouveau/drm/nouveau: Grab runtime PM ref in nv50_mstc_detect()
commit e46368cf77f2cb6304c51d9ff5f147cfb7dc0074 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-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 7a12d75e5157..c3c8c84da113 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -875,9 +875,22 @@ static enum drm_connector_status
nv50_mstc_detect(struct drm_connector *connector, bool force)
{
struct nv50_mstc *mstc = nv50_mstc(connector);
+ enum drm_connector_status conn_status;
+ int ret;
+
if (!mstc->port)
return connector_status_disconnected;
- return drm_dp_mst_detect_port(connector, mstc->port->mgr, mstc->port);
+
+ ret = pm_runtime_get_sync(connector->dev->dev);
+ if (ret < 0 && ret != -EACCES)
+ return connector_status_disconnected;
+
+ conn_status = drm_dp_mst_detect_port(connector, mstc->port->mgr,
+ mstc->port);
+
+ pm_runtime_mark_last_busy(connector->dev->dev);
+ pm_runtime_put_autosuspend(connector->dev->dev);
+ return conn_status;
}
static void