linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the tip tree (from the drm-intel tree)
@ 2016-07-05  3:53 Stephen Rothwell
  2016-07-05  8:25 ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2016-07-05  3:53 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Peter Zijlstra,
	Daniel Vetter, intel-gfx, dri-devel
  Cc: linux-next, linux-kernel, Chris Wilson

Hi all,

After merging the tip tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

In file included from include/uapi/linux/stddef.h:1:0,
                 from include/linux/stddef.h:4,
                 from include/uapi/linux/posix_types.h:4,
                 from include/uapi/linux/types.h:13,
                 from include/linux/types.h:5,
                 from include/linux/sysrq.h:18,
                 from drivers/gpu/drm/i915/i915_irq.c:31:
drivers/gpu/drm/i915/i915_irq.c: In function 'i915_hangcheck_elapsed':
include/linux/compiler.h:542:50: error: incompatible types when initializing type 'const void * const' using type 'bool {aka _Bool}'
  __maybe_unused const void * const _________p2 = _________p1; \
                                                  ^
drivers/gpu/drm/i915/i915_irq.c:3098:7: note: in expansion of macro 'lockless_dereference'
  if (!lockless_dereference(dev_priv->gt.awake))
       ^

Caused by commit

  67d97da34917 ("drm/i915: Only start retire worker when idle")

from the drm-intel tree interacting with commit

  331b6d8c7afc ("locking/barriers: Validate lockless_dereference() is used on a pointer type")

from the tip tree.

>From include/linux/compiler.h:

  * lockless_dereference() - safely load a pointer for later dereference
  * @p: The pointer to load

It looks like lockless_dererence() has been used incorrectly
in the drm-intel tree commit since its argument must be a
pointer to be dererenced later. The same thing is done in
drivers/gpu/drm/i915/i915_gem.c as well.

I have applied the following hack patch for now, but this needs to be
fixed properly.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 5 Jul 2016 13:44:39 +1000
Subject: [PATCH] drm/i915: hack around bad use of lockless_dereference()

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 +-
 drivers/gpu/drm/i915/i915_irq.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d3502c0603e5..1f91f187b2a8 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3290,7 +3290,7 @@ i915_gem_retire_work_handler(struct work_struct *work)
 	 * We do not need to do this test under locking as in the worst-case
 	 * we queue the retire worker once too often.
 	 */
-	if (lockless_dereference(dev_priv->gt.awake))
+	if (/*lockless_dereference*/(dev_priv->gt.awake))
 		queue_delayed_work(dev_priv->wq,
 				   &dev_priv->gt.retire_work,
 				   round_jiffies_up_relative(HZ));
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index f6de8dd567a2..2c1926418691 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3095,7 +3095,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
 	if (!i915.enable_hangcheck)
 		return;
 
-	if (!lockless_dereference(dev_priv->gt.awake))
+	if (!/*lockless_dereference*/(dev_priv->gt.awake))
 		return;
 
 	/* As enabling the GPU requires fairly extensive mmio access,
-- 
2.8.1




-- 
Cheers,
Stephen Rothwell

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

* Re: linux-next: build failure after merge of the tip tree (from the drm-intel tree)
  2016-07-05  3:53 linux-next: build failure after merge of the tip tree (from the drm-intel tree) Stephen Rothwell
@ 2016-07-05  8:25 ` Peter Zijlstra
  2016-07-05 17:59   ` Paul E. McKenney
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Zijlstra @ 2016-07-05  8:25 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Daniel Vetter,
	intel-gfx, dri-devel, linux-next, linux-kernel, Chris Wilson,
	Paul McKenney

On Tue, Jul 05, 2016 at 01:53:03PM +1000, Stephen Rothwell wrote:
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index d3502c0603e5..1f91f187b2a8 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3290,7 +3290,7 @@ i915_gem_retire_work_handler(struct work_struct *work)
>  	 * We do not need to do this test under locking as in the worst-case
>  	 * we queue the retire worker once too often.
>  	 */
> -	if (lockless_dereference(dev_priv->gt.awake))
> +	if (/*lockless_dereference*/(dev_priv->gt.awake))
>  		queue_delayed_work(dev_priv->wq,
>  				   &dev_priv->gt.retire_work,
>  				   round_jiffies_up_relative(HZ));
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index f6de8dd567a2..2c1926418691 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -3095,7 +3095,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
>  	if (!i915.enable_hangcheck)
>  		return;
>  
> -	if (!lockless_dereference(dev_priv->gt.awake))
> +	if (!/*lockless_dereference*/(dev_priv->gt.awake))
>  		return;
>  
>  	/* As enabling the GPU requires fairly extensive mmio access,

Right, neither case appears to include a data dependency and thus
lockless_dereference() seems misguided.

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

* Re: linux-next: build failure after merge of the tip tree (from the drm-intel tree)
  2016-07-05  8:25 ` Peter Zijlstra
@ 2016-07-05 17:59   ` Paul E. McKenney
  0 siblings, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2016-07-05 17:59 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Stephen Rothwell, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	Daniel Vetter, intel-gfx, dri-devel, linux-next, linux-kernel,
	Chris Wilson

On Tue, Jul 05, 2016 at 10:25:12AM +0200, Peter Zijlstra wrote:
> On Tue, Jul 05, 2016 at 01:53:03PM +1000, Stephen Rothwell wrote:
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index d3502c0603e5..1f91f187b2a8 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -3290,7 +3290,7 @@ i915_gem_retire_work_handler(struct work_struct *work)
> >  	 * We do not need to do this test under locking as in the worst-case
> >  	 * we queue the retire worker once too often.
> >  	 */
> > -	if (lockless_dereference(dev_priv->gt.awake))
> > +	if (/*lockless_dereference*/(dev_priv->gt.awake))
> >  		queue_delayed_work(dev_priv->wq,
> >  				   &dev_priv->gt.retire_work,
> >  				   round_jiffies_up_relative(HZ));
> > diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> > index f6de8dd567a2..2c1926418691 100644
> > --- a/drivers/gpu/drm/i915/i915_irq.c
> > +++ b/drivers/gpu/drm/i915/i915_irq.c
> > @@ -3095,7 +3095,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
> >  	if (!i915.enable_hangcheck)
> >  		return;
> >  
> > -	if (!lockless_dereference(dev_priv->gt.awake))
> > +	if (!/*lockless_dereference*/(dev_priv->gt.awake))
> >  		return;
> >  
> >  	/* As enabling the GPU requires fairly extensive mmio access,
> 
> Right, neither case appears to include a data dependency and thus
> lockless_dereference() seems misguided.

Agreed!  At first glance, this code wants READ_ONCE() rather than
lockless_dereference().

							Thanx, Paul

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

end of thread, other threads:[~2016-07-05 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-05  3:53 linux-next: build failure after merge of the tip tree (from the drm-intel tree) Stephen Rothwell
2016-07-05  8:25 ` Peter Zijlstra
2016-07-05 17:59   ` Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).