powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart
PATCH 3/4 powerpc: Add EXPORT_SYMBOL_GPL for symbols required by fs_enet and cpm_uart
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
--- arch/powerpc/sysdev/commproc.c | 3 +++ arch/powerpc/sysdev/cpm2_common.c | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-)
arch/powerpc/sysdev/commproc.c +3 -0
@@ -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 /*
arch/powerpc/sysdev/cpm2_common.c +3 -0
@@ -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.
Signature · 1 line
1.5.3.4
Quoted 3 lines · Jochen Friedrich
fs_enetandcpm_uartneed symbols fromcommproc.c(for CPM1) orcpm2_common.c. AddEXPORT_SYMBOL_GPLfor cpmp,cpm_setbrgandcpm2_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?
Signature · 2 lines
Timur Tabi Linux Kernel Developer @ Freescale
Quoted 7 lines · Timur Tabi
Quoted 3 lines · Jochen Friedrich
fs_enetandcpm_uartneed symbols fromcommproc.c(for CPM1) orcpm2_common.c. AddEXPORT_SYMBOL_GPLfor cpmp,cpm_setbrgandcpm2_immr, so the drivers can be compiled as modules.Maybe this is a stupid question, but why did you choose
EXPORT_SYMBOL_GPLand notEXPORT_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.
Quoted 9 lines
--
Timur Tabi
Linux Kernel Developer @ Freescale
_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-dev
Signature · 2 lines
Jon Smirl [email protected]
Quoted 4 lines · On Sun, 25 Nov 2007 09:38:57 -0600 Timur Tabi wrote:
Quoted 3 lines · Jochen Friedrich
fs_enetandcpm_uartneed symbols fromcommproc.c(for CPM1) orcpm2_common.c. AddEXPORT_SYMBOL_GPLfor cpmp,cpm_setbrgandcpm2_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.
Quoted 4 lines
Maybe this is a stupid question, but why did you choose
EXPORT_SYMBOL_GPLand notEXPORT_SYMBOL?
To prevent using those pointers from within non-GPL modules. kind of policy now...
Signature · 1 line
Sincerely, Vitaly
Quoted 1 line · Vitaly Bordug
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
Quoted 8 lines · On Sun, 25 Nov 2007 13:02:03 -0800 Dan Malek wrote:
Quoted 2 lines · Vitaly Bordug
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.
Signature · 1 line
Sincerely, Vitaly
Hi Vitaly,
Quoted 4 lines
Quoted 3 lines
Maybe this is a stupid question, but why did you choose
EXPORT_SYMBOL_GPLand notEXPORT_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