OSDN Git Service

drm/nouveau: Fix drm poll_helper handling
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Mon, 15 May 2017 09:04:31 +0000 (12:04 +0300)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 16 May 2017 23:09:41 +0000 (09:09 +1000)
commit9a2eba337cacefc95b97c2726e3efdd435b3460e
treeb28afdd73bdcd14b105f3e5f6a80f0c454868aee
parente4311ee51d1e2676001b2d8fcefd92bdd79aad85
drm/nouveau: Fix drm poll_helper handling

Commit cae9ff036eea effectively disabled the drm poll_helper by checking
the wrong flag to see if the driver should enable the poll or not:
mode_config.poll_enabled is only set to true by poll_init and it is not
indicating if the poll is enabled or not.
nouveau_display_create() will initialize the poll and going to disable it
right away. After poll_init() the mode_config.poll_enabled will be true,
but the poll itself is disabled.

To avoid the race caused by calling the poll_enable() from different paths,
this patch will enable the poll from one place, in the
nouveau_display_hpd_work().

In case the pm_runtime is disabled we will enable the poll in
nouveau_drm_load() once.

Fixes: cae9ff036eea ("drm/nouveau: Don't enabling polling twice on runtime resume")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Lyude <lyude@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_display.c
drivers/gpu/drm/nouveau/nouveau_drm.c