* [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
@ 2011-06-23 11:45 Ralf Baechle
2011-06-23 11:53 ` Martyn Welch
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Ralf Baechle @ 2011-06-23 11:45 UTC (permalink / raw)
To: Greg Kroah-Hartman, devel, linux-kernel, David Howells,
linux-m32r, linux-m32r-ja, linux-am33-list, Paul Mundt, linux-sh,
Chris Metcalf, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86
Cc: linux-arch
On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns
into tragedy:
CC [M] drivers/staging/comedi/drivers.o
drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in
make[3]: *** [drivers/staging/comedi/drivers.o] Error 1
Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE.
PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27
are even uable to offer uncached operation - at least in the way an unwitting
driver might assume. I haven't looked in details how the driver is using
the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using
cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range
APIs in conjunction with the DMA API is a practical alternative.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
drivers/staging/comedi/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
index 1502d80..bccdc12 100644
--- a/drivers/staging/comedi/Kconfig
+++ b/drivers/staging/comedi/Kconfig
@@ -2,6 +2,7 @@ config COMEDI
tristate "Data acquisition support (comedi)"
default N
depends on m
+ depends on BROKEN || FRV || M32R || MN10300 || SUPERH || TILE || X86
---help---
Enable support a wide range of data acquisition devices
for Linux.
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 11:45 [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE Ralf Baechle
@ 2011-06-23 11:53 ` Martyn Welch
2011-06-23 12:02 ` Ralf Baechle
2011-06-23 16:01 ` Geert Uytterhoeven
2011-06-23 23:55 ` Stephen Rothwell
2 siblings, 1 reply; 11+ messages in thread
From: Martyn Welch @ 2011-06-23 11:53 UTC (permalink / raw)
To: Ralf Baechle
Cc: Greg Kroah-Hartman, devel, linux-kernel, David Howells,
linux-m32r, linux-m32r-ja, linux-am33-list, Paul Mundt, linux-sh,
Chris Metcalf, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
linux-arch
On 23/06/11 12:45, Ralf Baechle wrote:
> On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns
> into tragedy:
>
> CC [M] drivers/staging/comedi/drivers.o
> drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
> drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
> drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in
> make[3]: *** [drivers/staging/comedi/drivers.o] Error 1
>
> Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE.
>
> PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27
> are even uable to offer uncached operation - at least in the way an unwitting
> driver might assume. I haven't looked in details how the driver is using
> the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using
> cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range
> APIs in conjunction with the DMA API is a practical alternative.
>
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>
> drivers/staging/comedi/Kconfig | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
> index 1502d80..bccdc12 100644
> --- a/drivers/staging/comedi/Kconfig
> +++ b/drivers/staging/comedi/Kconfig
> @@ -2,6 +2,7 @@ config COMEDI
> tristate "Data acquisition support (comedi)"
> default N
> depends on m
> + depends on BROKEN || FRV || M32R || MN10300 || SUPERH || TILE || X86
I'm sure I got comedi to compile on a 32-bit PPC board not that long ago. Has
something changed, or is this just not an exhaustive list?
> ---help---
> Enable support a wide range of data acquisition devices
> for Linux.
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
--
Martyn Welch (Principal Software Engineer) | Registered in England and
GE Intelligent Platforms | Wales (3828642) at 100
T +44(0)127322748 | Barbirolli Square, Manchester,
E martyn.welch@ge.com | M2 3AB VAT:GB 927559189
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 11:53 ` Martyn Welch
@ 2011-06-23 12:02 ` Ralf Baechle
2011-06-23 12:10 ` Kumar Gala
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Ralf Baechle @ 2011-06-23 12:02 UTC (permalink / raw)
To: Martyn Welch
Cc: Greg Kroah-Hartman, devel, linux-kernel, David Howells,
linux-m32r, linux-m32r-ja, linux-am33-list, Paul Mundt, linux-sh,
Chris Metcalf, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
linux-arch, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev
On Thu, Jun 23, 2011 at 12:53:36PM +0100, Martyn Welch wrote:
> On 23/06/11 12:45, Ralf Baechle wrote:
> > On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns
> > into tragedy:
> >
> > CC [M] drivers/staging/comedi/drivers.o
> > drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
> > drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
> > drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in
> > make[3]: *** [drivers/staging/comedi/drivers.o] Error 1
> >
> > Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE.
> >
> > PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27
> > are even uable to offer uncached operation - at least in the way an unwitting
> > driver might assume. I haven't looked in details how the driver is using
> > the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using
> > cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range
> > APIs in conjunction with the DMA API is a practical alternative.
> >
> > Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> >
> > drivers/staging/comedi/Kconfig | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
> > index 1502d80..bccdc12 100644
> > --- a/drivers/staging/comedi/Kconfig
> > +++ b/drivers/staging/comedi/Kconfig
> > @@ -2,6 +2,7 @@ config COMEDI
> > tristate "Data acquisition support (comedi)"
> > default N
> > depends on m
> > + depends on BROKEN || FRV || M32R || MN10300 || SUPERH || TILE || X86
>
> I'm sure I got comedi to compile on a 32-bit PPC board not that long ago. Has
> something changed, or is this just not an exhaustive list?
(Adding the PPC folks to cc.)
A "git grep -w PAGE_KERNEL_NOCACHE arch/powerpc/" doesn't find anything so
I don't think the driver will build there. I don't have a PPC toolchain
to verify that.
Ralf
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 12:02 ` Ralf Baechle
@ 2011-06-23 12:10 ` Kumar Gala
2011-06-23 15:05 ` Ralf Baechle
2011-06-23 12:13 ` Martyn Welch
2011-06-23 22:01 ` Benjamin Herrenschmidt
2 siblings, 1 reply; 11+ messages in thread
From: Kumar Gala @ 2011-06-23 12:10 UTC (permalink / raw)
To: Ralf Baechle
Cc: Martyn Welch, Greg Kroah-Hartman, devel, linux-kernel,
David Howells, linux-m32r, linux-m32r-ja, linux-am33-list,
Paul Mundt, linux-sh, Chris Metcalf, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, linux-arch, Benjamin Herrenschmidt,
Paul Mackerras, linuxppc-dev
On Jun 23, 2011, at 7:02 AM, Ralf Baechle wrote:
> On Thu, Jun 23, 2011 at 12:53:36PM +0100, Martyn Welch wrote:
>
>> On 23/06/11 12:45, Ralf Baechle wrote:
>>> On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns
>>> into tragedy:
>>>
>>> CC [M] drivers/staging/comedi/drivers.o
>>> drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
>>> drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
>>> drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in
>>> make[3]: *** [drivers/staging/comedi/drivers.o] Error 1
>>>
>>> Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE.
>>>
>>> PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27
>>> are even uable to offer uncached operation - at least in the way an unwitting
>>> driver might assume. I haven't looked in details how the driver is using
>>> the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using
>>> cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range
>>> APIs in conjunction with the DMA API is a practical alternative.
>>>
>>> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>>>
>>> drivers/staging/comedi/Kconfig | 1 +
>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
>>> index 1502d80..bccdc12 100644
>>> --- a/drivers/staging/comedi/Kconfig
>>> +++ b/drivers/staging/comedi/Kconfig
>>> @@ -2,6 +2,7 @@ config COMEDI
>>> tristate "Data acquisition support (comedi)"
>>> default N
>>> depends on m
>>> + depends on BROKEN || FRV || M32R || MN10300 || SUPERH || TILE || X86
>>
>> I'm sure I got comedi to compile on a 32-bit PPC board not that long ago. Has
>> something changed, or is this just not an exhaustive list?
>
> (Adding the PPC folks to cc.)
>
> A "git grep -w PAGE_KERNEL_NOCACHE arch/powerpc/" doesn't find anything so
> I don't think the driver will build there. I don't have a PPC toolchain
> to verify that.
I can verify it fails on PPC as well:
drivers/staging/comedi/drivers.c: In function 'comedi_buf_alloc':
drivers/staging/comedi/drivers.c:505:37: error: 'PAGE_KERNEL_NOCACHE' undeclared (first use in this function)
drivers/staging/comedi/drivers.c:505:37: note: each undeclared identifier is reported only once for each function it appears in
However, we do have a #define for PAGE_KERNEL_NC.
- k
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 12:02 ` Ralf Baechle
2011-06-23 12:10 ` Kumar Gala
@ 2011-06-23 12:13 ` Martyn Welch
2011-06-23 22:01 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 11+ messages in thread
From: Martyn Welch @ 2011-06-23 12:13 UTC (permalink / raw)
To: Ralf Baechle
Cc: Greg Kroah-Hartman, devel, linux-kernel, David Howells,
linux-m32r, linux-m32r-ja, linux-am33-list, Paul Mundt, linux-sh,
Chris Metcalf, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
linux-arch, Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev
On 23/06/11 13:02, Ralf Baechle wrote:
> On Thu, Jun 23, 2011 at 12:53:36PM +0100, Martyn Welch wrote:
>
>> On 23/06/11 12:45, Ralf Baechle wrote:
>>> On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns
>>> into tragedy:
>>>
>>> CC [M] drivers/staging/comedi/drivers.o
>>> drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
>>> drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
>>> drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in
>>> make[3]: *** [drivers/staging/comedi/drivers.o] Error 1
>>>
>>> Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE.
>>>
>>> PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27
>>> are even uable to offer uncached operation - at least in the way an unwitting
>>> driver might assume. I haven't looked in details how the driver is using
>>> the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using
>>> cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range
>>> APIs in conjunction with the DMA API is a practical alternative.
>>>
>>> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>>>
>>> drivers/staging/comedi/Kconfig | 1 +
>>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
>>> index 1502d80..bccdc12 100644
>>> --- a/drivers/staging/comedi/Kconfig
>>> +++ b/drivers/staging/comedi/Kconfig
>>> @@ -2,6 +2,7 @@ config COMEDI
>>> tristate "Data acquisition support (comedi)"
>>> default N
>>> depends on m
>>> + depends on BROKEN || FRV || M32R || MN10300 || SUPERH || TILE || X86
>>
>> I'm sure I got comedi to compile on a 32-bit PPC board not that long ago. Has
>> something changed, or is this just not an exhaustive list?
>
> (Adding the PPC folks to cc.)
>
> A "git grep -w PAGE_KERNEL_NOCACHE arch/powerpc/" doesn't find anything so
> I don't think the driver will build there. I don't have a PPC toolchain
> to verify that.
Ah, just found the tree looks like I had a little patch to make it seemingly
work, though it will make it "not work" for most other archs at a guess (it
may not even be right on PPC):
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 44d6b62..263ad3d 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -505,7 +505,7 @@ int comedi_buf_alloc(struct comedi_device *dev, struct
comedi_subdevice *s,
}
if (i == n_pages) {
async->prealloc_buf =
- vmap(pages, n_pages, VM_MAP, PAGE_KERNEL_NOCACHE);
+ vmap(pages, n_pages, VM_MAP, PAGE_KERNEL_NC);
}
vfree(pages);
(Sorry for the wrapping)
--
Martyn Welch (Principal Software Engineer) | Registered in England and
GE Intelligent Platforms | Wales (3828642) at 100
T +44(0)127322748 | Barbirolli Square, Manchester,
E martyn.welch@ge.com | M2 3AB VAT:GB 927559189
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 12:10 ` Kumar Gala
@ 2011-06-23 15:05 ` Ralf Baechle
0 siblings, 0 replies; 11+ messages in thread
From: Ralf Baechle @ 2011-06-23 15:05 UTC (permalink / raw)
To: Kumar Gala
Cc: Martyn Welch, Greg Kroah-Hartman, devel, linux-kernel,
David Howells, linux-m32r, linux-m32r-ja, linux-am33-list,
Paul Mundt, linux-sh, Chris Metcalf, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, linux-arch, Benjamin Herrenschmidt,
Paul Mackerras, linuxppc-dev@lists.ozlabs.org Tony Luck,
Fenghua Yu, linux-ia64
On Thu, Jun 23, 2011 at 07:10:29AM -0500, Kumar Gala wrote:
> > (Adding the PPC folks to cc.)
> >
> > A "git grep -w PAGE_KERNEL_NOCACHE arch/powerpc/" doesn't find anything so
> > I don't think the driver will build there. I don't have a PPC toolchain
> > to verify that.
>
> I can verify it fails on PPC as well:
>
> drivers/staging/comedi/drivers.c: In function 'comedi_buf_alloc':
> drivers/staging/comedi/drivers.c:505:37: error: 'PAGE_KERNEL_NOCACHE' undeclared (first use in this function)
> drivers/staging/comedi/drivers.c:505:37: note: each undeclared identifier is reported only once for each function it appears in
>
> However, we do have a #define for PAGE_KERNEL_NC.
Do you think this driver in it's current stage is so valuable that some
ifdefery to get it to work on PPC is the way to go?
IA-64 has PAGE_KERNEL_UC, so basically the same question for IA-64, too.
But preferably the driver should be sorted out properly and until the v1
of my patch which disables it on all architectures that don't provide a
PAGE_KERNEL_NOCACHE definition will do just fine.
Ralf
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 11:45 [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE Ralf Baechle
2011-06-23 11:53 ` Martyn Welch
@ 2011-06-23 16:01 ` Geert Uytterhoeven
2011-06-23 16:31 ` Ralf Baechle
2011-06-23 23:55 ` Stephen Rothwell
2 siblings, 1 reply; 11+ messages in thread
From: Geert Uytterhoeven @ 2011-06-23 16:01 UTC (permalink / raw)
To: Ralf Baechle
Cc: Greg Kroah-Hartman, devel, linux-kernel, David Howells,
linux-m32r, linux-m32r-ja, linux-am33-list, Paul Mundt, linux-sh,
Chris Metcalf, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
linux-arch
On Thu, Jun 23, 2011 at 13:45, Ralf Baechle <ralf@linux-mips.org> wrote:
> On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns
> into tragedy:
>
> CC [M] drivers/staging/comedi/drivers.o
> drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
> drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
> drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in
> make[3]: *** [drivers/staging/comedi/drivers.o] Error 1
>
> Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE.
>
> PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27
> are even uable to offer uncached operation - at least in the way an unwitting
> driver might assume. I haven't looked in details how the driver is using
> the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using
> cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range
> APIs in conjunction with the DMA API is a practical alternative.
>
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
If only to get m68k/allmodconfig going again (hmm, there's another
staging driver
preventing a green light).
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 16:01 ` Geert Uytterhoeven
@ 2011-06-23 16:31 ` Ralf Baechle
2011-06-23 19:18 ` Arnaud Lacombe
0 siblings, 1 reply; 11+ messages in thread
From: Ralf Baechle @ 2011-06-23 16:31 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Greg Kroah-Hartman, devel, linux-kernel, David Howells,
linux-m32r, linux-m32r-ja, linux-am33-list, Paul Mundt, linux-sh,
Chris Metcalf, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
linux-arch, Michal Marek, linux-kbuild
On Thu, Jun 23, 2011 at 06:01:47PM +0200, Geert Uytterhoeven wrote:
> If only to get m68k/allmodconfig going again (hmm, there's another
> staging driver
> preventing a green light).
I ran into this doing an allyesconfig. Allyesconfig has one disadvantage,
for choice it will only select the first or default option which means
that option gets exercised well and all the other options not at all. On
MIPS that'd be IP22, 32-bit, R4x00, big endian, 4K pages, no multithreading,
250Hz. Make randconfig disables lots of things so often misses the
opportunity to trigger some issues.
I'd really want an "make allrandconfig" which enables as many options as
possible but picks a random one from choice statements, something like that.
Ralf
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 16:31 ` Ralf Baechle
@ 2011-06-23 19:18 ` Arnaud Lacombe
0 siblings, 0 replies; 11+ messages in thread
From: Arnaud Lacombe @ 2011-06-23 19:18 UTC (permalink / raw)
To: Ralf Baechle
Cc: Geert Uytterhoeven, Greg Kroah-Hartman, devel, linux-kernel,
David Howells, linux-m32r, linux-m32r-ja, linux-am33-list,
Paul Mundt, linux-sh, Chris Metcalf, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, linux-arch, Michal Marek, linux-kbuild
[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]
Hi,
On Thu, Jun 23, 2011 at 12:31 PM, Ralf Baechle <ralf@linux-mips.org> wrote:
> On Thu, Jun 23, 2011 at 06:01:47PM +0200, Geert Uytterhoeven wrote:
>
>> If only to get m68k/allmodconfig going again (hmm, there's another
>> staging driver
>> preventing a green light).
>
> I ran into this doing an allyesconfig. Allyesconfig has one disadvantage,
> for choice it will only select the first or default option which means
> that option gets exercised well and all the other options not at all. On
> MIPS that'd be IP22, 32-bit, R4x00, big endian, 4K pages, no multithreading,
> 250Hz. Make randconfig disables lots of things so often misses the
> opportunity to trigger some issues.
>
> I'd really want an "make allrandconfig" which enables as many options as
> possible but picks a random one from choice statements, something like that.
>
Something like the attached patch ? [sorry for the attachment, gmail
is so much a PITA for that ...]
- Arnaud
ps: the patch breaks all the others *config target.
> Ralf
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
[-- Attachment #2: 0001-allyesrandchoiceconfig.patch --]
[-- Type: text/x-patch, Size: 3930 bytes --]
From f4b15f8ac27ce0913cb4dca0b0e26f1aaf30025e Mon Sep 17 00:00:00 2001
From: Arnaud Lacombe <lacombar@gmail.com>
Date: Thu, 23 Jun 2011 15:11:24 -0400
Subject: [PATCH] allyesrandchoiceconfig
---
scripts/kconfig/Makefile | 2 +-
scripts/kconfig/conf.c | 7 +++++++
scripts/kconfig/confdata.c | 14 +++++++++++---
scripts/kconfig/lkc.h | 1 +
4 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index faa9a47..4eb9eac 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -98,7 +98,7 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
-allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
+allnoconfig allyesconfig allyesrandchoiceconfig allmodconfig alldefconfig randconfig: $(obj)/conf
$< --$@ $(Kconfig)
PHONY += listnewconfig oldnoconfig savedefconfig defconfig
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 006ad81..9b1c324 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -33,6 +33,7 @@ enum input_mode {
savedefconfig,
listnewconfig,
oldnoconfig,
+ allyesrandchoiceconfig,
} input_mode = oldaskconfig;
char *defconfig_file;
@@ -453,6 +454,7 @@ static struct option long_opts[] = {
{"randconfig", no_argument, NULL, randconfig},
{"listnewconfig", no_argument, NULL, listnewconfig},
{"oldnoconfig", no_argument, NULL, oldnoconfig},
+ {"allyesrandchoiceconfig", no_argument, NULL, allyesrandchoiceconfig},
{NULL, 0, NULL, 0}
};
@@ -476,6 +478,7 @@ int main(int ac, char **av)
case savedefconfig:
defconfig_file = optarg;
break;
+ case allyesrandchoiceconfig:
case randconfig:
{
struct timeval now;
@@ -579,6 +582,10 @@ int main(int ac, char **av)
case allnoconfig:
conf_set_all_new_symbols(def_no);
break;
+ case allyesrandchoiceconfig:
+ conf_set_all_new_symbols(def_yes);
+ conf_set_all_new_choice_symbols(def_random);
+ break;
case allyesconfig:
conf_set_all_new_symbols(def_yes);
break;
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 2bafd9a..e96b95a 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -945,6 +945,7 @@ static void randomize_choice_values(struct symbol *csym)
cnt = 0;
expr_list_for_each_sym(prop->expr, e, sym) {
+ printf("%s %d %d\n", sym->name, def, cnt+1);
if (def == cnt++) {
sym->def[S_DEF_USER].tri = yes;
csym->def[S_DEF_USER].val = sym;
@@ -980,12 +981,14 @@ static void set_all_choice_values(struct symbol *csym)
void conf_set_all_new_symbols(enum conf_def_mode mode)
{
- struct symbol *sym, *csym;
+ struct symbol *sym;
int i, cnt;
for_all_symbols(i, sym) {
if (sym_has_value(sym))
continue;
+ if (sym_is_choice(sym))
+ continue;
switch (sym_get_type(sym)) {
case S_BOOLEAN:
case S_TRISTATE:
@@ -1006,14 +1009,19 @@ void conf_set_all_new_symbols(enum conf_def_mode mode)
default:
continue;
}
- if (!(sym_is_choice(sym) && mode == def_random))
- sym->flags |= SYMBOL_DEF_USER;
+ sym->flags |= SYMBOL_DEF_USER;
break;
default:
break;
}
}
+}
+
+void conf_set_all_new_choice_symbols(enum conf_def_mode mode)
+{
+ struct symbol *csym;
+ int i;
sym_clear_all_valid();
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index febf0c9..672c78f 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -91,6 +91,7 @@ char *conf_get_default_confname(void);
void sym_set_change_count(int count);
void sym_add_change_count(int count);
void conf_set_all_new_symbols(enum conf_def_mode mode);
+void conf_set_all_new_choice_symbols(enum conf_def_mode mode);
/* confdata.c and expr.c */
static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
--
1.7.3.4.574.g608b.dirty
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 12:02 ` Ralf Baechle
2011-06-23 12:10 ` Kumar Gala
2011-06-23 12:13 ` Martyn Welch
@ 2011-06-23 22:01 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 11+ messages in thread
From: Benjamin Herrenschmidt @ 2011-06-23 22:01 UTC (permalink / raw)
To: Ralf Baechle
Cc: Martyn Welch, Greg Kroah-Hartman, devel, linux-kernel,
David Howells, linux-m32r, linux-m32r-ja, linux-am33-list,
Paul Mundt, linux-sh, Chris Metcalf, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, linux-arch, Paul Mackerras, linuxppc-dev
On Thu, 2011-06-23 at 13:02 +0100, Ralf Baechle wrote:
> On Thu, Jun 23, 2011 at 12:53:36PM +0100, Martyn Welch wrote:
>
> > On 23/06/11 12:45, Ralf Baechle wrote:
> > > On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns
> > > into tragedy:
> > >
> > > CC [M] drivers/staging/comedi/drivers.o
> > > drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
> > > drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
> > > drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in
> > > make[3]: *** [drivers/staging/comedi/drivers.o] Error 1
> > >
> > > Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE.
> > >
> > > PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27
> > > are even uable to offer uncached operation - at least in the way an unwitting
> > > driver might assume. I haven't looked in details how the driver is using
> > > the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using
> > > cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range
> > > APIs in conjunction with the DMA API is a practical alternative.
> > >
> > > Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> > >
> > > drivers/staging/comedi/Kconfig | 1 +
> > > 1 files changed, 1 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/drivers/staging/comedi/Kconfig b/drivers/staging/comedi/Kconfig
> > > index 1502d80..bccdc12 100644
> > > --- a/drivers/staging/comedi/Kconfig
> > > +++ b/drivers/staging/comedi/Kconfig
> > > @@ -2,6 +2,7 @@ config COMEDI
> > > tristate "Data acquisition support (comedi)"
> > > default N
> > > depends on m
> > > + depends on BROKEN || FRV || M32R || MN10300 || SUPERH || TILE || X86
> >
> > I'm sure I got comedi to compile on a 32-bit PPC board not that long ago. Has
> > something changed, or is this just not an exhaustive list?
It went away. There's a proper API (pgprot_noncached), but it depends
what this is used for and it's likely to be broken anyways... what is
that driver trying to map non-cached ?
Cheers,
Ben.
> (Adding the PPC folks to cc.)
>
> A "git grep -w PAGE_KERNEL_NOCACHE arch/powerpc/" doesn't find anything so
> I don't think the driver will build there. I don't have a PPC toolchain
> to verify that.
>
> Ralf
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arch" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE
2011-06-23 11:45 [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE Ralf Baechle
2011-06-23 11:53 ` Martyn Welch
2011-06-23 16:01 ` Geert Uytterhoeven
@ 2011-06-23 23:55 ` Stephen Rothwell
2 siblings, 0 replies; 11+ messages in thread
From: Stephen Rothwell @ 2011-06-23 23:55 UTC (permalink / raw)
To: Ralf Baechle
Cc: Greg Kroah-Hartman, devel, linux-kernel, David Howells,
linux-m32r, linux-m32r-ja, linux-am33-list, Paul Mundt, linux-sh,
Chris Metcalf, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
linux-arch
[-- Attachment #1: Type: text/plain, Size: 1481 bytes --]
Hi Ralf,
On Thu, 23 Jun 2011 12:45:37 +0100 Ralf Baechle <ralf@linux-mips.org> wrote:
>
> On architectures that don't define PAGE_KERNEL_NOCACHE, the Comedi driver turns
> into tragedy:
>
> CC [M] drivers/staging/comedi/drivers.o
> drivers/staging/comedi/drivers.c: In function ‘comedi_buf_alloc’:
> drivers/staging/comedi/drivers.c:505:41: error: ‘PAGE_KERNEL_NOCACHE’ undeclared (first use in this function)
> drivers/staging/comedi/drivers.c:505:41: note: each undeclared identifier is rep orted only once for each function it appears in
> make[3]: *** [drivers/staging/comedi/drivers.o] Error 1
>
> Restrict the driver to only those architectures that define PAGE_KERNEL_NOCACHE.
>
> PAGE_KERNEL_NOCACHE is a kludge - some system architectures such as SGI IP27
> are even uable to offer uncached operation - at least in the way an unwitting
> driver might assume. I haven't looked in details how the driver is using
> the area vmaped with PAGE_KERNEL_NOCACHE but maybe doing it XFS-style using
> cached memory and the flush_kernel_vmap_range / invalidate_kernel_vmap_range
> APIs in conjunction with the DMA API is a practical alternative.
>
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Since Greg is on vacation, I will add this patch to my fixes tree in
linux-next until a better fix comes along (if there is one).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-06-23 23:56 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23 11:45 [PATCH] STAGING: Comedi: Build only on arches providing PAGE_KERNEL_NOCACHE Ralf Baechle
2011-06-23 11:53 ` Martyn Welch
2011-06-23 12:02 ` Ralf Baechle
2011-06-23 12:10 ` Kumar Gala
2011-06-23 15:05 ` Ralf Baechle
2011-06-23 12:13 ` Martyn Welch
2011-06-23 22:01 ` Benjamin Herrenschmidt
2011-06-23 16:01 ` Geert Uytterhoeven
2011-06-23 16:31 ` Ralf Baechle
2011-06-23 19:18 ` Arnaud Lacombe
2011-06-23 23:55 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox