All of lore.kernel.org
 help / color / mirror / Atom feed
From: liguang <lig.fnst@cn.fujitsu.com>
To: aliguori@us.ibm.com, peter.maydell@linaro.org,
	pbonzini@redhat.com, stefanha@gmail.com, afaerber@suse.de,
	qemu-devel@nongnu.org
Cc: liguang <lig.fnst@cn.fujitsu.com>
Subject: [Qemu-devel] [PATCH][RFC v2 0/7] implement power chip
Date: Fri, 5 Apr 2013 12:28:04 +0800	[thread overview]
Message-ID: <1365136091-26148-1-git-send-email-lig.fnst@cn.fujitsu.com> (raw)

By now, all devices of QEMU do not have much more
power management consideration, for example, if
system do suspend, it will call all registered notifiers,
this was loosely required, and the code to do power management
state transition seems just do 'ugly emulation', rather than be
conscious with whole system devices, same condition with reset.
shutdown, in real world, commonly all devices' power are controlled
by a power chip, then all power sequence can be done just
issue commands or raise signals connected to this chip.
so, I come across an idea to implement qdev'ed power device, and
make all qdev struct of devices aware of self power management(connect
power signal with power chip, then respond to power state change), this will
bring tidy power management, and the emulation will more like what
happened in real world.

Of course, it's only a patch-set for RFC, I'd like to ask all 
developers to help correct this idea, if it's worth to implement, 
I'll go head to refactor more.

v2: change from functions calling to signal connecting between
	power chip and devices.

Li Guang (7)
	 hw/irq: move struct IRQState to irq.h
	 hw/power: add main power chip implementation
	 vl: create power chip device
	 sysemu: remove PowerReason in sysemu.h
	 qdev: add power_signal_in for DeviceState
	 ich9: refactor wakeup/reset function
	 vl: run power_management

hw/acpi.c               |   20 +++++++++-----------
hw/acpi.h               |   3 ++-
hw/acpi_ich9.c          |   2 +-
hw/Makefile.objs        |   1 +
hw/ich9.h               |   2 ++
hw/irq.c                |   6 ------
hw/irq.h                |   6 ++++++
hw/lpc_ich9.c           |  30 +++++++++++++++++++++++++++++-
hw/power.c              | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
hw/power.h              |  50 +++++++++++++++
hw/qdev-core.h          |   1 +
include/sysemu/sysemu.h |   7 +------
vl.c                    |   5 ++++
13 files changed, 285 insertions(+), 26 deletions(-)
 create mode 100644 hw/power.c
 create mode 100644 hw/power.h

             reply	other threads:[~2013-04-05  4:29 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-05  4:28 liguang [this message]
2013-04-05  4:28 ` [Qemu-devel] [PATCH][RFC v2 1/7] hw/irq: move struct IRQState to irq.h liguang
2013-04-05  8:34   ` Peter Maydell
2013-04-05  8:39     ` li guang
2013-04-05  4:28 ` [Qemu-devel] [PATCH][RFC v2 2/7] hw/power: add main power chip implementation liguang
2013-04-05  8:35   ` Peter Maydell
2013-04-05  8:45     ` li guang
2013-04-05  9:23       ` Peter Maydell
2013-04-08  0:32         ` li guang
2013-04-08  9:21           ` Peter Maydell
2013-04-09  8:14             ` li guang
2013-04-09  8:29               ` Paolo Bonzini
2013-04-05  4:28 ` [Qemu-devel] [PATCH][RFC v2 3/7] vl: create power chip device liguang
2013-04-05 11:48   ` Paolo Bonzini
2013-04-08  0:18     ` li guang
2013-04-08  9:53       ` Paolo Bonzini
2013-04-09  7:34         ` li guang
2013-04-09  7:43           ` Paolo Bonzini
2013-04-09  8:26             ` li guang
2013-04-09 11:06               ` Paolo Bonzini
2013-04-10  0:09                 ` li guang
2013-04-10  9:40                   ` Paolo Bonzini
2013-04-10 12:09                   ` Andreas Färber
2013-04-10 13:41                     ` guang li
2013-04-10 13:52                       ` Paolo Bonzini
2013-04-11  1:30                         ` li guang
2013-04-16 20:45                         ` Anthony Liguori
2013-04-17  0:07                           ` li guang
2013-04-05  4:28 ` [Qemu-devel] [PATCH][RFC v2 4/7] sysemu: remove PowerReason in sysemu.h liguang
2013-04-05  4:28 ` [Qemu-devel] [PATCH][RFC v2 5/7] qdev: add power_signal_in for DeviceState liguang
2013-04-05  4:28 ` [Qemu-devel] [PATCH][RFC v2 6/7] ich9: refactor wakeup/reset function liguang
2013-04-05  4:28 ` [Qemu-devel] [PATCH][RFC v2 7/7] vl: run power_management liguang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1365136091-26148-1-git-send-email-lig.fnst@cn.fujitsu.com \
    --to=lig.fnst@cn.fujitsu.com \
    --cc=afaerber@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.