]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/sun4i: Fix exclusivity of the TCON clocks
authorOndrej Jirman <megous@megous.com>
Sat, 10 Mar 2018 11:05:11 +0000 (12:05 +0100)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Mon, 12 Mar 2018 09:07:17 +0000 (10:07 +0100)
commit7035046d6d02d455325c5d0328bcc8a0b5dd96b0
tree636eb6ac5d2643b3a16c1856832791cc1e76599b
parentb0655d668fc4faf0c1985e828820f9b9ca13abe6
drm/sun4i: Fix exclusivity of the TCON clocks

Currently the exclusivity is enabled when the rate is set by
the mode setting functions. These functions are called by
mode_set_nofb callback of drm_crc_helper. Then exclusivity
is disabled when tcon is disabled by atomic_disable
callback.

What happens is that mode_set_nofb can be called once when
mode changes, and afterwards the system can call atomic_enable
and atomic_disable multiple times without further calls to
mode_set_nofb.

This happens:

mode_set_nofb   - clk exclusivity is enabled
atomic_enable
atomic_disable  - clk exclusivity is disabled
atomic_enable
atomic_disable  - clk exclusivity is already disabled, leading to WARN
                  in clk_rate_exclusive_put

Solution is to enable exclusivity in sun4i_tcon_channel_set_status.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180310110511.14697-1-megous@megous.com
drivers/gpu/drm/sun4i/sun4i_tcon.c