From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org, Andy Gospodarek <andy@greyhouse.net>,
Dean Nelson <dnelson@redhat.com>,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: peter.maydell@linaro.org, Anthony Liguori <aliguori@us.ibm.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Alex Williamson <alex.williamson@redhat.com>,
Anthony PERARD <anthony.perard@citrix.com>,
Kevin Wolf <mail@kevin-wolf.de>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH 2/2] e1000: CTRL.RST emulation
Date: Tue, 27 Sep 2011 15:58:52 +0300 [thread overview]
Message-ID: <eb3a2eb12eb223f398c94f672caa83ee30aabacb.1317127818.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1317127818.git.mst@redhat.com>
e1000 spec says CTRL.RST write should have the same effect
as bus reset, except that is preserves PCI Config.
Reset device registers and interrupts.
Fix suggested by Andy Gospodarek <andy@greyhouse.net>
Similar fix proposed by Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
hw/e1000.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/e1000.c b/hw/e1000.c
index 87a1104..b51e089 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -241,8 +241,13 @@ static void e1000_reset(void *opaque)
static void
set_ctrl(E1000State *s, int index, uint32_t val)
{
- /* RST is self clearing */
- s->mac_reg[CTRL] = val & ~E1000_CTRL_RST;
+ if (val & E1000_CTRL_RST) {
+ e1000_reset(s);
+ qemu_set_irq(s->dev.irq[0], 0);
+ return;
+ }
+
+ s->mac_reg[CTRL] = val;
}
static void
--
1.7.5.53.gc233e
next prev parent reply other threads:[~2011-09-27 12:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 12:58 [Qemu-devel] [PATCH 0/2] e1000: reset handling Michael S. Tsirkin
2011-09-27 12:58 ` [Qemu-devel] [PATCH 1/2] e1000: minor reset code refactoring Michael S. Tsirkin
2011-09-27 12:58 ` Michael S. Tsirkin [this message]
2011-09-27 15:33 ` [Qemu-devel] [PATCH 2/2] e1000: CTRL.RST emulation Andy Gospodarek
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=eb3a2eb12eb223f398c94f672caa83ee30aabacb.1317127818.git.mst@redhat.com \
--to=mst@redhat.com \
--cc=alex.williamson@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=andy@greyhouse.net \
--cc=anthony.perard@citrix.com \
--cc=aurelien@aurel32.net \
--cc=dnelson@redhat.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=mail@kevin-wolf.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 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).