[PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE6863d REVIEWED: 1 (0M)

1 review trailer.

7 messages, 5 authors, 2007-11-26 · open the first message on its own page

[PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart

From: Jochen Friedrich <jochen@scram.de>
Date: 2007-11-22 17:35:17

fs_enet and cpm_uart need symbols from commproc.c (for CPM1) or
cpm2_common.c. Add EXPORT_SYMBOL_GPL for cpmp, cpm_setbrg and cpm2_immr,
so the drivers can be compiled as modules.

  Building modules, stage 2.
  MODPOST 5 modules
ERROR: "cpm2_immr" [drivers/net/fs_enet/fs_enet.ko] undefined!
ERROR: "cpmp" [drivers/net/fs_enet/fs_enet.ko] undefined!
make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2

Signed-off-by: Jochen Friedrich <jochen@scram.de>
Acked-by: Scott Wood <redacted>
---
 arch/powerpc/sysdev/commproc.c    |    3 +++
 arch/powerpc/sysdev/cpm2_common.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c
index f6a6378..ddbe138 100644
--- a/arch/powerpc/sysdev/commproc.c
+++ b/arch/powerpc/sysdev/commproc.c
@@ -51,6 +51,8 @@ static void m8xx_cpm_dpinit(void);
 static uint host_buffer; /* One page of host buffer */
 static uint host_end;    /* end + 1 */
 cpm8xx_t __iomem *cpmp;  /* Pointer to comm processor space */
+EXPORT_SYMBOL_GPL(cpmp);
+
 immap_t __iomem *mpc8xx_immr;
 static cpic8xx_t __iomem *cpic_reg;
@@ -302,6 +304,7 @@ cpm_setbrg(uint brg, uint rate)
 		out_be32(bp, (((BRG_UART_CLK_DIV16 / rate) - 1) << 1) |
 		             CPM_BRG_EN | CPM_BRG_DIV16);
 }
+EXPORT_SYMBOL_GPL(cpm_setbrg);

 #ifndef CONFIG_PPC_CPM_NEW_BINDING
 /*
diff --git a/arch/powerpc/sysdev/cpm2_common.c b/arch/powerpc/sysdev/cpm2_common.c
index 859362f..b878a67 100644
--- a/arch/powerpc/sysdev/cpm2_common.c
+++ b/arch/powerpc/sysdev/cpm2_common.c
@@ -51,11 +51,13 @@ static void cpm2_dpinit(void);
 #endif

 cpm_cpm2_t __iomem *cpmp; /* Pointer to comm processor space */
+EXPORT_SYMBOL_GPL(cpmp);

 /* We allocate this here because it is used almost exclusively for
  * the communication processor devices.
  */
 cpm2_map_t __iomem *cpm2_immr;
+EXPORT_SYMBOL_GPL(cpm2_immr);

 #define CPM_MAP_SIZE	(0x40000)	/* 256k - the PQ3 reserve this amount
 					   of space for CPM as it is larger
@@ -117,6 +119,7 @@ cpm_setbrg(uint brg, uint rate)

 	cpm2_unmap(bp);
 }
+EXPORT_SYMBOL_GPL(cpm_setbrg);

 /* This function is used to set high speed synchronous baud rate
  * clocks.
-- 
1.5.3.4

Re: [PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart

From: Timur Tabi <hidden>
Date: 2007-11-25 15:41:21

Jochen Friedrich wrote:
fs_enet and cpm_uart need symbols from commproc.c (for CPM1) or
cpm2_common.c. Add EXPORT_SYMBOL_GPL for cpmp, cpm_setbrg and cpm2_immr,
so the drivers can be compiled as modules.
Maybe this is a stupid question, but why did you choose EXPORT_SYMBOL_GPL and 
not EXPORT_SYMBOL?

-- 
Timur Tabi
Linux Kernel Developer @ Freescale

Re: [PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart

From: Jon Smirl <hidden>
Date: 2007-11-25 15:58:11

On 11/25/07, Timur Tabi [off-list ref] wrote:
Jochen Friedrich wrote:
quoted
fs_enet and cpm_uart need symbols from commproc.c (for CPM1) or
cpm2_common.c. Add EXPORT_SYMBOL_GPL for cpmp, cpm_setbrg and cpm2_immr,
so the drivers can be compiled as modules.
Maybe this is a stupid question, but why did you choose EXPORT_SYMBOL_GPL and
not EXPORT_SYMBOL?
By marking all new exports EXPORT_SYMBOL_GPL it stops new closed
source device drivers from being built. We have to live the the
existing ones, but we certainly don't want to encourage any more to be
built.

Over on lkml there is a thread about moving all symbols of this type
into private name spaces and removing the exports in the final kernel
binary.
--
Timur Tabi
Linux Kernel Developer @ Freescale
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

-- 
Jon Smirl
jonsmirl@gmail.com

Re: [PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart

From: Vitaly Bordug <hidden>
Date: 2007-11-25 16:18:48

On Sun, 25 Nov 2007 09:38:57 -0600
Timur Tabi wrote:
Jochen Friedrich wrote:
quoted
fs_enet and cpm_uart need symbols from commproc.c (for CPM1) or
cpm2_common.c. Add EXPORT_SYMBOL_GPL for cpmp, cpm_setbrg and
cpm2_immr, so the drivers can be compiled as modules.
As I told replying to prev mail, this needs to be addressed in respective driver(s), since
there is a way to retrieve such pointers without making them global.

This patch will exist in maillist as a workaround, but meanwhile I'll take a look at this problem.
Maybe this is a stupid question, but why did you choose
EXPORT_SYMBOL_GPL and not EXPORT_SYMBOL?
To prevent using those pointers from within non-GPL modules. kind of policy now...

-- 
Sincerely, Vitaly

Re: [PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart

From: Dan Malek <hidden>
Date: 2007-11-25 21:10:35

On Nov 25, 2007, at 8:18 AM, Vitaly Bordug wrote:
To prevent using those pointers from within non-GPL modules. kind  
of policy now...
As the original copyright holder of nearly all of this of
this code, I do not wish this be done.

Thanks.

	-- Dan

Re: [PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart

From: Vitaly Bordug <hidden>
Date: 2007-11-26 10:28:27

On Sun, 25 Nov 2007 13:02:03 -0800
Dan Malek wrote:
On Nov 25, 2007, at 8:18 AM, Vitaly Bordug wrote:
quoted
To prevent using those pointers from within non-GPL modules. kind  
of policy now...
As the original copyright holder of nearly all of this of
this code, I do not wish this be done.
In this particular case this is not going to happen anyway, but I will take your opinion into
account for the similar cases.


-- 
Sincerely, Vitaly

Re: [PATCH revised 3/4] powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart

From: Jochen Friedrich <jochen@scram.de>
Date: 2007-11-26 11:15:28

Hi Vitaly,
quoted
Maybe this is a stupid question, but why did you choose
EXPORT_SYMBOL_GPL and not EXPORT_SYMBOL?
To prevent using those pointers from within non-GPL modules. kind of policy now...
In particular in this case, as these pointers are currently not exported, at all. They
are currently used by a few drivers and will disappear again once these drivers have
been converted to use the propper accessors, which will also prevent access conflicts
to the CPM registers.

Thanks,
Jochen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help