qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Amos Kong <akong@redhat.com>
Cc: jan.kiszka@siemens.com, jasowang@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] e1000: no need auto-negotiation if link was down
Date: Thu, 3 Jan 2013 13:20:33 +0100	[thread overview]
Message-ID: <20130103122033.GC6976@stefanha-thinkpad.muc.redhat.com> (raw)
In-Reply-To: <1356686951-20305-2-git-send-email-akong@redhat.com>

On Fri, Dec 28, 2012 at 05:29:10PM +0800, Amos Kong wrote:
> Commit b9d03e352cb6b31a66545763f6a1e20c9abf0c2c added link
> auto-negotiation emulation, it would always set link up by
> callback function. Problem exists if original link status
> was down, link status should not be changed in auto-negotiation.
> 
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Amos Kong <akong@redhat.com>
> ---
>  hw/e1000.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/hw/e1000.c b/hw/e1000.c
> index 92fb00a..eebcd1d 100644
> --- a/hw/e1000.c
> +++ b/hw/e1000.c
> @@ -164,6 +164,11 @@ 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;

Do we need set_ics(s, 0, E1000_ICR_LSC) when autonegotiation completes?
The code doesn't but I wonder if we should.

Stefan

  reply	other threads:[~2013-01-03 12:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28  9:29 [Qemu-devel] [PATCH 0/2] fix of preserving link status Amos Kong
2012-12-28  9:29 ` [Qemu-devel] [PATCH 1/2] e1000: no need auto-negotiation if link was down Amos Kong
2013-01-03 12:20   ` Stefan Hajnoczi [this message]
2013-01-05  8:45     ` Jason Wang
2013-01-06  5:11       ` Amos Kong
2013-01-07 12:59         ` Stefan Hajnoczi
2013-01-08  9:45           ` Amos Kong
2013-01-08 17:07             ` Stefan Hajnoczi
2012-12-28  9:29 ` [Qemu-devel] [PATCH 2/2] rtl8139: preserve link state across device reset Amos Kong
2013-01-03 12:21 ` [Qemu-devel] [PATCH 0/2] fix of preserving link status Stefan Hajnoczi

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=20130103122033.GC6976@stefanha-thinkpad.muc.redhat.com \
    --to=stefanha@redhat.com \
    --cc=akong@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jasowang@redhat.com \
    --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).