From: Hector Palacios <hector.palacios@digi.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Tim Sander <tim.sander@hbm.com>,
linux-rt-users@vger.kernel.org, lclaudio@uudg.org, efault@gmx.de,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: infinite spin in RT when booting with DHCP on
Date: Fri, 3 Feb 2012 11:09:34 +0100 [thread overview]
Message-ID: <4F2BB25E.7090708@digi.com> (raw)
In-Reply-To: <1328206245.5882.113.camel@gandalf.stny.rr.com>
Hi Steve,
On 02/02/2012 07:10 PM, Steven Rostedt wrote:
> That said, as I think I know the problem, can you try this patch to see
> if it fixes things. This patch is a TOTAL HACK! Not for inclusion. It's
> racy and buggy. I didn't even compile it because I couldn't get the
> configs to enable FEC, and I was too lazy to set up my cross compiler to
> test it. ;-)
Yes, this hack fixes things as long as I boot with the Ethernet cable plugged in. In
this case the autonegotiation is launched and fec_enet_start_xmit() waits until it
completes. From then on, the hack never triggers again (comp_set is 0) and
disconnecting-reconnecting the cable or asking for a new DHCP address seems to work
normally.
If I boot with the cable disconnected the driver seems to be trapped at the
wait_for_completion() and connecting the cable later simply doesn't allow the
autonegotiation to complete.
--
Héctor Palacios
> diff --git a/drivers/net/fec.c b/drivers/net/fec.c
> index 885d8ba..9368dc2 100644
> --- a/drivers/net/fec.c
> +++ b/drivers/net/fec.c
> @@ -231,6 +231,9 @@ static void *swap_buffer(void *bufaddr, int len)
> return bufaddr;
> }
>
> +static DECLARE_COMPLETION(kick_ksoftirq);
> +static int comp_set;
> +
> static netdev_tx_t
> fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> {
> @@ -243,6 +246,9 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> unsigned long flags;
>
> if (!fep->link) {
> + if (comp_set)
> + wait_for_completion(&kick_ksoftirq);
> +
> /* Link is down or autonegotiation is in progress. */
> return NETDEV_TX_BUSY;
> }
> @@ -794,6 +800,8 @@ static void fec_enet_adjust_link(struct net_device *ndev)
> /* Link on or off change */
> if (phy_dev->link != fep->link) {
> fep->link = phy_dev->link;
> + complete(&kick_ksoftirq);
> + comp_set = 0;
> if (phy_dev->link)
> fec_restart(ndev, phy_dev->duplex);
> else
> @@ -914,6 +922,9 @@ static int fec_enet_mii_probe(struct net_device *ndev)
> fep->link = 0;
> fep->full_duplex = 0;
>
> + init_completion(&kick_ksoftirq);
> + comp_set = 1;
> +
> printk(KERN_INFO "%s: Freescale FEC PHY driver [%s] "
> "(mii_bus:phy_addr=%s, irq=%d)\n", ndev->name,
> fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-02-03 10:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-01 12:28 infinite spin in RT when booting with DHCP on Hector Palacios
2012-02-02 12:38 ` Tim Sander
2012-02-02 12:57 ` Hector Palacios
2012-02-02 14:25 ` Tim Sander
2012-02-02 15:32 ` Tim Sander
2012-02-02 15:53 ` Hector Palacios
2012-02-02 18:10 ` Steven Rostedt
2012-02-03 10:09 ` Hector Palacios [this message]
2012-02-03 10:54 ` John Ogness
2012-02-03 14:26 ` Steven Rostedt
2012-02-02 17:33 ` Steven Rostedt
2012-02-02 18:21 ` Steven Rostedt
2012-02-02 20:13 ` Uwe Kleine-König
2012-02-02 21:34 ` Steven Rostedt
2012-02-02 23:44 ` Tim Sander
2012-02-03 9:45 ` Tim Sander
2012-02-06 14:49 ` Tim Sander
2012-02-03 10:23 ` Hector Palacios
2012-02-03 10:35 ` Uwe Kleine-König
2012-02-03 16:14 ` Hector Palacios
2012-02-03 16:43 ` Steven Rostedt
2012-02-03 17:25 ` Hector Palacios
2012-02-03 17:39 ` Steven Rostedt
2012-02-03 19:25 ` Uwe Kleine-König
2012-02-03 20:04 ` Steven Rostedt
2012-02-06 8:51 ` Hector Palacios
2012-02-06 13:27 ` Steven Rostedt
2012-02-08 20:41 ` Thomas Gleixner
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=4F2BB25E.7090708@digi.com \
--to=hector.palacios@digi.com \
--cc=efault@gmx.de \
--cc=lclaudio@uudg.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tim.sander@hbm.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).