Re: [PATCH] STAGING: Comedi: Build only on arches providingPAGE_KERNEL_NOCACHE

From: Benjamin Herrenschmidt
Date: Thu Jun 23 2011 - 18:02:43 EST


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@xxxxxxxxxxxxxx>
> > >
> > > 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@xxxxxxxxxxxxxxx
> More majordomo info at http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/