public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] export ia64_max_cacheline_size
@ 2005-11-04 22:07 Dave Jones
  2005-11-04 22:34 ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Dave Jones @ 2005-11-04 22:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm

on ia64, dma_get_cache_alignment() needs ia64_max_cacheline_size,
which isn't exported. This breaks modular compilation of the b44
network driver (and possibly others).

Signed-off-by: Dave Jones <davej@redhat.com>


--- linux-2.6.14/arch/ia64/kernel/setup.c~	2005-11-04 17:05:23.000000000 -0500
+++ linux-2.6.14/arch/ia64/kernel/setup.c	2005-11-04 17:05:40.000000000 -0500
@@ -92,6 +92,7 @@ extern void efi_initialize_iomem_resourc
 extern char _text[], _end[], _etext[];
 
 unsigned long ia64_max_cacheline_size;
+EXPORT_SYMBOL(ia64_max_cacheline_size);
 unsigned long ia64_iobase;	/* virtual address for I/O accesses */
 EXPORT_SYMBOL(ia64_iobase);
 struct io_space io_space[MAX_IO_SPACES];

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

* Re: [PATCH] export ia64_max_cacheline_size
  2005-11-04 22:07 [PATCH] export ia64_max_cacheline_size Dave Jones
@ 2005-11-04 22:34 ` Christoph Hellwig
  2005-11-04 22:55   ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2005-11-04 22:34 UTC (permalink / raw)
  To: Dave Jones, linux-kernel, akpm

On Fri, Nov 04, 2005 at 05:07:37PM -0500, Dave Jones wrote:
> on ia64, dma_get_cache_alignment() needs ia64_max_cacheline_size,
> which isn't exported. This breaks modular compilation of the b44
> network driver (and possibly others).

Can we please move dma_get_cache_alignment() out of line instead?
Always export sane APIs instead of random internals.


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

* Re: [PATCH] export ia64_max_cacheline_size
  2005-11-04 22:34 ` Christoph Hellwig
@ 2005-11-04 22:55   ` Andrew Morton
  2005-11-04 23:52     ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2005-11-04 22:55 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: davej, linux-kernel

Christoph Hellwig <hch@infradead.org> wrote:
>
> On Fri, Nov 04, 2005 at 05:07:37PM -0500, Dave Jones wrote:
> > on ia64, dma_get_cache_alignment() needs ia64_max_cacheline_size,
> > which isn't exported. This breaks modular compilation of the b44
> > network driver (and possibly others).
> 
> Can we please move dma_get_cache_alignment() out of line instead?

It's a single statement!  It wants to be inlined.

> Always export sane APIs instead of random internals.

The exported API is dma_get_cache_alignment().  For internal implementation
reasons we need to export an ia64 symbol to modules to support it.  That
kinda sucks, but I don't think that we need to compromise kernel size and
performance because of it.

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

* Re: [PATCH] export ia64_max_cacheline_size
  2005-11-04 22:55   ` Andrew Morton
@ 2005-11-04 23:52     ` Christoph Hellwig
  2005-11-05  0:05       ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2005-11-04 23:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Christoph Hellwig, davej, linux-kernel

On Fri, Nov 04, 2005 at 02:55:34PM -0800, Andrew Morton wrote:
> > Can we please move dma_get_cache_alignment() out of line instead?
> 
> It's a single statement!  It wants to be inlined.
> 
> > Always export sane APIs instead of random internals.
> 
> The exported API is dma_get_cache_alignment().  For internal implementation
> reasons we need to export an ia64 symbol to modules to support it.  That
> kinda sucks, but I don't think that we need to compromise kernel size and
> performance because of it.

It's an API used only in slow pathes.  It's much better to enforce modularity
in that case.

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

* Re: [PATCH] export ia64_max_cacheline_size
  2005-11-04 23:52     ` Christoph Hellwig
@ 2005-11-05  0:05       ` Andrew Morton
  2005-11-05  4:35         ` John W. Linville
  0 siblings, 1 reply; 7+ messages in thread
From: Andrew Morton @ 2005-11-05  0:05 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: hch, davej, linux-kernel

Christoph Hellwig <hch@infradead.org> wrote:
>
> On Fri, Nov 04, 2005 at 02:55:34PM -0800, Andrew Morton wrote:
> > > Can we please move dma_get_cache_alignment() out of line instead?
> > 
> > It's a single statement!  It wants to be inlined.
> > 
> > > Always export sane APIs instead of random internals.
> > 
> > The exported API is dma_get_cache_alignment().  For internal implementation
> > reasons we need to export an ia64 symbol to modules to support it.  That
> > kinda sucks, but I don't think that we need to compromise kernel size and
> > performance because of it.
> 
> It's an API used only in slow pathes.  It's much better to enforce modularity
> in that case.

hm, spose so.  Putting it into .c means that all arches except one
implement it under include/, which is also a bit irritating sometimes, such
as $EDITOR include/asm-*/dma-mapping.h.

It's a 51%/49% decision, but I'm not sure which way.

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

* Re: [PATCH] export ia64_max_cacheline_size
  2005-11-05  0:05       ` Andrew Morton
@ 2005-11-05  4:35         ` John W. Linville
  2005-11-05  4:37           ` [patch 2.6.14] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL John W. Linville
  0 siblings, 1 reply; 7+ messages in thread
From: John W. Linville @ 2005-11-05  4:35 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Christoph Hellwig, davej, linux-kernel

On Fri, Nov 04, 2005 at 04:05:40PM -0800, Andrew Morton wrote:
> Christoph Hellwig <hch@infradead.org> wrote:

> > It's an API used only in slow pathes.  It's much better to enforce modularity
> > in that case.
> 
> hm, spose so.  Putting it into .c means that all arches except one
> implement it under include/, which is also a bit irritating sometimes, such
> as $EDITOR include/asm-*/dma-mapping.h.
> 
> It's a 51%/49% decision, but I'm not sure which way.

I posted a patch for this mid-September.  (Actually, I posted two.
The first one was basically identical to davej's, and Christoph
disliked it... :-)

	http://marc.theaimsgroup.com/?l=linux-kernel&m=112657055513967&w=2

I had hoped that it would get mainlined well before the b44 patch,
but apparently it fell through the cracks.  The patch still applies,
so I'll follow-up with it after this message.

John
-- 
John W. Linville
linville@tuxdriver.com

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

* [patch 2.6.14] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL
  2005-11-05  4:35         ` John W. Linville
@ 2005-11-05  4:37           ` John W. Linville
  0 siblings, 0 replies; 7+ messages in thread
From: John W. Linville @ 2005-11-05  4:37 UTC (permalink / raw)
  To: Andrew Morton, Christoph Hellwig, davej, linux-kernel

The current ia64 implementation of dma_get_cache_alignment does not
work for modules because it relies on a symbol which is not exported.
Direct access to a global is a little ugly anyway, so this patch
re-implements dma_get_cache_alignment in a manner similar to what is
currently used for x86_64.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
This patch replaces the patch at the link below:

	http://www.ussg.iu.edu/hypermail/linux/kernel/0509.1/1365.html

 arch/ia64/kernel/setup.c       |    7 +++++++
 include/asm-ia64/dma-mapping.h |    7 +------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index fc56ca2..3af6de3 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -92,6 +92,13 @@ extern void efi_initialize_iomem_resourc
 extern char _text[], _end[], _etext[];
 
 unsigned long ia64_max_cacheline_size;
+
+int dma_get_cache_alignment(void)
+{
+        return ia64_max_cacheline_size;
+}
+EXPORT_SYMBOL(dma_get_cache_alignment);
+
 unsigned long ia64_iobase;	/* virtual address for I/O accesses */
 EXPORT_SYMBOL(ia64_iobase);
 struct io_space io_space[MAX_IO_SPACES];
diff --git a/include/asm-ia64/dma-mapping.h b/include/asm-ia64/dma-mapping.h
index 6347c98..df67d40 100644
--- a/include/asm-ia64/dma-mapping.h
+++ b/include/asm-ia64/dma-mapping.h
@@ -48,12 +48,7 @@ dma_set_mask (struct device *dev, u64 ma
 	return 0;
 }
 
-static inline int
-dma_get_cache_alignment (void)
-{
-	extern int ia64_max_cacheline_size;
-	return ia64_max_cacheline_size;
-}
+extern int dma_get_cache_alignment(void);
 
 static inline void
 dma_cache_sync (void *vaddr, size_t size, enum dma_data_direction dir)
-- 
John W. Linville
linville@tuxdriver.com

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

end of thread, other threads:[~2005-11-05  4:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-04 22:07 [PATCH] export ia64_max_cacheline_size Dave Jones
2005-11-04 22:34 ` Christoph Hellwig
2005-11-04 22:55   ` Andrew Morton
2005-11-04 23:52     ` Christoph Hellwig
2005-11-05  0:05       ` Andrew Morton
2005-11-05  4:35         ` John W. Linville
2005-11-05  4:37           ` [patch 2.6.14] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox