public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.13] ia64: add EXPORT_SYMBOL_GPL for ia64_max_cacheline_size
@ 2005-09-12 14:48 John W. Linville
  2005-09-12 19:25 ` Christoph Hellwig
  0 siblings, 1 reply; 7+ messages in thread
From: John W. Linville @ 2005-09-12 14:48 UTC (permalink / raw)
  To: linux-kernel, linux-ia64; +Cc: tony.luck

The implementation of dma_get_cache_alignment for ia64 makes reference
to ia64_max_cacheline_size inside of a static inline. For this to
work for modules, this needs to be EXPORT_SYMBOL{,_GPL}.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---

 arch/ia64/kernel/setup.c |    1 +
 1 files changed, 1 insertion(+)

diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -79,6 +79,7 @@ unsigned long vga_console_iobase;
 unsigned long vga_console_membase;
 
 unsigned long ia64_max_cacheline_size;
+EXPORT_SYMBOL_GPL(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 2.6.13] ia64: add EXPORT_SYMBOL_GPL for ia64_max_cacheline_size
  2005-09-12 14:48 [patch 2.6.13] ia64: add EXPORT_SYMBOL_GPL for ia64_max_cacheline_size John W. Linville
@ 2005-09-12 19:25 ` Christoph Hellwig
  2005-09-13  0:06   ` John W. Linville
  0 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2005-09-12 19:25 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-kernel, linux-ia64, tony.luck

On Mon, Sep 12, 2005 at 10:48:52AM -0400, John W. Linville wrote:
> The implementation of dma_get_cache_alignment for ia64 makes reference
> to ia64_max_cacheline_size inside of a static inline. For this to
> work for modules, this needs to be EXPORT_SYMBOL{,_GPL}.

This is not supposed to be a _GPL api.  best just move
dma_get_cache_alignment out of line.


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

* Re: [patch 2.6.13] ia64: add EXPORT_SYMBOL_GPL for ia64_max_cacheline_size
  2005-09-12 19:25 ` Christoph Hellwig
@ 2005-09-13  0:06   ` John W. Linville
  2005-09-13  0:14     ` [patch 2.6.13] 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-09-13  0:06 UTC (permalink / raw)
  To: Christoph Hellwig, linux-kernel, linux-ia64, tony.luck

On Mon, Sep 12, 2005 at 08:25:24PM +0100, Christoph Hellwig wrote:
> On Mon, Sep 12, 2005 at 10:48:52AM -0400, John W. Linville wrote:
> > The implementation of dma_get_cache_alignment for ia64 makes reference
> > to ia64_max_cacheline_size inside of a static inline. For this to
> > work for modules, this needs to be EXPORT_SYMBOL{,_GPL}.
> 
> This is not supposed to be a _GPL api.  best just move
> dma_get_cache_alignment out of line.

You are thinking of something like the x86_64 implementation?
That seems reasonable to me.  Patch to follow...

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

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

* [patch 2.6.13] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL
  2005-09-13  0:06   ` John W. Linville
@ 2005-09-13  0:14     ` John W. Linville
  2005-09-13  9:24       ` Christoph Hellwig
  2005-09-13 12:25       ` Lion Vollnhals
  0 siblings, 2 replies; 7+ messages in thread
From: John W. Linville @ 2005-09-13  0:14 UTC (permalink / raw)
  To: Christoph Hellwig, linux-kernel, linux-ia64, tony.luck

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
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -79,6 +79,13 @@ unsigned long vga_console_iobase;
 unsigned long vga_console_membase;
 
 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
--- 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	[flat|nested] 7+ messages in thread

* Re: [patch 2.6.13] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL
  2005-09-13  0:14     ` [patch 2.6.13] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL John W. Linville
@ 2005-09-13  9:24       ` Christoph Hellwig
  2005-09-13 12:25       ` Lion Vollnhals
  1 sibling, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2005-09-13  9:24 UTC (permalink / raw)
  To: Christoph Hellwig, linux-kernel, linux-ia64, tony.luck

On Mon, Sep 12, 2005 at 08:14:29PM -0400, John W. Linville wrote:
> 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.

looks good to me.


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

* Re: [patch 2.6.13] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL
  2005-09-13  0:14     ` [patch 2.6.13] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL John W. Linville
  2005-09-13  9:24       ` Christoph Hellwig
@ 2005-09-13 12:25       ` Lion Vollnhals
  1 sibling, 0 replies; 7+ messages in thread
From: Lion Vollnhals @ 2005-09-13 12:25 UTC (permalink / raw)
  To: John W. Linville; +Cc: Christoph Hellwig, linux-kernel, linux-ia64, tony.luck

>  unsigned long ia64_max_cacheline_size;
> +
> +int dma_get_cache_alignment(void)
> +{
> +        return ia64_max_cacheline_size;
> +}
> +EXPORT_SYMBOL(dma_get_cache_alignment);
> +

Are you intentionally returning an "int" instead of an "unsigned long"?

-- 
Lion Vollnhals

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

* RE: [patch 2.6.13] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL
@ 2005-09-13 16:45 Luck, Tony
  0 siblings, 0 replies; 7+ messages in thread
From: Luck, Tony @ 2005-09-13 16:45 UTC (permalink / raw)
  To: Lion Vollnhals, John W. Linville
  Cc: Christoph Hellwig, linux-kernel, linux-ia64

>>  unsigned long ia64_max_cacheline_size;
>> +
>> +int dma_get_cache_alignment(void)
>> +{
>> +        return ia64_max_cacheline_size;
>> +}
>> +EXPORT_SYMBOL(dma_get_cache_alignment);
>> +
>
>Are you intentionally returning an "int" instead of an "unsigned long"?

The old version used to return int, as does the the version
on other architectures.  The problem appears to be the
definition "unsigned long ia64_max_cacheline_size;"

I think an int should be plenty big enough :-)

-Tony

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

end of thread, other threads:[~2005-09-13 16:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-12 14:48 [patch 2.6.13] ia64: add EXPORT_SYMBOL_GPL for ia64_max_cacheline_size John W. Linville
2005-09-12 19:25 ` Christoph Hellwig
2005-09-13  0:06   ` John W. Linville
2005-09-13  0:14     ` [patch 2.6.13] ia64: re-implement dma_get_cache_alignment to avoid EXPORT_SYMBOL John W. Linville
2005-09-13  9:24       ` Christoph Hellwig
2005-09-13 12:25       ` Lion Vollnhals
  -- strict thread matches above, loose matches on Subject: below --
2005-09-13 16:45 Luck, Tony

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