diff mbox

[4/9] ARM: export default read_current_timer

Message ID 50744586.6010806@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jonathan Austin Oct. 9, 2012, 3:40 p.m. UTC
Hi Arnd,

On 09/10/12 16:22, Arnd Bergmann wrote:

> read_current_timer is used by get_cycles since "ARM: 7538/1: delay:
> add registration mechanism for delay timer sources", and get_cycles
> can be used by device drivers in loadable modules, so it has to
> be exported.
> 
> Without this patch, building imote2_defconfig fails with
> 
> ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined!
[...]

>  arch/arm/lib/delay.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
> index 9d0a300..0dc5385 100644
> --- a/arch/arm/lib/delay.c
> +++ b/arch/arm/lib/delay.c
> @@ -45,6 +45,7 @@ int read_current_timer(unsigned long *timer_val)
>  	*timer_val = delay_timer->read_current_timer();
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(read_current_timer);


Perhaps this fits better in armksyms.c? That way it lives with
arm_delay_ops and friends.

I've got a patch doing it like that, which I can put in Russell's
patch-system, unless you prefer doing it in delay.c for any reason?

Jonny

(Here's the original patch sent to the kernel-janitors list and Will Deacon)
-------8<---------
On ARM, get_cycles() is implemented in terms of read_current_timer(), but
the latter is not exported to modules, resulting in failure to link:

  ERROR: "read_current_timer" [fs/ext4/ext4.ko] undefined!

This patch exports the symbol as required.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>
---
 arch/arm/kernel/armksyms.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Russell King - ARM Linux Oct. 9, 2012, 4:06 p.m. UTC | #1
On Tue, Oct 09, 2012 at 04:40:54PM +0100, Jonathan Austin wrote:
> Hi Arnd,
> 
> On 09/10/12 16:22, Arnd Bergmann wrote:
> > diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
> > index 9d0a300..0dc5385 100644
> > --- a/arch/arm/lib/delay.c
> > +++ b/arch/arm/lib/delay.c
> > @@ -45,6 +45,7 @@ int read_current_timer(unsigned long *timer_val)
> >  	*timer_val = delay_timer->read_current_timer();
> >  	return 0;
> >  }
> > +EXPORT_SYMBOL_GPL(read_current_timer);
> 
> 
> Perhaps this fits better in armksyms.c? That way it lives with
> arm_delay_ops and friends.

It's always much better to put things next to where they're defined
rather than spreading them around.

armksyms.c is a reminant of the 1.x days of doing things... but still
remains to allow what are mostly assembly symbols to be exported.
Alexander Holler Oct. 18, 2012, 8:43 a.m. UTC | #2
Am 09.10.2012 18:06, schrieb Russell King - ARM Linux:
> On Tue, Oct 09, 2012 at 04:40:54PM +0100, Jonathan Austin wrote:
>> Hi Arnd,
>>
>> On 09/10/12 16:22, Arnd Bergmann wrote:
>>> diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
>>> index 9d0a300..0dc5385 100644
>>> --- a/arch/arm/lib/delay.c
>>> +++ b/arch/arm/lib/delay.c
>>> @@ -45,6 +45,7 @@ int read_current_timer(unsigned long *timer_val)
>>>   	*timer_val = delay_timer->read_current_timer();
>>>   	return 0;
>>>   }
>>> +EXPORT_SYMBOL_GPL(read_current_timer);
>>
>>
>> Perhaps this fits better in armksyms.c? That way it lives with
>> arm_delay_ops and friends.
>
> It's always much better to put things next to where they're defined
> rather than spreading them around.
>
> armksyms.c is a reminant of the 1.x days of doing things... but still
> remains to allow what are mostly assembly symbols to be exported.

I needed that to build udlfb as a module.

For the 3.6 stable kernels this has to be done in
arch/arm/kernel/arch_timer.c (along with an #include <linux/export.h>)

So I'm not sure if an Cc: <stable@vger.kernel.org> can be used here, but 
a patch should be submitted for inclusion into the 3.6 stable series too.

Regards,

Alexander
diff mbox

Patch

diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c
index 60d3b73..6a37f8d 100644
--- a/arch/arm/kernel/armksyms.c
+++ b/arch/arm/kernel/armksyms.c
@@ -50,6 +50,7 @@  extern void fpundefinstr(void);
 
        /* platform dependent support */
 EXPORT_SYMBOL(arm_delay_ops);
+EXPORT_SYMBOL(read_current_timer);
 
        /* networking */
 EXPORT_SYMBOL(csum_partial);