All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hvc_opal: don't set tb_ticks_per_usec in udbg_init_opal_common()
@ 2018-03-29  6:02 Stewart Smith
  2018-06-04 14:10 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Stewart Smith @ 2018-03-29  6:02 UTC (permalink / raw)
  To: linuxppc-dev, benh, mpe; +Cc: Stewart Smith

time_init() will set up tb_ticks_per_usec based on reality.
time_init() is called *after* udbg_init_opal_common() during boot.

from arch/powerpc/kernel/time.c:
  unsigned long tb_ticks_per_usec = 100; /* sane default */

Currently, all powernv systems have a timebase frequency of 512mhz
(512000000/1000000 == 0x200) - although there's nothing written
down anywhere that I can find saying that we couldn't make that
different based on the requirements in the ISA.

So, we've been (accidentally) thwacking the (currently) correct
(for powernv at least) value for tb_ticks_per_usec earlier than
we otherwise would have.

The "sane default" seems to be adequate for our purposes between
udbg_init_opal_common() and time_init() being called, and if it isn't,
then we should probably be setting it somewhere that isn't hvc_opal.c!

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 drivers/tty/hvc/hvc_opal.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index 2ed07ca6389e..9645c0062a90 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -318,7 +318,6 @@ static void udbg_init_opal_common(void)
 	udbg_putc = udbg_opal_putc;
 	udbg_getc = udbg_opal_getc;
 	udbg_getc_poll = udbg_opal_getc_poll;
-	tb_ticks_per_usec = 0x200; /* Make udelay not suck */
 }
 
 void __init hvc_opal_init_early(void)
-- 
2.14.3

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

* Re: hvc_opal: don't set tb_ticks_per_usec in udbg_init_opal_common()
  2018-03-29  6:02 [PATCH] hvc_opal: don't set tb_ticks_per_usec in udbg_init_opal_common() Stewart Smith
@ 2018-06-04 14:10 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-06-04 14:10 UTC (permalink / raw)
  To: Stewart Smith, linuxppc-dev, benh; +Cc: Stewart Smith

On Thu, 2018-03-29 at 06:02:46 UTC, Stewart Smith wrote:
> time_init() will set up tb_ticks_per_usec based on reality.
> time_init() is called *after* udbg_init_opal_common() during boot.
> 
> from arch/powerpc/kernel/time.c:
>   unsigned long tb_ticks_per_usec = 100; /* sane default */
> 
> Currently, all powernv systems have a timebase frequency of 512mhz
> (512000000/1000000 == 0x200) - although there's nothing written
> down anywhere that I can find saying that we couldn't make that
> different based on the requirements in the ISA.
> 
> So, we've been (accidentally) thwacking the (currently) correct
> (for powernv at least) value for tb_ticks_per_usec earlier than
> we otherwise would have.
> 
> The "sane default" seems to be adequate for our purposes between
> udbg_init_opal_common() and time_init() being called, and if it isn't,
> then we should probably be setting it somewhere that isn't hvc_opal.c!
> 
> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/447808bf500a7cc92173266a59f8a4

cheers

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

end of thread, other threads:[~2018-06-04 14:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29  6:02 [PATCH] hvc_opal: don't set tb_ticks_per_usec in udbg_init_opal_common() Stewart Smith
2018-06-04 14:10 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.