From: "Gabriel L. Somlo" <gsomlo@gmail.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, agraf@suse.de, stefanha@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [RFC PATCH v1 2/2] e1000: adjust initial autoneg timing (for piix/osx)
Date: Mon, 30 Jun 2014 12:55:50 -0400 [thread overview]
Message-ID: <1404147350-28904-3-git-send-email-somlo@cmu.edu> (raw)
In-Reply-To: <1404147350-28904-1-git-send-email-somlo@cmu.edu>
When running on PIIX (as opposed to q35), the stock OS X e1000
driver (AppleIntel8254XEthernet.kext) takes longer to load and
activete, and will "miss" the link status change interrupt
injected when the emulated "hardware" autonegotiation completes
(see commit 39bb8ee737595e9b264d075dfcd7d86f4d3f1133).
This patch extends the delay of the autonetotiation timer set up
during set_phy_ctrl() to a value just large enough to work with
the OS X driver.
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
---
So, the loading OS X driver must take longer between its last
write to the PHY_CTRL register and the time it starts looking
for LSC interrupts, because at delay==500 it obviously misses
the relevant interrupt. Making this 5500 (actually anything
larger than 5300, but there's a bit of variation across OS X
versions, so I rounded up a bit) has the timer fire after
enough time has passed that the driver knows what to do when
the interrupt from the network card fires...
Thanks,
Gabriel
hw/net/e1000.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 2376910..2300477 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -209,7 +209,7 @@ set_phy_ctrl(E1000State *s, int index, uint16_t val)
e1000_link_down(s);
DBGOUT(PHY, "Start link auto negotiation\n");
timer_mod(s->autoneg_timer,
- qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 500);
+ qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + 5500);
}
}
--
1.9.3
next prev parent reply other threads:[~2014-06-30 16:56 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-30 16:55 [Qemu-devel] [RFC PATCH v1 0/2] e1000: More link negotiation vs. OS X Gabriel L. Somlo
2014-06-30 16:55 ` [Qemu-devel] [RFC PATCH v1 1/2] e1000: clean up set_phy_ctrl function Gabriel L. Somlo
2014-06-30 18:04 ` Michael S. Tsirkin
2014-06-30 18:12 ` Gabriel L. Somlo
2014-06-30 19:29 ` Gabriel L. Somlo
2014-06-30 19:35 ` Gabriel L. Somlo
2014-06-30 16:55 ` Gabriel L. Somlo [this message]
2014-06-30 17:55 ` [Qemu-devel] [RFC PATCH v1 2/2] e1000: adjust initial autoneg timing (for piix/osx) Michael S. Tsirkin
2014-06-30 18:00 ` Paolo Bonzini
2014-06-30 18:21 ` Alexander Graf
2014-07-02 9:02 ` Gabriel L. Somlo
2014-07-02 9:16 ` Alexander Graf
2014-07-02 20:49 ` [Qemu-devel] e1000 autoneg timing, piix/osx Gabriel L. Somlo
2014-07-02 21:02 ` Alexander Graf
2014-07-02 21:14 ` Gabriel L. Somlo
2014-07-02 21:54 ` Alexander Graf
2014-07-02 22:02 ` Gabriel L. Somlo
2014-07-03 8:04 ` Alexander Graf
2014-07-03 13:17 ` Gabriel L. Somlo
2014-07-03 13:20 ` Alexander Graf
2014-07-03 13:58 ` Gabriel L. Somlo
2014-07-03 14:02 ` Alexander Graf
2014-07-03 14:14 ` Gabriel L. Somlo
2014-07-03 14:51 ` Alexander Graf
2014-07-03 15:25 ` Alexander Graf
2014-07-03 16:09 ` Paolo Bonzini
2014-07-03 16:43 ` Gabriel L. Somlo
2014-07-03 17:33 ` Alexander Graf
2014-07-02 9:33 ` [Qemu-devel] [RFC PATCH v1 2/2] e1000: adjust initial autoneg timing (for piix/osx) Michael S. Tsirkin
2014-07-02 12:05 ` Gabriel L. Somlo
2014-07-02 12:09 ` Michael S. Tsirkin
2014-07-02 14:21 ` Gabriel L. Somlo
2014-07-02 15:17 ` Michael S. Tsirkin
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=1404147350-28904-3-git-send-email-somlo@cmu.edu \
--to=gsomlo@gmail.com \
--cc=agraf@suse.de \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).