2020-11-02 01:45:46

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the drm-misc tree

Hi all,

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

In file included from drivers/gpu/drm/nouveau/nouveau_ttm.c:26:
include/linux/swiotlb.h: In function 'swiotlb_max_mapping_size':
include/linux/swiotlb.h:99:9: error: 'SIZE_MAX' undeclared (first use in this function)
99 | return SIZE_MAX;
| ^~~~~~~~
include/linux/swiotlb.h:7:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
6 | #include <linux/init.h>
+++ |+#include <stdint.h>
7 | #include <linux/types.h>
include/linux/swiotlb.h:99:9: note: each undeclared identifier is reported only once for each function it appears in
99 | return SIZE_MAX;
| ^~~~~~~~

Caused by commit

abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")

but only exposed by commit

4dbafbd30aef ("drm/nouveu: fix swiotlb include")

I applied the following fix for today:

From: Stephen Rothwell <[email protected]>
Date: Mon, 2 Nov 2020 12:34:57 +1100
Subject: [PATCH] swiotlb: using SIZE_MAX needs limits.h included

Fixes: abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
Signed-off-by: Stephen Rothwell <[email protected]>
---
include/linux/swiotlb.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 513913ff7486..ed9de7855d3b 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -5,6 +5,9 @@
#include <linux/dma-direction.h>
#include <linux/init.h>
#include <linux/types.h>
+#ifndef CONFIG_SWIOTLB
+#include <linux/limits.h>
+#endif

struct device;
struct page;
--
2.28.0

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-11-02 09:30:57

by Daniel Vetter

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the drm-misc tree

On Mon, Nov 2, 2020 at 2:43 AM Stephen Rothwell <[email protected]> wrote:
>
> Hi all,
>
> After merging the drm-misc tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
>
> In file included from drivers/gpu/drm/nouveau/nouveau_ttm.c:26:
> include/linux/swiotlb.h: In function 'swiotlb_max_mapping_size':
> include/linux/swiotlb.h:99:9: error: 'SIZE_MAX' undeclared (first use in this function)
> 99 | return SIZE_MAX;
> | ^~~~~~~~
> include/linux/swiotlb.h:7:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
> 6 | #include <linux/init.h>
> +++ |+#include <stdint.h>
> 7 | #include <linux/types.h>
> include/linux/swiotlb.h:99:9: note: each undeclared identifier is reported only once for each function it appears in
> 99 | return SIZE_MAX;
> | ^~~~~~~~
>
> Caused by commit
>
> abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
>
> but only exposed by commit
>
> 4dbafbd30aef ("drm/nouveu: fix swiotlb include")
>
> I applied the following fix for today:
>
> From: Stephen Rothwell <[email protected]>
> Date: Mon, 2 Nov 2020 12:34:57 +1100
> Subject: [PATCH] swiotlb: using SIZE_MAX needs limits.h included
>
> Fixes: abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> Signed-off-by: Stephen Rothwell <[email protected]>

I think simplest if this lands through dma-api tree into current -rc
kernels. Or should we just put this into drm-misc-next since that's
where the problem shows up? Christoph, any preference from dma-api
side?
-Daniel

> ---
> include/linux/swiotlb.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> index 513913ff7486..ed9de7855d3b 100644
> --- a/include/linux/swiotlb.h
> +++ b/include/linux/swiotlb.h
> @@ -5,6 +5,9 @@
> #include <linux/dma-direction.h>
> #include <linux/init.h>
> #include <linux/types.h>
> +#ifndef CONFIG_SWIOTLB
> +#include <linux/limits.h>
> +#endif
>
> struct device;
> struct page;
> --
> 2.28.0
>
> --
> Cheers,
> Stephen Rothwell



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

2020-11-02 10:23:06

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the drm-misc tree

On Mon, Nov 02, 2020 at 12:43:27PM +1100, Stephen Rothwell wrote:
> Hi all,
>
> After merging the drm-misc tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
>
> In file included from drivers/gpu/drm/nouveau/nouveau_ttm.c:26:
> include/linux/swiotlb.h: In function 'swiotlb_max_mapping_size':
> include/linux/swiotlb.h:99:9: error: 'SIZE_MAX' undeclared (first use in this function)
> 99 | return SIZE_MAX;
> | ^~~~~~~~
> include/linux/swiotlb.h:7:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
> 6 | #include <linux/init.h>
> +++ |+#include <stdint.h>
> 7 | #include <linux/types.h>
> include/linux/swiotlb.h:99:9: note: each undeclared identifier is reported only once for each function it appears in
> 99 | return SIZE_MAX;
> | ^~~~~~~~
>
> Caused by commit
>
> abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
>
> but only exposed by commit
>
> 4dbafbd30aef ("drm/nouveu: fix swiotlb include")
>
> I applied the following fix for today:
>
> From: Stephen Rothwell <[email protected]>
> Date: Mon, 2 Nov 2020 12:34:57 +1100
> Subject: [PATCH] swiotlb: using SIZE_MAX needs limits.h included
>
> Fixes: abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> Signed-off-by: Stephen Rothwell <[email protected]>

Acked-by: Michael S. Tsirkin <[email protected]>

I guess it makes sense to pick this up for this release directly.
I'll merge this unless there are any objections.

> ---
> include/linux/swiotlb.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> index 513913ff7486..ed9de7855d3b 100644
> --- a/include/linux/swiotlb.h
> +++ b/include/linux/swiotlb.h
> @@ -5,6 +5,9 @@
> #include <linux/dma-direction.h>
> #include <linux/init.h>
> #include <linux/types.h>
> +#ifndef CONFIG_SWIOTLB
> +#include <linux/limits.h>
> +#endif
>
> struct device;
> struct page;
> --
> 2.28.0
>
> --
> Cheers,
> Stephen Rothwell


2020-11-02 10:27:29

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the drm-misc tree

On Mon, Nov 02, 2020 at 10:28:34AM +0100, Daniel Vetter wrote:
> On Mon, Nov 2, 2020 at 2:43 AM Stephen Rothwell <[email protected]> wrote:
> >
> > Hi all,
> >
> > After merging the drm-misc tree, today's linux-next build (arm
> > multi_v7_defconfig) failed like this:
> >
> > In file included from drivers/gpu/drm/nouveau/nouveau_ttm.c:26:
> > include/linux/swiotlb.h: In function 'swiotlb_max_mapping_size':
> > include/linux/swiotlb.h:99:9: error: 'SIZE_MAX' undeclared (first use in this function)
> > 99 | return SIZE_MAX;
> > | ^~~~~~~~
> > include/linux/swiotlb.h:7:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
> > 6 | #include <linux/init.h>
> > +++ |+#include <stdint.h>
> > 7 | #include <linux/types.h>
> > include/linux/swiotlb.h:99:9: note: each undeclared identifier is reported only once for each function it appears in
> > 99 | return SIZE_MAX;
> > | ^~~~~~~~
> >
> > Caused by commit
> >
> > abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> >
> > but only exposed by commit
> >
> > 4dbafbd30aef ("drm/nouveu: fix swiotlb include")
> >
> > I applied the following fix for today:
> >
> > From: Stephen Rothwell <[email protected]>
> > Date: Mon, 2 Nov 2020 12:34:57 +1100
> > Subject: [PATCH] swiotlb: using SIZE_MAX needs limits.h included
> >
> > Fixes: abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> > Signed-off-by: Stephen Rothwell <[email protected]>
>
> I think simplest if this lands through dma-api tree into current -rc
> kernels. Or should we just put this into drm-misc-next since that's
> where the problem shows up? Christoph, any preference from dma-api
> side?
> -Daniel


Or I can merge it since I merged the original patch causing the
issue ...

> > ---
> > include/linux/swiotlb.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> > index 513913ff7486..ed9de7855d3b 100644
> > --- a/include/linux/swiotlb.h
> > +++ b/include/linux/swiotlb.h
> > @@ -5,6 +5,9 @@
> > #include <linux/dma-direction.h>
> > #include <linux/init.h>
> > #include <linux/types.h>
> > +#ifndef CONFIG_SWIOTLB
> > +#include <linux/limits.h>
> > +#endif
> >
> > struct device;
> > struct page;
> > --
> > 2.28.0
> >
> > --
> > Cheers,
> > Stephen Rothwell
>
>
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch

2020-11-02 10:31:05

by Christoph Hellwig

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the drm-misc tree

On Mon, Nov 02, 2020 at 10:28:34AM +0100, Daniel Vetter wrote:
> > --- a/include/linux/swiotlb.h
> > +++ b/include/linux/swiotlb.h
> > @@ -5,6 +5,9 @@
> > #include <linux/dma-direction.h>
> > #include <linux/init.h>
> > #include <linux/types.h>
> > +#ifndef CONFIG_SWIOTLB
> > +#include <linux/limits.h>
> > +#endif

No conditional includes please. And the proper fix for the reported
issue is to stop poking into swiotlb internals in random drivers..

2020-11-02 10:32:22

by Daniel Vetter

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the drm-misc tree

On Mon, Nov 2, 2020 at 11:23 AM Michael S. Tsirkin <[email protected]> wrote:
>
> On Mon, Nov 02, 2020 at 10:28:34AM +0100, Daniel Vetter wrote:
> > On Mon, Nov 2, 2020 at 2:43 AM Stephen Rothwell <[email protected]> wrote:
> > >
> > > Hi all,
> > >
> > > After merging the drm-misc tree, today's linux-next build (arm
> > > multi_v7_defconfig) failed like this:
> > >
> > > In file included from drivers/gpu/drm/nouveau/nouveau_ttm.c:26:
> > > include/linux/swiotlb.h: In function 'swiotlb_max_mapping_size':
> > > include/linux/swiotlb.h:99:9: error: 'SIZE_MAX' undeclared (first use in this function)
> > > 99 | return SIZE_MAX;
> > > | ^~~~~~~~
> > > include/linux/swiotlb.h:7:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
> > > 6 | #include <linux/init.h>
> > > +++ |+#include <stdint.h>
> > > 7 | #include <linux/types.h>
> > > include/linux/swiotlb.h:99:9: note: each undeclared identifier is reported only once for each function it appears in
> > > 99 | return SIZE_MAX;
> > > | ^~~~~~~~
> > >
> > > Caused by commit
> > >
> > > abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> > >
> > > but only exposed by commit
> > >
> > > 4dbafbd30aef ("drm/nouveu: fix swiotlb include")
> > >
> > > I applied the following fix for today:
> > >
> > > From: Stephen Rothwell <[email protected]>
> > > Date: Mon, 2 Nov 2020 12:34:57 +1100
> > > Subject: [PATCH] swiotlb: using SIZE_MAX needs limits.h included
> > >
> > > Fixes: abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> > > Signed-off-by: Stephen Rothwell <[email protected]>
> >
> > I think simplest if this lands through dma-api tree into current -rc
> > kernels. Or should we just put this into drm-misc-next since that's
> > where the problem shows up? Christoph, any preference from dma-api
> > side?
> > -Daniel
>
>
> Or I can merge it since I merged the original patch causing the
> issue ...

Works for me too.
-Daniel
>
> > > ---
> > > include/linux/swiotlb.h | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
> > > index 513913ff7486..ed9de7855d3b 100644
> > > --- a/include/linux/swiotlb.h
> > > +++ b/include/linux/swiotlb.h
> > > @@ -5,6 +5,9 @@
> > > #include <linux/dma-direction.h>
> > > #include <linux/init.h>
> > > #include <linux/types.h>
> > > +#ifndef CONFIG_SWIOTLB
> > > +#include <linux/limits.h>
> > > +#endif
> > >
> > > struct device;
> > > struct page;
> > > --
> > > 2.28.0
> > >
> > > --
> > > Cheers,
> > > Stephen Rothwell
> >
> >
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
>


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

2020-11-02 11:07:08

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the drm-misc tree

On Mon, Nov 02, 2020 at 10:27:11AM +0000, Christoph Hellwig wrote:
> On Mon, Nov 02, 2020 at 10:28:34AM +0100, Daniel Vetter wrote:
> > > --- a/include/linux/swiotlb.h
> > > +++ b/include/linux/swiotlb.h
> > > @@ -5,6 +5,9 @@
> > > #include <linux/dma-direction.h>
> > > #include <linux/init.h>
> > > #include <linux/types.h>
> > > +#ifndef CONFIG_SWIOTLB
> > > +#include <linux/limits.h>
> > > +#endif
>
> No conditional includes please. And the proper fix for the reported
> issue is to stop poking into swiotlb internals in random drivers..

Meaning?

2020-11-11 06:12:12

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the drm-misc tree

Hi Michael,

On Mon, 2 Nov 2020 05:19:06 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
>
> On Mon, Nov 02, 2020 at 12:43:27PM +1100, Stephen Rothwell wrote:
> >
> > After merging the drm-misc tree, today's linux-next build (arm
> > multi_v7_defconfig) failed like this:
> >
> > In file included from drivers/gpu/drm/nouveau/nouveau_ttm.c:26:
> > include/linux/swiotlb.h: In function 'swiotlb_max_mapping_size':
> > include/linux/swiotlb.h:99:9: error: 'SIZE_MAX' undeclared (first use in this function)
> > 99 | return SIZE_MAX;
> > | ^~~~~~~~
> > include/linux/swiotlb.h:7:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
> > 6 | #include <linux/init.h>
> > +++ |+#include <stdint.h>
> > 7 | #include <linux/types.h>
> > include/linux/swiotlb.h:99:9: note: each undeclared identifier is reported only once for each function it appears in
> > 99 | return SIZE_MAX;
> > | ^~~~~~~~
> >
> > Caused by commit
> >
> > abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> >
> > but only exposed by commit
> >
> > 4dbafbd30aef ("drm/nouveu: fix swiotlb include")
> >
> > I applied the following fix for today:
> >
> > From: Stephen Rothwell <[email protected]>
> > Date: Mon, 2 Nov 2020 12:34:57 +1100
> > Subject: [PATCH] swiotlb: using SIZE_MAX needs limits.h included
> >
> > Fixes: abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> > Signed-off-by: Stephen Rothwell <[email protected]>
>
> Acked-by: Michael S. Tsirkin <[email protected]>
>
> I guess it makes sense to pick this up for this release directly.
> I'll merge this unless there are any objections.

Christoph is right that the include should not be conditional. But I
have not tested that that does not introduce some other problems.

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-11-11 12:51:26

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the drm-misc tree

On Wed, Nov 11, 2020 at 05:10:15PM +1100, Stephen Rothwell wrote:
> Hi Michael,
>
> On Mon, 2 Nov 2020 05:19:06 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
> >
> > On Mon, Nov 02, 2020 at 12:43:27PM +1100, Stephen Rothwell wrote:
> > >
> > > After merging the drm-misc tree, today's linux-next build (arm
> > > multi_v7_defconfig) failed like this:
> > >
> > > In file included from drivers/gpu/drm/nouveau/nouveau_ttm.c:26:
> > > include/linux/swiotlb.h: In function 'swiotlb_max_mapping_size':
> > > include/linux/swiotlb.h:99:9: error: 'SIZE_MAX' undeclared (first use in this function)
> > > 99 | return SIZE_MAX;
> > > | ^~~~~~~~
> > > include/linux/swiotlb.h:7:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
> > > 6 | #include <linux/init.h>
> > > +++ |+#include <stdint.h>
> > > 7 | #include <linux/types.h>
> > > include/linux/swiotlb.h:99:9: note: each undeclared identifier is reported only once for each function it appears in
> > > 99 | return SIZE_MAX;
> > > | ^~~~~~~~
> > >
> > > Caused by commit
> > >
> > > abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> > >
> > > but only exposed by commit
> > >
> > > 4dbafbd30aef ("drm/nouveu: fix swiotlb include")
> > >
> > > I applied the following fix for today:
> > >
> > > From: Stephen Rothwell <[email protected]>
> > > Date: Mon, 2 Nov 2020 12:34:57 +1100
> > > Subject: [PATCH] swiotlb: using SIZE_MAX needs limits.h included
> > >
> > > Fixes: abe420bfae52 ("swiotlb: Introduce swiotlb_max_mapping_size()")
> > > Signed-off-by: Stephen Rothwell <[email protected]>
> >
> > Acked-by: Michael S. Tsirkin <[email protected]>
> >
> > I guess it makes sense to pick this up for this release directly.
> > I'll merge this unless there are any objections.
>
> Christoph is right that the include should not be conditional. But I
> have not tested that that does not introduce some other problems.

If there's a problem it will be a build failure - I'll put
it in next for a while, this way we'll find out.

> --
> Cheers,
> Stephen Rothwell