qemu-e2k/hw
Guenter Roeck 1a391e20c3 hw/timer/exynos4210_mct: Initialize ptimer before starting it
When booting a recent Linux kernel, the qemu message "Timer with delta
zero, disabling" is seen, apparently because a ptimer is started before
being initialized.  Fix the problem by initializing the offending ptimer
before starting it.

The bug is effectively harmless in the old QEMUBH setup
because the sequence of events is:
 * the delta zero means the timer expires immediately
 * ptimer_reload() arranges for exynos4210_gfrc_event() to be called
 * ptimer_reload() notices the zero delta and disables the timer
 * later, the QEMUBH runs, and exynos4210_gfrc_event() correctly
   configures the timer and restarts it

In the new transaction based API the bug is still harmless,
but differences of when the callback function runs mean the
message is not printed any more:
 * ptimer_run() does nothing as it's inside a transaction block
 * ptimer_transaction_commit() sees it has work to do and
   calls ptimer_reload()
 * the zero delta means the timer expires immediately
 * ptimer_reload() calls exynos4210_gfrc_event() directly
 * exynos4210_gfrc_event() configures the timer
 * the delta is no longer zero so ptimer_reload() doesn't complain
   (the zero-delta test is after the trigger-callback in
   the ptimer_reload() function)

Regardless, the behaviour here was not intentional, and we should
just program the ptimer correctly to start with.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20191018143149.9216-1-peter.maydell@linaro.org
[PMM: Expansion/clarification of the commit message:
 the message is about a zero delta, not a zero period;
 added detail to the commit message of the analysis of what
 is happening and why the kernel boots even with the message;
 added note that the message goes away with the new ptimer API]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-10-22 17:44:00 +01:00
..
9pfs 9p: Use variable length suffixes for inode remapping 2019-10-10 11:36:23 +02:00
acpi x86 and machine queue, 2019-10-15 2019-10-17 18:16:55 +01:00
adc Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
alpha Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
arm virtio, vhost, acpi: features, fixes, tests 2019-10-17 15:30:44 +01:00
audio audio: remove audio_MIN, audio_MAX 2019-08-21 09:13:37 +02:00
block m25p80: Add support for w25q512jv 2019-10-15 18:09:05 +01:00
bt Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
char hw/arm/bcm2835_peripherals: Improve logging 2019-10-15 18:09:05 +01:00
core numa: Introduce MachineClass::auto_enable_numa for implicit NUMA node 2019-10-15 18:18:08 -03:00
cpu hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
cris Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
display hw/arm/bcm2835_peripherals: Name various address spaces 2019-10-15 18:09:05 +01:00
dma hw/arm/bcm2835_peripherals: Name various address spaces 2019-10-15 18:09:05 +01:00
gpio hw/gpio: Add in AST2600 specific implementation 2019-10-15 18:09:04 +01:00
hppa hppa: fix leak from g_strdup_printf 2019-10-04 18:49:17 +02:00
hyperv Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
i2c aspeed/i2c: Add AST2600 support 2019-10-15 18:09:04 +01:00
i386 virtio, vhost, acpi: features, fixes, tests 2019-10-17 15:30:44 +01:00
ide hw/ide/via82c: Convert reset handler to DeviceReset 2019-10-15 18:18:08 -03:00
input hw/input/lm832x: Convert reset handler to DeviceReset 2019-10-15 18:18:08 -03:00
intc hw/arm/bcm2835_peripherals: Improve logging 2019-10-15 18:09:05 +01:00
ipack Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ipmi ipmi: Add an SMBus IPMI interface 2019-09-20 14:08:10 -05:00
isa hw/isa/vt82c686: Convert reset handler to DeviceReset 2019-10-15 18:18:08 -03:00
lm32 Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
m68k ptimer: Rename ptimer_init() to ptimer_init_with_bh() 2019-10-15 18:09:02 +01:00
mem memory-device: break the loop if tmp exceed the hinted range 2019-10-15 18:18:08 -03:00
microblaze microblaze: fix leak of fdevice tree blob 2019-10-04 18:49:16 +02:00
mips mips: fix memory leaks in board initialization 2019-10-04 18:49:17 +02:00
misc hw/misc/vmcoreinfo: Add comment about reset handler 2019-10-15 18:18:08 -03:00
moxie Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
net aspeed: add support for the Aspeed MII controller of the AST2600 2019-10-15 18:09:05 +01:00
nios2 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
nvram sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
openrisc Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
pci-bridge numa: move numa global variable nb_numa_nodes into MachineState 2019-09-03 11:26:55 -03:00
pci-host hw/core: Add a config switch for the "or-irq" device 2019-08-20 09:11:17 +02:00
pcmcia Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc numa: Introduce MachineClass::auto_enable_numa for implicit NUMA node 2019-10-15 18:18:08 -03:00
rdma sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
riscv riscv: sifive_u: Update model and compatible strings in device tree 2019-09-17 08:42:49 -07:00
s390x target/s390x: Remove ilen parameter from s390_program_interrupt 2019-10-09 12:49:01 +02:00
scsi scsi: account unmap operations 2019-10-10 10:56:18 +02:00
sd hw/sd/aspeed_sdhci: New device 2019-10-15 18:09:04 +01:00
semihosting Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
sh4 sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
smbios smbios:ipmi: Ignore IPMI devices with no fwinfo function 2019-09-20 14:08:10 -05:00
sparc sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
sparc64 hw/misc: Add a config switch for the "unimplemented" device 2019-08-20 09:11:17 +02:00
ssi aspeed/smc: Add AST2600 support 2019-10-15 18:09:04 +01:00
timer hw/timer/exynos4210_mct: Initialize ptimer before starting it 2019-10-22 17:44:00 +01:00
tpm Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
tricore Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
unicore32 Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
usb usbaudio: change playback counters to 64 bit 2019-10-18 08:14:05 +02:00
vfio hw/vfio/pci: fix double free in vfio_msi_disable 2019-10-10 11:07:28 -06:00
virtio virtio, vhost, acpi: features, fixes, tests 2019-10-17 15:30:44 +01:00
watchdog hw: wdt_aspeed: Add AST2600 support 2019-10-15 18:09:04 +01:00
xen xen-bus: only set the xen device frontend state if it is missing 2019-09-24 12:21:29 +01:00
xenpv Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xtensa sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
Kconfig hw/core: Add a config switch for the "register" device 2019-08-20 09:11:05 +02:00
Makefile.objs Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs 2019-07-15 20:58:37 +02:00