qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH-for-6.1 0/9] hw/clock: Strengthen machine (non-qdev) clock propagation
@ 2021-04-09  6:23 Philippe Mathieu-Daudé
  2021-04-09  6:23 ` [RFC PATCH-for-6.1 1/9] hw/core/clock: Increase clock propagation trace events verbosity Philippe Mathieu-Daudé
                   ` (10 more replies)
  0 siblings, 11 replies; 30+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-09  6:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: Damien Hedde, Peter Maydell, Luc Michel, Eduardo Habkost,
	Philippe Mathieu-Daudé,
	qemu-arm, Paolo Bonzini

Hi Damian, Luc, Peter.

I've been debugging some odd issue with the clocks:
a clock created in the machine (IOW, not a qdev clock) isn't
always resetted, thus propagating its value.
"not always" is the odd part. In the MPS2 board, the machine
clock is propagated. Apparently because the peripherals are
created directly in the machine_init() handler. When moving
them out in a SoC QOM container, the clock isn't... I'm still
having hard time to understand what is going on.

Alternatively I tried to strengthen the clock API by reducing
the clock creation in 2 cases: machine/device. This way clocks
aren't left dangling around alone. The qdev clocks are properly
resetted, and for the machine clocks I register a generic reset
handler. This way is safer, but I don't think we want to keep
adding generic reset handlers, instead we'd like to remove them.

I'll keep debugging to understand. Meanwhile posting this series
as RFC to get feedback on the approach and start discussing on
this issue.

Regards,

Phil.

Philippe Mathieu-Daudé (9):
  hw/core/clock: Increase clock propagation trace events verbosity
  hw/core/machine: Add machine_create_constant_clock() helper
  hw/arm: Use new machine_create_constant_clock() helper
  hw/mips: Use new machine_create_constant_clock() helper
  hw/core/qdev-clock: Add qdev_ground_clock() helper
  hw/misc/bcm2835_cprman: Use qdev_ground_clock() helper
  hw/misc/bcm2835_cprman: Feed 'xosc' from the board
  hw/clock: Declare clock_new() internally
  hw/core/machine: Reset machine clocks using qemu_register_reset()

 hw/core/clock-internal.h         | 32 ++++++++++++++++++++++++++++++++
 include/hw/boards.h              | 17 +++++++++++++++++
 include/hw/clock.h               | 13 -------------
 include/hw/misc/bcm2835_cprman.h |  2 --
 include/hw/qdev-clock.h          |  9 +++++++++
 hw/arm/bcm2835_peripherals.c     |  1 +
 hw/arm/bcm2836.c                 |  1 +
 hw/arm/mps2-tz.c                 |  6 ++----
 hw/arm/mps2.c                    |  3 +--
 hw/arm/musca.c                   |  6 ++----
 hw/arm/raspi.c                   |  4 ++++
 hw/core/clock.c                  |  9 ++++++++-
 hw/core/machine.c                | 20 ++++++++++++++++++++
 hw/core/qdev-clock.c             | 12 ++++++++++++
 hw/mips/fuloong2e.c              |  4 ++--
 hw/mips/jazz.c                   |  6 +++---
 hw/mips/loongson3_virt.c         |  4 ++--
 hw/mips/mipssim.c                |  7 ++++---
 hw/misc/bcm2835_cprman.c         | 12 +++---------
 MAINTAINERS                      |  1 +
 hw/core/trace-events             |  3 ++-
 21 files changed, 126 insertions(+), 46 deletions(-)
 create mode 100644 hw/core/clock-internal.h

-- 
2.26.3



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

end of thread, other threads:[~2021-05-03 16:44 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-09  6:23 [RFC PATCH-for-6.1 0/9] hw/clock: Strengthen machine (non-qdev) clock propagation Philippe Mathieu-Daudé
2021-04-09  6:23 ` [RFC PATCH-for-6.1 1/9] hw/core/clock: Increase clock propagation trace events verbosity Philippe Mathieu-Daudé
2021-04-09  6:23 ` [RFC PATCH-for-6.1 2/9] hw/core/machine: Add machine_create_constant_clock() helper Philippe Mathieu-Daudé
2021-04-09  6:23 ` [RFC PATCH-for-6.1 3/9] hw/arm: Use new " Philippe Mathieu-Daudé
2021-04-09  6:23 ` [RFC PATCH-for-6.1 4/9] hw/mips: " Philippe Mathieu-Daudé
2021-04-09  6:23 ` [RFC PATCH-for-6.1 5/9] hw/core/qdev-clock: Add qdev_ground_clock() helper Philippe Mathieu-Daudé
2021-04-19 14:22   ` Peter Maydell
2021-04-09  6:23 ` [RFC PATCH-for-6.1 6/9] hw/misc/bcm2835_cprman: Use " Philippe Mathieu-Daudé
2021-04-09  6:23 ` [RFC PATCH-for-6.1 7/9] hw/misc/bcm2835_cprman: Feed 'xosc' from the board Philippe Mathieu-Daudé
2021-04-19 14:24   ` Peter Maydell
2021-04-09  6:24 ` [RFC PATCH-for-6.1 8/9] hw/clock: Declare clock_new() internally Philippe Mathieu-Daudé
2021-04-19 14:26   ` Peter Maydell
2021-04-20  9:27     ` Philippe Mathieu-Daudé
2021-04-09  6:24 ` [RFC PATCH-for-6.1 9/9] hw/core/machine: Reset machine clocks using qemu_register_reset() Philippe Mathieu-Daudé
2021-04-19 14:27   ` Peter Maydell
2021-04-09 13:12 ` [RFC PATCH-for-6.1 0/9] hw/clock: Strengthen machine (non-qdev) clock propagation Philippe Mathieu-Daudé
2021-04-09 14:11   ` Philippe Mathieu-Daudé
2021-04-09 14:20     ` Philippe Mathieu-Daudé
2021-04-10 13:19 ` Luc Michel
2021-04-10 13:53   ` Philippe Mathieu-Daudé
2021-04-10 15:15     ` Peter Maydell
2021-04-10 16:14       ` Philippe Mathieu-Daudé
2021-04-12 10:11       ` Peter Maydell
2021-04-12 10:31         ` Philippe Mathieu-Daudé
2021-04-12 10:44           ` Peter Maydell
2021-04-12 11:00             ` Philippe Mathieu-Daudé
2021-04-13 19:43             ` Eduardo Habkost
2021-05-03 15:20               ` Igor Mammedov
2021-05-03 16:37                 ` Philippe Mathieu-Daudé
2021-04-19 19:39     ` Luc Michel

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).