drm/nouveau: do not touch a powered-down card This fixes https://bugs.freedesktop.org/show_bug.cgi?id=34430, where a process (upowerd) would cause 100% CPU usage simply by trying to check whether there is anything connected to the VGA connector. Signed-off-by: Robert Varga diff -u a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c --- a/drivers/gpu/drm/nouveau/nv50_display.c 2013-05-27 14:47:21.320111385 +0200 +++ b/drivers/gpu/drm/nouveau/nv50_display.c 2013-05-27 17:53:18.590174600 +0200 @@ -1556,6 +1556,10 @@ int ret, or = nouveau_encoder(encoder)->or; u32 load = 0; + // Do not touch the hardware when the card is powered off + if (encoder->dev->switch_power_state != DRM_SWITCH_POWER_ON) + return connector_status_unknown; + ret = nv_exec(disp->core, NV50_DISP_DAC_LOAD + or, &load, sizeof(load)); if (ret || load != 7) return connector_status_disconnected;