linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the drm-misc tree
@ 2019-04-01 23:50 Stephen Rothwell
  2019-04-02  5:55 ` Qiang Yu
  2019-04-02 11:21 ` Matthew Wilcox
  0 siblings, 2 replies; 11+ messages in thread
From: Stephen Rothwell @ 2019-04-01 23:50 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics, DRI
  Cc: Linux Next Mailing List, Linux Kernel Mailing List,
	Matthew Wilcox, Qiang Yu


[-- Attachment #1.1: Type: text/plain, Size: 3232 bytes --]

Hi all,

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

In file included from include/linux/kernel.h:7,
                 from include/asm-generic/bug.h:18,
                 from arch/x86/include/asm/bug.h:83,
                 from include/linux/bug.h:5,
                 from include/linux/mmdebug.h:5,
                 from include/linux/gfp.h:5,
                 from include/linux/slab.h:15,
                 from drivers/gpu/drm/lima/lima_ctx.c:4:
drivers/gpu/drm/lima/lima_ctx.c: In function 'lima_ctx_create':
include/linux/limits.h:13:18: warning: passing argument 3 of 'xa_alloc' makes pointer from integer without a cast [-Wint-conversion]
 #define UINT_MAX (~0U)
                  ^~~~~
drivers/gpu/drm/lima/lima_ctx.c:26:36: note: in expansion of macro 'UINT_MAX'
  err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
                                    ^~~~~~~~
In file included from include/linux/radix-tree.h:31,
                 from include/linux/idr.h:15,
                 from include/drm/drm_device.h:7,
                 from drivers/gpu/drm/lima/lima_device.h:7,
                 from drivers/gpu/drm/lima/lima_ctx.c:6:
include/linux/xarray.h:817:9: note: expected 'void *' but argument is of type 'unsigned int'
   void *entry, struct xa_limit limit, gfp_t gfp)
   ~~~~~~^~~~~
drivers/gpu/drm/lima/lima_ctx.c:26:46: error: incompatible type for argument 4 of 'xa_alloc'
  err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
                                              ^~~
In file included from include/linux/radix-tree.h:31,
                 from include/linux/idr.h:15,
                 from include/drm/drm_device.h:7,
                 from drivers/gpu/drm/lima/lima_device.h:7,
                 from drivers/gpu/drm/lima/lima_ctx.c:6:
include/linux/xarray.h:817:32: note: expected 'struct xa_limit' but argument is of type 'struct lima_ctx *'
   void *entry, struct xa_limit limit, gfp_t gfp)
                ~~~~~~~~~~~~~~~~^~~~~

Caused by commit

  a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")

interacting with commit

  a3e4d3f97ec8 ("XArray: Redesign xa_alloc API")

from Linus' tree (v5.1-rc1).

I have applied the following patch for today.  It could be applied as
part of a merge of v5.1-rc1 into drm-misc.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 2 Apr 2019 10:45:32 +1100
Subject: [PATCH] drm/lima: update for xa_alloc API change

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/gpu/drm/lima/lima_ctx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c
index c8d12f7c6894..bafa00d74cc5 100644
--- a/drivers/gpu/drm/lima/lima_ctx.c
+++ b/drivers/gpu/drm/lima/lima_ctx.c
@@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
 			goto err_out0;
 	}
 
-	err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
+	err = xa_alloc(&mgr->handles, id, ctx, XA_LIMIT(*id, UINT_MAX), GFP_KERNEL);
 	if (err < 0)
 		goto err_out0;
 
-- 
2.20.1

-- 
Cheers,
Stephen Rothwell

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-01 23:50 linux-next: build failure after merge of the drm-misc tree Stephen Rothwell
@ 2019-04-02  5:55 ` Qiang Yu
  2019-04-02  7:57   ` Daniel Vetter
  2019-04-02 11:26   ` Matthew Wilcox
  2019-04-02 11:21 ` Matthew Wilcox
  1 sibling, 2 replies; 11+ messages in thread
From: Qiang Yu @ 2019-04-02  5:55 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Daniel Vetter, Intel Graphics, DRI, Linux Next Mailing List,
	Linux Kernel Mailing List, Eric Anholt, Matthew Wilcox

Thanks, patch is:
Reviewed-by: Qiang Yu <yuq825@gmail.com>

Regards,
Qiang

On Tue, Apr 2, 2019 at 7:50 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> After merging the drm-misc tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
>
> In file included from include/linux/kernel.h:7,
>                  from include/asm-generic/bug.h:18,
>                  from arch/x86/include/asm/bug.h:83,
>                  from include/linux/bug.h:5,
>                  from include/linux/mmdebug.h:5,
>                  from include/linux/gfp.h:5,
>                  from include/linux/slab.h:15,
>                  from drivers/gpu/drm/lima/lima_ctx.c:4:
> drivers/gpu/drm/lima/lima_ctx.c: In function 'lima_ctx_create':
> include/linux/limits.h:13:18: warning: passing argument 3 of 'xa_alloc' makes pointer from integer without a cast [-Wint-conversion]
>  #define UINT_MAX (~0U)
>                   ^~~~~
> drivers/gpu/drm/lima/lima_ctx.c:26:36: note: in expansion of macro 'UINT_MAX'
>   err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
>                                     ^~~~~~~~
> In file included from include/linux/radix-tree.h:31,
>                  from include/linux/idr.h:15,
>                  from include/drm/drm_device.h:7,
>                  from drivers/gpu/drm/lima/lima_device.h:7,
>                  from drivers/gpu/drm/lima/lima_ctx.c:6:
> include/linux/xarray.h:817:9: note: expected 'void *' but argument is of type 'unsigned int'
>    void *entry, struct xa_limit limit, gfp_t gfp)
>    ~~~~~~^~~~~
> drivers/gpu/drm/lima/lima_ctx.c:26:46: error: incompatible type for argument 4 of 'xa_alloc'
>   err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
>                                               ^~~
> In file included from include/linux/radix-tree.h:31,
>                  from include/linux/idr.h:15,
>                  from include/drm/drm_device.h:7,
>                  from drivers/gpu/drm/lima/lima_device.h:7,
>                  from drivers/gpu/drm/lima/lima_ctx.c:6:
> include/linux/xarray.h:817:32: note: expected 'struct xa_limit' but argument is of type 'struct lima_ctx *'
>    void *entry, struct xa_limit limit, gfp_t gfp)
>                 ~~~~~~~~~~~~~~~~^~~~~
>
> Caused by commit
>
>   a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")
>
> interacting with commit
>
>   a3e4d3f97ec8 ("XArray: Redesign xa_alloc API")
>
> from Linus' tree (v5.1-rc1).
>
> I have applied the following patch for today.  It could be applied as
> part of a merge of v5.1-rc1 into drm-misc.
>
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 2 Apr 2019 10:45:32 +1100
> Subject: [PATCH] drm/lima: update for xa_alloc API change
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/gpu/drm/lima/lima_ctx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c
> index c8d12f7c6894..bafa00d74cc5 100644
> --- a/drivers/gpu/drm/lima/lima_ctx.c
> +++ b/drivers/gpu/drm/lima/lima_ctx.c
> @@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
>                         goto err_out0;
>         }
>
> -       err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> +       err = xa_alloc(&mgr->handles, id, ctx, XA_LIMIT(*id, UINT_MAX), GFP_KERNEL);
>         if (err < 0)
>                 goto err_out0;
>
> --
> 2.20.1
>
> --
> Cheers,
> Stephen Rothwell

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-02  5:55 ` Qiang Yu
@ 2019-04-02  7:57   ` Daniel Vetter
  2019-04-02  8:59     ` Qiang Yu
  2019-04-02 11:26   ` Matthew Wilcox
  1 sibling, 1 reply; 11+ messages in thread
From: Daniel Vetter @ 2019-04-02  7:57 UTC (permalink / raw)
  To: Qiang Yu
  Cc: Stephen Rothwell, Daniel Vetter, Intel Graphics, DRI,
	Linux Next Mailing List, Linux Kernel Mailing List, Eric Anholt,
	Matthew Wilcox

On Tue, Apr 02, 2019 at 01:55:03PM +0800, Qiang Yu wrote:
> Thanks, patch is:
> Reviewed-by: Qiang Yu <yuq825@gmail.com>

Good time to get started with committing patches? In general it's kinda
confusing if the maintainer r-bs a patch, but doesn't say whether/when/how
it gets merged. Big chance the patch will get lost in limbo and fall
through cracks.
-Daniel

> 
> Regards,
> Qiang
> 
> On Tue, Apr 2, 2019 at 7:50 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Hi all,
> >
> > After merging the drm-misc tree, today's linux-next build (x86_64
> > allmodconfig) failed like this:
> >
> > In file included from include/linux/kernel.h:7,
> >                  from include/asm-generic/bug.h:18,
> >                  from arch/x86/include/asm/bug.h:83,
> >                  from include/linux/bug.h:5,
> >                  from include/linux/mmdebug.h:5,
> >                  from include/linux/gfp.h:5,
> >                  from include/linux/slab.h:15,
> >                  from drivers/gpu/drm/lima/lima_ctx.c:4:
> > drivers/gpu/drm/lima/lima_ctx.c: In function 'lima_ctx_create':
> > include/linux/limits.h:13:18: warning: passing argument 3 of 'xa_alloc' makes pointer from integer without a cast [-Wint-conversion]
> >  #define UINT_MAX (~0U)
> >                   ^~~~~
> > drivers/gpu/drm/lima/lima_ctx.c:26:36: note: in expansion of macro 'UINT_MAX'
> >   err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> >                                     ^~~~~~~~
> > In file included from include/linux/radix-tree.h:31,
> >                  from include/linux/idr.h:15,
> >                  from include/drm/drm_device.h:7,
> >                  from drivers/gpu/drm/lima/lima_device.h:7,
> >                  from drivers/gpu/drm/lima/lima_ctx.c:6:
> > include/linux/xarray.h:817:9: note: expected 'void *' but argument is of type 'unsigned int'
> >    void *entry, struct xa_limit limit, gfp_t gfp)
> >    ~~~~~~^~~~~
> > drivers/gpu/drm/lima/lima_ctx.c:26:46: error: incompatible type for argument 4 of 'xa_alloc'
> >   err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> >                                               ^~~
> > In file included from include/linux/radix-tree.h:31,
> >                  from include/linux/idr.h:15,
> >                  from include/drm/drm_device.h:7,
> >                  from drivers/gpu/drm/lima/lima_device.h:7,
> >                  from drivers/gpu/drm/lima/lima_ctx.c:6:
> > include/linux/xarray.h:817:32: note: expected 'struct xa_limit' but argument is of type 'struct lima_ctx *'
> >    void *entry, struct xa_limit limit, gfp_t gfp)
> >                 ~~~~~~~~~~~~~~~~^~~~~
> >
> > Caused by commit
> >
> >   a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")
> >
> > interacting with commit
> >
> >   a3e4d3f97ec8 ("XArray: Redesign xa_alloc API")
> >
> > from Linus' tree (v5.1-rc1).
> >
> > I have applied the following patch for today.  It could be applied as
> > part of a merge of v5.1-rc1 into drm-misc.
> >
> > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > Date: Tue, 2 Apr 2019 10:45:32 +1100
> > Subject: [PATCH] drm/lima: update for xa_alloc API change
> >
> > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > ---
> >  drivers/gpu/drm/lima/lima_ctx.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c
> > index c8d12f7c6894..bafa00d74cc5 100644
> > --- a/drivers/gpu/drm/lima/lima_ctx.c
> > +++ b/drivers/gpu/drm/lima/lima_ctx.c
> > @@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
> >                         goto err_out0;
> >         }
> >
> > -       err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> > +       err = xa_alloc(&mgr->handles, id, ctx, XA_LIMIT(*id, UINT_MAX), GFP_KERNEL);
> >         if (err < 0)
> >                 goto err_out0;
> >
> > --
> > 2.20.1
> >
> > --
> > Cheers,
> > Stephen Rothwell

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-02  7:57   ` Daniel Vetter
@ 2019-04-02  8:59     ` Qiang Yu
  2019-04-02  9:08       ` Daniel Vetter
  0 siblings, 1 reply; 11+ messages in thread
From: Qiang Yu @ 2019-04-02  8:59 UTC (permalink / raw)
  To: Qiang Yu, Stephen Rothwell, Intel Graphics, DRI,
	Linux Next Mailing List, Linux Kernel Mailing List, Eric Anholt,
	Matthew Wilcox
  Cc: Daniel Vetter

On Tue, Apr 2, 2019 at 3:57 PM Daniel Vetter <daniel@ffwll.ch> wrote:
>
> On Tue, Apr 02, 2019 at 01:55:03PM +0800, Qiang Yu wrote:
> > Thanks, patch is:
> > Reviewed-by: Qiang Yu <yuq825@gmail.com>
>
> Good time to get started with committing patches? In general it's kinda
> confusing if the maintainer r-bs a patch, but doesn't say whether/when/how
> it gets merged. Big chance the patch will get lost in limbo and fall
> through cracks.

Thanks for the remind, this patch should only be applied to drm-misc-next
branch when 5.1-rcx branch gets merged to drm-misc-next for the new
xa_alloc API. So I expect the guy who do the 5.1-rcx merge should apply
this patch. Who will do the merge?

Regards,
Qiang

>
> >
> > Regards,
> > Qiang
> >
> > On Tue, Apr 2, 2019 at 7:50 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > >
> > > Hi all,
> > >
> > > After merging the drm-misc tree, today's linux-next build (x86_64
> > > allmodconfig) failed like this:
> > >
> > > In file included from include/linux/kernel.h:7,
> > >                  from include/asm-generic/bug.h:18,
> > >                  from arch/x86/include/asm/bug.h:83,
> > >                  from include/linux/bug.h:5,
> > >                  from include/linux/mmdebug.h:5,
> > >                  from include/linux/gfp.h:5,
> > >                  from include/linux/slab.h:15,
> > >                  from drivers/gpu/drm/lima/lima_ctx.c:4:
> > > drivers/gpu/drm/lima/lima_ctx.c: In function 'lima_ctx_create':
> > > include/linux/limits.h:13:18: warning: passing argument 3 of 'xa_alloc' makes pointer from integer without a cast [-Wint-conversion]
> > >  #define UINT_MAX (~0U)
> > >                   ^~~~~
> > > drivers/gpu/drm/lima/lima_ctx.c:26:36: note: in expansion of macro 'UINT_MAX'
> > >   err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> > >                                     ^~~~~~~~
> > > In file included from include/linux/radix-tree.h:31,
> > >                  from include/linux/idr.h:15,
> > >                  from include/drm/drm_device.h:7,
> > >                  from drivers/gpu/drm/lima/lima_device.h:7,
> > >                  from drivers/gpu/drm/lima/lima_ctx.c:6:
> > > include/linux/xarray.h:817:9: note: expected 'void *' but argument is of type 'unsigned int'
> > >    void *entry, struct xa_limit limit, gfp_t gfp)
> > >    ~~~~~~^~~~~
> > > drivers/gpu/drm/lima/lima_ctx.c:26:46: error: incompatible type for argument 4 of 'xa_alloc'
> > >   err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> > >                                               ^~~
> > > In file included from include/linux/radix-tree.h:31,
> > >                  from include/linux/idr.h:15,
> > >                  from include/drm/drm_device.h:7,
> > >                  from drivers/gpu/drm/lima/lima_device.h:7,
> > >                  from drivers/gpu/drm/lima/lima_ctx.c:6:
> > > include/linux/xarray.h:817:32: note: expected 'struct xa_limit' but argument is of type 'struct lima_ctx *'
> > >    void *entry, struct xa_limit limit, gfp_t gfp)
> > >                 ~~~~~~~~~~~~~~~~^~~~~
> > >
> > > Caused by commit
> > >
> > >   a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")
> > >
> > > interacting with commit
> > >
> > >   a3e4d3f97ec8 ("XArray: Redesign xa_alloc API")
> > >
> > > from Linus' tree (v5.1-rc1).
> > >
> > > I have applied the following patch for today.  It could be applied as
> > > part of a merge of v5.1-rc1 into drm-misc.
> > >
> > > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > > Date: Tue, 2 Apr 2019 10:45:32 +1100
> > > Subject: [PATCH] drm/lima: update for xa_alloc API change
> > >
> > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > ---
> > >  drivers/gpu/drm/lima/lima_ctx.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c
> > > index c8d12f7c6894..bafa00d74cc5 100644
> > > --- a/drivers/gpu/drm/lima/lima_ctx.c
> > > +++ b/drivers/gpu/drm/lima/lima_ctx.c
> > > @@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
> > >                         goto err_out0;
> > >         }
> > >
> > > -       err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> > > +       err = xa_alloc(&mgr->handles, id, ctx, XA_LIMIT(*id, UINT_MAX), GFP_KERNEL);
> > >         if (err < 0)
> > >                 goto err_out0;
> > >
> > > --
> > > 2.20.1
> > >
> > > --
> > > Cheers,
> > > Stephen Rothwell
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-02  8:59     ` Qiang Yu
@ 2019-04-02  9:08       ` Daniel Vetter
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Vetter @ 2019-04-02  9:08 UTC (permalink / raw)
  To: Qiang Yu
  Cc: Stephen Rothwell, Daniel Vetter, Intel Graphics,
	Linux Kernel Mailing List, DRI, Linux Next Mailing List,
	Matthew Wilcox

On Tue, Apr 02, 2019 at 04:59:37PM +0800, Qiang Yu wrote:
> On Tue, Apr 2, 2019 at 3:57 PM Daniel Vetter <daniel@ffwll.ch> wrote:
> >
> > On Tue, Apr 02, 2019 at 01:55:03PM +0800, Qiang Yu wrote:
> > > Thanks, patch is:
> > > Reviewed-by: Qiang Yu <yuq825@gmail.com>
> >
> > Good time to get started with committing patches? In general it's kinda
> > confusing if the maintainer r-bs a patch, but doesn't say whether/when/how
> > it gets merged. Big chance the patch will get lost in limbo and fall
> > through cracks.
> 
> Thanks for the remind, this patch should only be applied to drm-misc-next
> branch when 5.1-rcx branch gets merged to drm-misc-next for the new
> xa_alloc API. So I expect the guy who do the 5.1-rcx merge should apply
> this patch. Who will do the merge?

Oh right, I was kinda not yet awake :-)

Yeah Dave/me and drm-misc maintainers will resolve this when drm-misc
lands in drm-next. Might then need a backmerge in drm-misc to roll
forward.
-Daniel

> 
> Regards,
> Qiang
> 
> >
> > >
> > > Regards,
> > > Qiang
> > >
> > > On Tue, Apr 2, 2019 at 7:50 AM Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > > >
> > > > Hi all,
> > > >
> > > > After merging the drm-misc tree, today's linux-next build (x86_64
> > > > allmodconfig) failed like this:
> > > >
> > > > In file included from include/linux/kernel.h:7,
> > > >                  from include/asm-generic/bug.h:18,
> > > >                  from arch/x86/include/asm/bug.h:83,
> > > >                  from include/linux/bug.h:5,
> > > >                  from include/linux/mmdebug.h:5,
> > > >                  from include/linux/gfp.h:5,
> > > >                  from include/linux/slab.h:15,
> > > >                  from drivers/gpu/drm/lima/lima_ctx.c:4:
> > > > drivers/gpu/drm/lima/lima_ctx.c: In function 'lima_ctx_create':
> > > > include/linux/limits.h:13:18: warning: passing argument 3 of 'xa_alloc' makes pointer from integer without a cast [-Wint-conversion]
> > > >  #define UINT_MAX (~0U)
> > > >                   ^~~~~
> > > > drivers/gpu/drm/lima/lima_ctx.c:26:36: note: in expansion of macro 'UINT_MAX'
> > > >   err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> > > >                                     ^~~~~~~~
> > > > In file included from include/linux/radix-tree.h:31,
> > > >                  from include/linux/idr.h:15,
> > > >                  from include/drm/drm_device.h:7,
> > > >                  from drivers/gpu/drm/lima/lima_device.h:7,
> > > >                  from drivers/gpu/drm/lima/lima_ctx.c:6:
> > > > include/linux/xarray.h:817:9: note: expected 'void *' but argument is of type 'unsigned int'
> > > >    void *entry, struct xa_limit limit, gfp_t gfp)
> > > >    ~~~~~~^~~~~
> > > > drivers/gpu/drm/lima/lima_ctx.c:26:46: error: incompatible type for argument 4 of 'xa_alloc'
> > > >   err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> > > >                                               ^~~
> > > > In file included from include/linux/radix-tree.h:31,
> > > >                  from include/linux/idr.h:15,
> > > >                  from include/drm/drm_device.h:7,
> > > >                  from drivers/gpu/drm/lima/lima_device.h:7,
> > > >                  from drivers/gpu/drm/lima/lima_ctx.c:6:
> > > > include/linux/xarray.h:817:32: note: expected 'struct xa_limit' but argument is of type 'struct lima_ctx *'
> > > >    void *entry, struct xa_limit limit, gfp_t gfp)
> > > >                 ~~~~~~~~~~~~~~~~^~~~~
> > > >
> > > > Caused by commit
> > > >
> > > >   a1d2a6339961 ("drm/lima: driver for ARM Mali4xx GPUs")
> > > >
> > > > interacting with commit
> > > >
> > > >   a3e4d3f97ec8 ("XArray: Redesign xa_alloc API")
> > > >
> > > > from Linus' tree (v5.1-rc1).
> > > >
> > > > I have applied the following patch for today.  It could be applied as
> > > > part of a merge of v5.1-rc1 into drm-misc.
> > > >
> > > > From: Stephen Rothwell <sfr@canb.auug.org.au>
> > > > Date: Tue, 2 Apr 2019 10:45:32 +1100
> > > > Subject: [PATCH] drm/lima: update for xa_alloc API change
> > > >
> > > > Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > > ---
> > > >  drivers/gpu/drm/lima/lima_ctx.c | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c
> > > > index c8d12f7c6894..bafa00d74cc5 100644
> > > > --- a/drivers/gpu/drm/lima/lima_ctx.c
> > > > +++ b/drivers/gpu/drm/lima/lima_ctx.c
> > > > @@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
> > > >                         goto err_out0;
> > > >         }
> > > >
> > > > -       err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> > > > +       err = xa_alloc(&mgr->handles, id, ctx, XA_LIMIT(*id, UINT_MAX), GFP_KERNEL);
> > > >         if (err < 0)
> > > >                 goto err_out0;
> > > >
> > > > --
> > > > 2.20.1
> > > >
> > > > --
> > > > Cheers,
> > > > Stephen Rothwell
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-01 23:50 linux-next: build failure after merge of the drm-misc tree Stephen Rothwell
  2019-04-02  5:55 ` Qiang Yu
@ 2019-04-02 11:21 ` Matthew Wilcox
  2019-04-02 13:33   ` Qiang Yu
  1 sibling, 1 reply; 11+ messages in thread
From: Matthew Wilcox @ 2019-04-02 11:21 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Daniel Vetter, Intel Graphics, Linux Kernel Mailing List, DRI,
	Linux Next Mailing List, Qiang Yu

On Tue, Apr 02, 2019 at 10:50:06AM +1100, Stephen Rothwell wrote:
> +++ b/drivers/gpu/drm/lima/lima_ctx.c
> @@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
>  			goto err_out0;
>  	}
>  
> -	err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> +	err = xa_alloc(&mgr->handles, id, ctx, XA_LIMIT(*id, UINT_MAX), GFP_KERNEL);
>  	if (err < 0)
>  		goto err_out0;

I agree that this is an exact translation of what the code was doing,
but I don't think it's what the author intended the code to do.
They almost certainly meant:

	err = xa_alloc(&mgr->handles, id, ctx, xa_limit_32b, GFP_KERNEL);

I'm basing this on:

+struct drm_lima_ctx_create {
+       __u32 id;          /* out, context handle */
+       __u32 _pad;        /* pad, must be zero */
+};

(and this confusion is exactly why I changed the API ...)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-02  5:55 ` Qiang Yu
  2019-04-02  7:57   ` Daniel Vetter
@ 2019-04-02 11:26   ` Matthew Wilcox
  2019-04-02 13:56     ` Qiang Yu
  1 sibling, 1 reply; 11+ messages in thread
From: Matthew Wilcox @ 2019-04-02 11:26 UTC (permalink / raw)
  To: Qiang Yu
  Cc: Stephen Rothwell, Daniel Vetter, Intel Graphics, DRI,
	Linux Next Mailing List, Linux Kernel Mailing List, Eric Anholt

On Tue, Apr 02, 2019 at 01:55:03PM +0800, Qiang Yu wrote:
> Thanks, patch is:
> Reviewed-by: Qiang Yu <yuq825@gmail.com>

This looks like a fairly naive conversion from the old IDR API to the
XArray API.  You should be able to remove mgr->lock entirely, relying on
the xa_lock for synchronising free and get.  If you think it's worth it,
you could even use kfree_rcu() to free the ctx and kref_get_unless_zero()
and then your get path would be lock-free.

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-02 11:21 ` Matthew Wilcox
@ 2019-04-02 13:33   ` Qiang Yu
  2019-04-02 13:45     ` [PATCH] drm/lima: adopt xa_alloc API change Qiang Yu
  0 siblings, 1 reply; 11+ messages in thread
From: Qiang Yu @ 2019-04-02 13:33 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Stephen Rothwell, Daniel Vetter, Intel Graphics, DRI,
	Linux Next Mailing List, Linux Kernel Mailing List, Eric Anholt

On Tue, Apr 2, 2019 at 7:21 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Apr 02, 2019 at 10:50:06AM +1100, Stephen Rothwell wrote:
> > +++ b/drivers/gpu/drm/lima/lima_ctx.c
> > @@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
> >                       goto err_out0;
> >       }
> >
> > -     err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
> > +     err = xa_alloc(&mgr->handles, id, ctx, XA_LIMIT(*id, UINT_MAX), GFP_KERNEL);
> >       if (err < 0)
> >               goto err_out0;
>
> I agree that this is an exact translation of what the code was doing,
> but I don't think it's what the author intended the code to do.
> They almost certainly meant:
>
>         err = xa_alloc(&mgr->handles, id, ctx, xa_limit_32b, GFP_KERNEL);
>
> I'm basing this on:
>
> +struct drm_lima_ctx_create {
> +       __u32 id;          /* out, context handle */
> +       __u32 _pad;        /* pad, must be zero */
> +};
>
> (and this confusion is exactly why I changed the API ...)

Right, I plan to send out a patch like yours after drm-misc-next merge
5.1 changes, as this is a build fix patch and already applied to somewhere.
I can send out another patch now if merge guys could use the new one
directly.

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

* [PATCH] drm/lima: adopt xa_alloc API change
  2019-04-02 13:33   ` Qiang Yu
@ 2019-04-02 13:45     ` Qiang Yu
  0 siblings, 0 replies; 11+ messages in thread
From: Qiang Yu @ 2019-04-02 13:45 UTC (permalink / raw)
  To: dri-devel
  Cc: lima, intel-gfx, linux-next, linux-kernel, eric, Qiang Yu,
	Stephen Rothwell, Matthew Wilcox, Daniel Vetter

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
---
 drivers/gpu/drm/lima/lima_ctx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/lima/lima_ctx.c b/drivers/gpu/drm/lima/lima_ctx.c
index c8d12f7c6894..22fff6caa961 100644
--- a/drivers/gpu/drm/lima/lima_ctx.c
+++ b/drivers/gpu/drm/lima/lima_ctx.c
@@ -23,7 +23,7 @@ int lima_ctx_create(struct lima_device *dev, struct lima_ctx_mgr *mgr, u32 *id)
 			goto err_out0;
 	}
 
-	err = xa_alloc(&mgr->handles, id, UINT_MAX, ctx, GFP_KERNEL);
+	err = xa_alloc(&mgr->handles, id, ctx, xa_limit_32b, GFP_KERNEL);
 	if (err < 0)
 		goto err_out0;
 
-- 
2.17.1

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-02 11:26   ` Matthew Wilcox
@ 2019-04-02 13:56     ` Qiang Yu
  2019-04-02 14:10       ` Matthew Wilcox
  0 siblings, 1 reply; 11+ messages in thread
From: Qiang Yu @ 2019-04-02 13:56 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Stephen Rothwell, Daniel Vetter, Intel Graphics, DRI,
	Linux Next Mailing List, Linux Kernel Mailing List, Eric Anholt

On Tue, Apr 2, 2019 at 7:26 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Tue, Apr 02, 2019 at 01:55:03PM +0800, Qiang Yu wrote:
> > Thanks, patch is:
> > Reviewed-by: Qiang Yu <yuq825@gmail.com>
>
> This looks like a fairly naive conversion from the old IDR API to the
> XArray API.  You should be able to remove mgr->lock entirely, relying on
> the xa_lock for synchronising free and get.

I'm afraid the a little complex free path may involve some might sleep
functions so use a mutex lock instead of spinlock.

> If you think it's worth it,
> you could even use kfree_rcu() to free the ctx and kref_get_unless_zero()
> and then your get path would be lock-free.

I can take a look this way, thanks.

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

* Re: linux-next: build failure after merge of the drm-misc tree
  2019-04-02 13:56     ` Qiang Yu
@ 2019-04-02 14:10       ` Matthew Wilcox
  0 siblings, 0 replies; 11+ messages in thread
From: Matthew Wilcox @ 2019-04-02 14:10 UTC (permalink / raw)
  To: Qiang Yu
  Cc: Stephen Rothwell, Daniel Vetter, Intel Graphics, DRI,
	Linux Next Mailing List, Linux Kernel Mailing List, Eric Anholt

On Tue, Apr 02, 2019 at 09:56:08PM +0800, Qiang Yu wrote:
> On Tue, Apr 2, 2019 at 7:26 PM Matthew Wilcox <willy@infradead.org> wrote:
> >
> > On Tue, Apr 02, 2019 at 01:55:03PM +0800, Qiang Yu wrote:
> > > Thanks, patch is:
> > > Reviewed-by: Qiang Yu <yuq825@gmail.com>
> >
> > This looks like a fairly naive conversion from the old IDR API to the
> > XArray API.  You should be able to remove mgr->lock entirely, relying on
> > the xa_lock for synchronising free and get.
> 
> I'm afraid the a little complex free path may involve some might sleep
> functions so use a mutex lock instead of spinlock.

Ah, good call ...

+       mutex_lock(&mgr->lock);
+       ctx = xa_erase(&mgr->handles, id);
+       if (ctx)
+               kref_put(&ctx->refcnt, lima_ctx_do_release);
+       else
+               ret = -EINVAL;
+       mutex_unlock(&mgr->lock);

+static void lima_ctx_do_release(struct kref *ref)
+{
+       struct lima_ctx *ctx = container_of(ref, struct lima_ctx, refcnt);
+       int i;
+
+       for (i = 0; i < lima_pipe_num; i++)
+               lima_sched_context_fini(ctx->dev->pipe + i, ctx->context + i);
+       kfree(ctx);
+}

+void lima_sched_context_fini(struct lima_sched_pipe *pipe,
+                            struct lima_sched_context *context)
+{
+       drm_sched_entity_fini(&context->base);
+}

and drm_sched_entity_fini() can call kthread_park(), which does sleep.

> > If you think it's worth it,
> > you could even use kfree_rcu() to free the ctx and kref_get_unless_zero()
> > and then your get path would be lock-free.
> 
> I can take a look this way, thanks.

I think that's the only way you can get rid of the mutex, given the
sleeping functions called in the free path.

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

end of thread, other threads:[~2019-04-02 14:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-01 23:50 linux-next: build failure after merge of the drm-misc tree Stephen Rothwell
2019-04-02  5:55 ` Qiang Yu
2019-04-02  7:57   ` Daniel Vetter
2019-04-02  8:59     ` Qiang Yu
2019-04-02  9:08       ` Daniel Vetter
2019-04-02 11:26   ` Matthew Wilcox
2019-04-02 13:56     ` Qiang Yu
2019-04-02 14:10       ` Matthew Wilcox
2019-04-02 11:21 ` Matthew Wilcox
2019-04-02 13:33   ` Qiang Yu
2019-04-02 13:45     ` [PATCH] drm/lima: adopt xa_alloc API change Qiang Yu

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).