From patchwork Thu Mar 22 10:01:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Wang X-Patchwork-Id: 148208 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D1B5FB6EEC for ; Thu, 22 Mar 2012 21:07:00 +1100 (EST) Received: from localhost ([::1]:48419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAev1-00077P-B0 for incoming@patchwork.ozlabs.org; Thu, 22 Mar 2012 06:06:55 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAeul-0006mB-9K for qemu-devel@nongnu.org; Thu, 22 Mar 2012 06:06:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SAeue-00067g-Iu for qemu-devel@nongnu.org; Thu, 22 Mar 2012 06:06:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAeue-00067Q-BB for qemu-devel@nongnu.org; Thu, 22 Mar 2012 06:06:32 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2MA6ThR011384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 22 Mar 2012 06:06:29 -0400 Received: from amd-6168-8-1.englab.nay.redhat.com (amd-6168-8-1.englab.nay.redhat.com [10.66.104.52]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2MA6QZV020763; Thu, 22 Mar 2012 06:06:27 -0400 To: qemu-devel@nongnu.org, aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, mst@redhat.com From: Jason Wang Date: Thu, 22 Mar 2012 18:01:50 +0800 Message-ID: <20120322100150.44393.57388.stgit@amd-6168-8-1.englab.nay.redhat.com> In-Reply-To: <20120322100141.44393.14528.stgit@amd-6168-8-1.englab.nay.redhat.com> References: <20120322100141.44393.14528.stgit@amd-6168-8-1.englab.nay.redhat.com> User-Agent: StGit/0.16-1-g60c4 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/7] e1000: conditionally raise irq at the end of MDI cycle X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org According to the spec: "When set to 1b by software, it causes an Interrupt to be asserted to indicate the end of an MDI cycle." We need check the Interrupt Enable bit and raise irq only when it is set. Signed-off-by: Jason Wang --- hw/e1000.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 7babc0b..dd6a97d 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -234,7 +234,10 @@ set_mdic(E1000State *s, int index, uint32_t val) s->phy_reg[addr] = data; } s->mac_reg[MDIC] = val | E1000_MDIC_READY; - set_ics(s, 0, E1000_ICR_MDAC); + + if (val & E1000_MDIC_INT_EN) { + set_ics(s, 0, E1000_ICR_MDAC); + } } static uint32_t