* [PATCH] time: export nsec_to_clock_t
@ 2018-03-28 14:11 Arnd Bergmann
2018-03-29 14:58 ` Zhang Rui
0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2018-03-28 14:11 UTC (permalink / raw)
To: John Stultz, Thomas Gleixner
Cc: Viresh Kumar, Zhang Rui, Arnd Bergmann, Stephen Boyd,
Deepa Dinamani, Al Viro, linux-kernel
nsec_to_clock_t was traditionally used only in the core kernel, now we
have a sysfs file that needs it from a loadable module, causing a
link-time error:
ERROR: "nsec_to_clock_t" [drivers/thermal/thermal_sys.ko] undefined!
This exports the function the same way that we do for related interfaces.
Fixes: 96cea33badc5 ("thermal: Add cooling device's statistics in sysfs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
kernel/time/time.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/time/time.c b/kernel/time/time.c
index 6fa99213fc72..97a262531f68 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -768,6 +768,7 @@ u64 nsec_to_clock_t(u64 x)
return div_u64(x * 9, (9ull * NSEC_PER_SEC + (USER_HZ / 2)) / USER_HZ);
#endif
}
+EXPORT_SYMBOL(nsec_to_clock_t);
u64 jiffies64_to_nsecs(u64 j)
{
--
2.9.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] time: export nsec_to_clock_t
2018-03-28 14:11 [PATCH] time: export nsec_to_clock_t Arnd Bergmann
@ 2018-03-29 14:58 ` Zhang Rui
2018-03-29 19:11 ` Thomas Gleixner
0 siblings, 1 reply; 4+ messages in thread
From: Zhang Rui @ 2018-03-29 14:58 UTC (permalink / raw)
To: Arnd Bergmann, John Stultz, Thomas Gleixner
Cc: Viresh Kumar, Stephen Boyd, Deepa Dinamani, Al Viro, linux-kernel
On 三, 2018-03-28 at 16:11 +0200, Arnd Bergmann wrote:
> nsec_to_clock_t was traditionally used only in the core kernel, now
> we
> have a sysfs file that needs it from a loadable module, causing a
> link-time error:
>
> ERROR: "nsec_to_clock_t" [drivers/thermal/thermal_sys.ko] undefined!
>
> This exports the function the same way that we do for related
> interfaces.
>
> Fixes: 96cea33badc5 ("thermal: Add cooling device's statistics in
> sysfs")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for the fix.
can I take this patch through thermal tree?
thanks,
rui
> ---
> kernel/time/time.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/kernel/time/time.c b/kernel/time/time.c
> index 6fa99213fc72..97a262531f68 100644
> --- a/kernel/time/time.c
> +++ b/kernel/time/time.c
> @@ -768,6 +768,7 @@ u64 nsec_to_clock_t(u64 x)
> return div_u64(x * 9, (9ull * NSEC_PER_SEC + (USER_HZ / 2))
> / USER_HZ);
> #endif
> }
> +EXPORT_SYMBOL(nsec_to_clock_t);
>
> u64 jiffies64_to_nsecs(u64 j)
> {
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] time: export nsec_to_clock_t
2018-03-29 14:58 ` Zhang Rui
@ 2018-03-29 19:11 ` Thomas Gleixner
2018-04-02 10:25 ` Viresh Kumar
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2018-03-29 19:11 UTC (permalink / raw)
To: Zhang Rui
Cc: Arnd Bergmann, John Stultz, Viresh Kumar, Stephen Boyd,
Deepa Dinamani, Al Viro, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 845 bytes --]
On Thu, 29 Mar 2018, Zhang Rui wrote:
> On 三, 2018-03-28 at 16:11 +0200, Arnd Bergmann wrote:
> > nsec_to_clock_t was traditionally used only in the core kernel, now
> > we
> > have a sysfs file that needs it from a loadable module, causing a
> > link-time error:
> >
> > ERROR: "nsec_to_clock_t" [drivers/thermal/thermal_sys.ko] undefined!
> >
> > This exports the function the same way that we do for related
> > interfaces.
> >
> > Fixes: 96cea33badc5 ("thermal: Add cooling device's statistics in
> > sysfs")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> Thanks for the fix.
> can I take this patch through thermal tree?
Well, the question is what's the point of that?
Why does a new interface expose time in state in clock_t instead in normal
time units, e.g. nsec/usec/msec ?
That makes no sense whatsoever.
Thanks,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] time: export nsec_to_clock_t
2018-03-29 19:11 ` Thomas Gleixner
@ 2018-04-02 10:25 ` Viresh Kumar
0 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2018-04-02 10:25 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Zhang Rui, Arnd Bergmann, John Stultz, Stephen Boyd,
Deepa Dinamani, Al Viro, linux-kernel, edubezval
On 29-03-18, 21:11, Thomas Gleixner wrote:
> On Thu, 29 Mar 2018, Zhang Rui wrote:
> > On 三, 2018-03-28 at 16:11 +0200, Arnd Bergmann wrote:
> > > nsec_to_clock_t was traditionally used only in the core kernel, now
> > > we
> > > have a sysfs file that needs it from a loadable module, causing a
> > > link-time error:
> > >
> > > ERROR: "nsec_to_clock_t" [drivers/thermal/thermal_sys.ko] undefined!
> > >
> > > This exports the function the same way that we do for related
> > > interfaces.
> > >
> > > Fixes: 96cea33badc5 ("thermal: Add cooling device's statistics in
> > > sysfs")
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> >
> > Thanks for the fix.
> > can I take this patch through thermal tree?
>
> Well, the question is what's the point of that?
>
> Why does a new interface expose time in state in clock_t instead in normal
> time units, e.g. nsec/usec/msec ?
The initial patch was displaying the values in msec, but eduardo asked the units
to be consistent with how cpufreq shows it, i.e. clock_t.
https://lkml.kernel.org/r/20180112174606.GA11076@localhost.localdomain
Anyway I will resend the patch and move back to msec. Thanks.
--
viresh
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-02 10:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-28 14:11 [PATCH] time: export nsec_to_clock_t Arnd Bergmann
2018-03-29 14:58 ` Zhang Rui
2018-03-29 19:11 ` Thomas Gleixner
2018-04-02 10:25 ` Viresh Kumar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).