qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Fleytman <dmitry@daynix.com>
To: qemu-devel@nongnu.org
Cc: Jason Wang <jasowang@redhat.com>, Yan Vugenfirer <yan@daynix.com>,
	Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Subject: [Qemu-devel] [PATCH 7/7] e1000e: Fix EIAC register implementation
Date: Thu, 15 Sep 2016 09:14:30 +0300	[thread overview]
Message-ID: <1473920070-21938-8-git-send-email-dmitry@daynix.com> (raw)
In-Reply-To: <1473920070-21938-1-git-send-email-dmitry@daynix.com>

This patch fixes 2 issues:

1. Bits set in EIAC register should be cleared
   from IMS when EIAM is not used.
2. Only bit that corresonds to the interrupt being
   raised should be cleared.

See spec. 10.2.4.7 Interrupt Auto Clear

Signed-off-by: Dmitry Fleytman <dmitry@daynix.com>
---
 hw/net/e1000e_core.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index f4ec79f..3c38980 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -2015,13 +2015,17 @@ e1000e_msix_notify_one(E1000ECore *core, uint32_t cause, uint32_t int_cfg)
 
     trace_e1000e_irq_icr_clear_eiac(core->mac[ICR], core->mac[EIAC]);
 
-    if (core->mac[EIAC] & E1000_ICR_OTHER) {
-        effective_eiac = (core->mac[EIAC] & E1000_EIAC_MASK) |
-                         E1000_ICR_OTHER_CAUSES;
-    } else {
-        effective_eiac = core->mac[EIAC] & E1000_EIAC_MASK;
+    effective_eiac = core->mac[EIAC] & cause;
+
+    if (effective_eiac == E1000_ICR_OTHER) {
+        effective_eiac |= E1000_ICR_OTHER_CAUSES;
     }
+
     core->mac[ICR] &= ~effective_eiac;
+
+    if (!(core->mac[CTRL_EXT] & E1000_CTRL_EXT_IAME)) {
+        core->mac[IMS] &= ~effective_eiac;
+    }
 }
 
 static void
-- 
2.7.4

  parent reply	other threads:[~2016-09-15  6:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15  6:14 [Qemu-devel] [PATCH 0/7] e1000e: A few fixes for RX data path Dmitry Fleytman
2016-09-15  6:14 ` [Qemu-devel] [PATCH 1/7] e1000e: Flush all receive queues on receive enable Dmitry Fleytman
2016-09-15  6:14 ` [Qemu-devel] [PATCH 2/7] e1000e: Flush receive queues on link up Dmitry Fleytman
2016-09-15  6:14 ` [Qemu-devel] [PATCH 3/7] e1000e: Fix CTRL_EXT.EIAME behavior Dmitry Fleytman
2016-09-15  6:14 ` [Qemu-devel] [PATCH 4/7] e1000e: Fix PBACLR implementation Dmitry Fleytman
2016-09-22  6:40   ` Jason Wang
2016-09-22  9:01     ` Dmitry Fleytman
2016-09-23  5:00       ` Jason Wang
2016-09-15  6:14 ` [Qemu-devel] [PATCH 5/7] e1000e: Fix OTHER interrupts processing for MSI-X Dmitry Fleytman
2016-09-15  6:14 ` [Qemu-devel] [PATCH 6/7] e1000e: Fix spurious RX TCP ACK interrupts Dmitry Fleytman
2016-09-15  6:14 ` Dmitry Fleytman [this message]
2016-09-21 14:32 ` [Qemu-devel] [PATCH 0/7] e1000e: A few fixes for RX data path Dmitry Fleytman
2016-09-23  5:11 ` Jason Wang

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=1473920070-21938-8-git-send-email-dmitry@daynix.com \
    --to=dmitry@daynix.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shmulik.ladkani@ravellosystems.com \
    --cc=yan@daynix.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 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).