All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Revert "drm/fb-helper: Reduce READ_ONCE(master) to lockless_dereference"
@ 2016-08-11  9:50 Johannes Berg
  2016-08-11  9:50 ` [PATCH 2/2] locking/barriers: suppress sparse warnings in lockless_dereference() Johannes Berg
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Johannes Berg @ 2016-08-11  9:50 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Paul E . McKenney, Ingo Molnar, Chris Wilson,
	Daniel Vetter, dri-devel, intel-gfx, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

This reverts commit fa7d81bb3c269a2ee38b6e4d569d9eb8be1a78ad.

As Peter explained:
  [...] lockless_dereference() is _stronger_ than READ_ONCE(), not weaker.

  [...]

  Also, clue is in the name: 'dereference', you don't actually dereference
  the pointer here, only load it.

My next patch breaks compile on this, because it assumes you want to
deference and thus also need the struct type visible (which it isn't
here), so revert it.

Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/gpu/drm/drm_fb_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index ce54e985d91b..0a06f9120b5a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -464,7 +464,7 @@ static bool drm_fb_helper_is_bound(struct drm_fb_helper *fb_helper)
 
 	/* Sometimes user space wants everything disabled, so don't steal the
 	 * display if there's a master. */
-	if (lockless_dereference(dev->master))
+	if (READ_ONCE(dev->master))
 		return false;
 
 	drm_for_each_crtc(crtc, dev) {
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-08-18 13:48 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-11  9:50 [PATCH 1/2] Revert "drm/fb-helper: Reduce READ_ONCE(master) to lockless_dereference" Johannes Berg
2016-08-11  9:50 ` [PATCH 2/2] locking/barriers: suppress sparse warnings in lockless_dereference() Johannes Berg
2016-08-18 11:00   ` [tip:locking/core] locking/barriers: Suppress " tip-bot for Johannes Berg
2016-08-18 13:40   ` [tip:locking/urgent] " tip-bot for Johannes Berg
2016-08-11 10:38 ` [PATCH 1/2] Revert "drm/fb-helper: Reduce READ_ONCE(master) to lockless_dereference" Daniel Vetter
2016-08-11 10:38   ` Daniel Vetter
2016-08-11 18:26   ` Paul E. McKenney
2016-08-11 18:26     ` Paul E. McKenney
2016-08-12  6:05     ` Johannes Berg
2016-08-12  6:05       ` Johannes Berg
2016-08-12 18:25     ` Peter Zijlstra
2016-08-12 19:15       ` Paul E. McKenney
2016-08-12 19:15         ` Paul E. McKenney
2016-08-11 11:29 ` ✗ Ro.CI.BAT: failure for series starting with [1/2] " Patchwork
2016-08-18 10:59 ` [tip:locking/core] " tip-bot for Johannes Berg
2016-08-18 13:40 ` [tip:locking/urgent] " tip-bot for Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.