Skip to content

Commit

Permalink
drm: Convert cmpxchg(bool) back to a two step operation
Browse files Browse the repository at this point in the history
ARM v6 (at least) only allows cmpxchg on 32bit variables which doesn't
always include the bool type.

drivers/built-in.o: In function `vblank_disable_and_save':
imx-ocotp.c:(.text+0xb45e8): undefined reference to `__bad_cmpxchg'
Makefile:986: recipe for target 'vmlinux' failed

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Leonard Crestez <leonard.crestez@nxp.com>
Fixes: 43dc7fe ("drm: Mark up accesses of vblank->enabled outside of its spinlock")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170330140832.32377-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson authored and Ville Syrjälä committed Mar 30, 2017
1 parent f56c920 commit f5f4c61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,10 @@ static void vblank_disable_and_save(struct drm_device *dev, unsigned int pipe)
* calling the ->disable_vblank() operation in atomic context with the
* hardware potentially runtime suspended.
*/
if (cmpxchg_relaxed(&vblank->enabled, true, false))
if (vblank->enabled) {
__disable_vblank(dev, pipe);
vblank->enabled = false;
}

/*
* Always update the count and timestamp to maintain the
Expand Down

0 comments on commit f5f4c61

Please sign in to comment.