All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/1] x86: qemu-x86 requires CONFIG_SYS_HZ=2000
@ 2018-09-06  6:06 Heinrich Schuchardt
  2018-09-06  6:49 ` Bin Meng
  0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2018-09-06  6:06 UTC (permalink / raw)
  To: u-boot

The sleep command only provides correct timings for
CONFIG_SYS_HZ=2000 on qemu-x86_defconfig.

This can be tested with

    date && sleep 4 && date

Make CONFIG_SYS_HZ editable.
Set it in qemu-x86_defconfig to 2000.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 configs/qemu-x86_defconfig | 1 +
 lib/Kconfig                | 4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/configs/qemu-x86_defconfig b/configs/qemu-x86_defconfig
index 12ea72f562..8fc725dcc4 100644
--- a/configs/qemu-x86_defconfig
+++ b/configs/qemu-x86_defconfig
@@ -51,3 +51,4 @@ CONFIG_FRAMEBUFFER_SET_VESA_MODE=y
 CONFIG_FRAMEBUFFER_VESA_MODE_USER=y
 CONFIG_FRAMEBUFFER_VESA_MODE=0x144
 CONFIG_CONSOLE_SCROLL_LINES=5
+CONFIG_SYS_HZ=2000
diff --git a/lib/Kconfig b/lib/Kconfig
index 622f3c26c3..f37db20593 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -82,12 +82,10 @@ config USE_PRIVATE_LIBGCC
 	  If unsure, say N.
 
 config SYS_HZ
-	int
+	int "Frequency of the timer"
 	default 1000
 	help
 	  The frequency of the timer returned by get_timer().
-	  get_timer() must operate in milliseconds and this option must be
-	  set to 1000.
 
 config USE_TINY_PRINTF
 	bool "Enable tiny printf() version"
-- 
2.18.0

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

* [U-Boot] [PATCH 1/1] x86: qemu-x86 requires CONFIG_SYS_HZ=2000
  2018-09-06  6:06 [U-Boot] [PATCH 1/1] x86: qemu-x86 requires CONFIG_SYS_HZ=2000 Heinrich Schuchardt
@ 2018-09-06  6:49 ` Bin Meng
  2018-09-06  6:55   ` Bin Meng
  0 siblings, 1 reply; 5+ messages in thread
From: Bin Meng @ 2018-09-06  6:49 UTC (permalink / raw)
  To: u-boot

Hi Heinrich,

On Thu, Sep 6, 2018 at 2:06 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> The sleep command only provides correct timings for
> CONFIG_SYS_HZ=2000 on qemu-x86_defconfig.
>
> This can be tested with
>
>     date && sleep 4 && date

With current u-boot/master, with the same test command you provided, I got:

=> date && sleep 4 && date
Date: 2018-09-06 (Thursday)    Time:  6:47:28
Date: 2018-09-06 (Thursday)    Time:  6:47:32
=> date && sleep 4 && date
Date: 2018-09-06 (Thursday)    Time:  6:47:41
Date: 2018-09-06 (Thursday)    Time:  6:47:45
=> date && sleep 4 && date
Date: 2018-09-06 (Thursday)    Time:  6:47:47
Date: 2018-09-06 (Thursday)    Time:  6:47:51

It seems there is no issue.

QEMU was invoked like this: qemu-system-i386 -nographic -bios u-boot.rom

>
> Make CONFIG_SYS_HZ editable.
> Set it in qemu-x86_defconfig to 2000.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  configs/qemu-x86_defconfig | 1 +
>  lib/Kconfig                | 4 +---
>  2 files changed, 2 insertions(+), 3 deletions(-)
>

[snip]

Regards,
Bin

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

* [U-Boot] [PATCH 1/1] x86: qemu-x86 requires CONFIG_SYS_HZ=2000
  2018-09-06  6:49 ` Bin Meng
@ 2018-09-06  6:55   ` Bin Meng
  2018-09-06  7:29     ` Heinrich Schuchardt
  0 siblings, 1 reply; 5+ messages in thread
From: Bin Meng @ 2018-09-06  6:55 UTC (permalink / raw)
  To: u-boot

On Thu, Sep 6, 2018 at 2:49 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Heinrich,
>
> On Thu, Sep 6, 2018 at 2:06 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >
> > The sleep command only provides correct timings for
> > CONFIG_SYS_HZ=2000 on qemu-x86_defconfig.
> >
> > This can be tested with
> >
> >     date && sleep 4 && date
>
> With current u-boot/master, with the same test command you provided, I got:
>
> => date && sleep 4 && date
> Date: 2018-09-06 (Thursday)    Time:  6:47:28
> Date: 2018-09-06 (Thursday)    Time:  6:47:32
> => date && sleep 4 && date
> Date: 2018-09-06 (Thursday)    Time:  6:47:41
> Date: 2018-09-06 (Thursday)    Time:  6:47:45
> => date && sleep 4 && date
> Date: 2018-09-06 (Thursday)    Time:  6:47:47
> Date: 2018-09-06 (Thursday)    Time:  6:47:51
>
> It seems there is no issue.
>
> QEMU was invoked like this: qemu-system-i386 -nographic -bios u-boot.rom

with '-smp 4', the issue still cannot be reproduced.

I am using QEMU 2.5.0, shipped by Ubuntu 16.04.

Regards,
Bin

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

* [U-Boot] [PATCH 1/1] x86: qemu-x86 requires CONFIG_SYS_HZ=2000
  2018-09-06  6:55   ` Bin Meng
@ 2018-09-06  7:29     ` Heinrich Schuchardt
  2018-09-06  9:12       ` Bin Meng
  0 siblings, 1 reply; 5+ messages in thread
From: Heinrich Schuchardt @ 2018-09-06  7:29 UTC (permalink / raw)
  To: u-boot



On 09/06/2018 08:55 AM, Bin Meng wrote:
> On Thu, Sep 6, 2018 at 2:49 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>>
>> Hi Heinrich,
>>
>> On Thu, Sep 6, 2018 at 2:06 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>>>
>>> The sleep command only provides correct timings for
>>> CONFIG_SYS_HZ=2000 on qemu-x86_defconfig.
>>>
>>> This can be tested with
>>>
>>>     date && sleep 4 && date
>>
>> With current u-boot/master, with the same test command you provided, I got:
>>
>> => date && sleep 4 && date
>> Date: 2018-09-06 (Thursday)    Time:  6:47:28
>> Date: 2018-09-06 (Thursday)    Time:  6:47:32
>> => date && sleep 4 && date
>> Date: 2018-09-06 (Thursday)    Time:  6:47:41
>> Date: 2018-09-06 (Thursday)    Time:  6:47:45
>> => date && sleep 4 && date
>> Date: 2018-09-06 (Thursday)    Time:  6:47:47
>> Date: 2018-09-06 (Thursday)    Time:  6:47:51
>>
>> It seems there is no issue.
>>
>> QEMU was invoked like this: qemu-system-i386 -nographic -bios u-boot.rom
> 
> with '-smp 4', the issue still cannot be reproduced.
> 
> I am using QEMU 2.5.0, shipped by Ubuntu 16.04.
> 
> Regards,
> Bin
> 
Hello Bin,

thanks for testing.

I reran my tests with the same Debian Buster release and QEMU 2.12.0 on
two machines, one with Intel CPU one with AMD Ryzen and I get different
results.

So my suggestion would be that I reduce the patch to only change
lib/Kconfig to make CONFIG_SYS_HZ editable and keep the 1000 Hz default
value. That way corrections become possible in .config. And we keep the
defconfig as it is.

Best regards

Heinrich

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

* [U-Boot] [PATCH 1/1] x86: qemu-x86 requires CONFIG_SYS_HZ=2000
  2018-09-06  7:29     ` Heinrich Schuchardt
@ 2018-09-06  9:12       ` Bin Meng
  0 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2018-09-06  9:12 UTC (permalink / raw)
  To: u-boot

Hi Heinrich,

On Thu, Sep 6, 2018 at 3:30 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
>
>
> On 09/06/2018 08:55 AM, Bin Meng wrote:
> > On Thu, Sep 6, 2018 at 2:49 PM Bin Meng <bmeng.cn@gmail.com> wrote:
> >>
> >> Hi Heinrich,
> >>
> >> On Thu, Sep 6, 2018 at 2:06 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> >>>
> >>> The sleep command only provides correct timings for
> >>> CONFIG_SYS_HZ=2000 on qemu-x86_defconfig.
> >>>
> >>> This can be tested with
> >>>
> >>>     date && sleep 4 && date
> >>
> >> With current u-boot/master, with the same test command you provided, I got:
> >>
> >> => date && sleep 4 && date
> >> Date: 2018-09-06 (Thursday)    Time:  6:47:28
> >> Date: 2018-09-06 (Thursday)    Time:  6:47:32
> >> => date && sleep 4 && date
> >> Date: 2018-09-06 (Thursday)    Time:  6:47:41
> >> Date: 2018-09-06 (Thursday)    Time:  6:47:45
> >> => date && sleep 4 && date
> >> Date: 2018-09-06 (Thursday)    Time:  6:47:47
> >> Date: 2018-09-06 (Thursday)    Time:  6:47:51
> >>
> >> It seems there is no issue.
> >>
> >> QEMU was invoked like this: qemu-system-i386 -nographic -bios u-boot.rom
> >
> > with '-smp 4', the issue still cannot be reproduced.
> >
> > I am using QEMU 2.5.0, shipped by Ubuntu 16.04.
> >
> > Regards,
> > Bin
> >
> Hello Bin,
>
> thanks for testing.
>
> I reran my tests with the same Debian Buster release and QEMU 2.12.0 on
> two machines, one with Intel CPU one with AMD Ryzen and I get different
> results.
>
> So my suggestion would be that I reduce the patch to only change
> lib/Kconfig to make CONFIG_SYS_HZ editable and keep the 1000 Hz default
> value. That way corrections become possible in .config. And we keep the
> defconfig as it is.
>

Sound good to me.

Regards,
Bin

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

end of thread, other threads:[~2018-09-06  9:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  6:06 [U-Boot] [PATCH 1/1] x86: qemu-x86 requires CONFIG_SYS_HZ=2000 Heinrich Schuchardt
2018-09-06  6:49 ` Bin Meng
2018-09-06  6:55   ` Bin Meng
2018-09-06  7:29     ` Heinrich Schuchardt
2018-09-06  9:12       ` Bin Meng

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.