From patchwork Thu Jan 31 23:43:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 217307 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 64CDB2C008D for ; Fri, 1 Feb 2013 10:53:36 +1100 (EST) Received: from localhost ([::1]:52551 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U13wk-0005zM-Lf for incoming@patchwork.ozlabs.org; Thu, 31 Jan 2013 18:53:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U13wd-0005yx-4k for qemu-devel@nongnu.org; Thu, 31 Jan 2013 18:53:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U13wc-0004Iy-6Z for qemu-devel@nongnu.org; Thu, 31 Jan 2013 18:53:27 -0500 Received: from mail-ia0-x22f.google.com ([2607:f8b0:4001:c02::22f]:39225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U13wb-0004If-Tm; Thu, 31 Jan 2013 18:53:26 -0500 Received: by mail-ia0-f175.google.com with SMTP id r4so4535472iaj.20 for ; Thu, 31 Jan 2013 15:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=sBB43UrnNqM6GL6J4rNiBHV9ib/Afr6q/cXkxzSUwOU=; b=UzMPNqjhgoRwczPu5bBPU+fQPTytWlGJ+n3xayX8xLuHdeqZflcBrhw0J4puONQaBp qqrN1N4DDLo2+OT6Q/HXuhI7dfo6/ah/MQIClFlBEa2M5ybfl7qSeBWVUiYVmxvf9zZJ RunbkwzwenwA64ELd26RFyvyCLyGl6O4ethYdzApRBFJMjia7CnYnitnLcXqZL/X2VI8 rRBJYehXO2cJSW3rE5IdC+DqREPuUn6RLoPjj1abvvhQx7+szGUVpCCcv6zZCJ/t0/zF goyEXeegeYtJjNuAqHms6bZpxgvxaQBkBRHuinQYnmuKLF4U7eejjcKCEG2eJBbbNXqo wFmw== X-Received: by 10.50.36.133 with SMTP id q5mr2683535igj.109.1359675926714; Thu, 31 Jan 2013 15:45:26 -0800 (PST) Received: from localhost ([32.97.110.59]) by mx.google.com with ESMTPS id as6sm134179igc.8.2013.01.31.15.45.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 31 Jan 2013 15:45:25 -0800 (PST) From: Michael Roth To: qemu-devel@nongnu.org Date: Thu, 31 Jan 2013 17:43:51 -0600 Message-Id: <1359675832-11999-1-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c02::22f Cc: jasowang@redhat.com, aliguori@us.ibm.com, akong@redhat.com, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH for-1.4] Revert "e1000: no need auto-negotiation if link was down" 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 This reverts commit 84dd2120247a7d25ff1bb337de21c0e76816ad2d. I'm not sure what issue the original commit was meant to fix, or if the logic is actually wrong, but it causes e1000 to stop working after a guest issues a reset. From what I can tell a guest with an e1000 nic has no way of changing the link status, as far as it's NetClient peer is concerned, except in the auto-negotiation path, so with this patch in place there's no recovery after a reset, since the link goes down and stays that way. Revert this patch now to fix the bigger problem, and handle any lingering issues with a follow-up. Reproduced/tested with qemu-jeos and Ubuntu 12.10. Signed-off-by: Michael Roth Acked-by: Michael S. Tsirkin Acked-by: Stefan Hajnoczi --- hw/e1000.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index ef06ca1..563a58f 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -166,11 +166,6 @@ static void set_phy_ctrl(E1000State *s, int index, uint16_t val) { if ((val & MII_CR_AUTO_NEG_EN) && (val & MII_CR_RESTART_AUTO_NEG)) { - /* no need auto-negotiation if link was down */ - if (s->nic->nc.link_down) { - s->phy_reg[PHY_STATUS] |= MII_SR_AUTONEG_COMPLETE; - return; - } s->nic->nc.link_down = true; e1000_link_down(s); s->phy_reg[PHY_STATUS] &= ~MII_SR_AUTONEG_COMPLETE;