All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hector Palacios <hector.palacios@digi.com>
To: Tim Sander <tim.sander@hbm.com>
Cc: "linux-rt-users@vger.kernel.org" <linux-rt-users@vger.kernel.org>,
	"lclaudio@uudg.org" <lclaudio@uudg.org>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"efault@gmx.de" <efault@gmx.de>
Subject: Re: infinite spin in RT when booting with DHCP on
Date: Thu, 2 Feb 2012 16:53:15 +0100	[thread overview]
Message-ID: <4F2AB16B.4090305@digi.com> (raw)
In-Reply-To: <201202021632.50065.tim.sander@hbm.com>

Hi Tim,

On 02/02/2012 04:32 PM, Tim Sander wrote:
> Attached you will find a hacky patch which should just verify that the problem
> hypothesis can be validated.
> It just initializes the phy with driver initialisation and should work around
> this ksoftirq/sirq-net-tx problem.

Confirmed, this hack works around the problem.


> ---
>   drivers/net/fec.c |   58 ++++++++++++++++++++++++++++------------------------
>   1 files changed, 31 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/net/fec.c b/drivers/net/fec.c
> index 885d8ba..292ae7e 100644
> --- a/drivers/net/fec.c
> +++ b/drivers/net/fec.c
> @@ -231,6 +231,7 @@ static void *swap_buffer(void *bufaddr, int len)
>          return bufaddr;
>   }
>
> +
>   static netdev_tx_t
>   fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>   {
> @@ -1135,24 +1136,6 @@ static int
>   fec_enet_open(struct net_device *ndev)
>   {
>          struct fec_enet_private *fep = netdev_priv(ndev);
> -       int ret;
> -
> -       /* I should reset the ring buffers here, but I don't yet know
> -        * a simple way to do that.
> -        */
> -
> -       ret = fec_enet_alloc_buffers(ndev);
> -       if (ret)
> -               return ret;
> -
> -       /* Probe and connect to PHY when open the interface */
> -       ret = fec_enet_mii_probe(ndev);
> -       if (ret) {
> -               fec_enet_free_buffers(ndev);
> -               return ret;
> -       }
> -       phy_start(fep->phy_dev);
> -       netif_start_queue(ndev);
>          fep->opened = 1;
>          return 0;
>   }
> @@ -1164,15 +1147,6 @@ fec_enet_close(struct net_device *ndev)
>
>          /* Don't know what to do yet. */
>          fep->opened = 0;
> -       netif_stop_queue(ndev);
> -       fec_stop(ndev);
> -
> -       if (fep->phy_dev) {
> -               phy_stop(fep->phy_dev);
> -               phy_disconnect(fep->phy_dev);
> -       }
> -
> -       fec_enet_free_buffers(ndev);
>
>          return 0;
>   }
> @@ -1432,10 +1406,32 @@ fec_probe(struct platform_device *pdev)
>          netif_carrier_off(ndev);
>
>          ret = register_netdev(ndev);
> +
>          if (ret)
>                  goto failed_register;
>
> +// Tim: very hacky for testing
> +       /* I should reset the ring buffers here, but I don't yet know
> +        * a simple way to do that.
> +        */
> +
> +       ret = fec_enet_alloc_buffers(ndev);
> +       if (ret)
> +               return ret;
> +
> +       /* Probe and connect to PHY when open the interface */
> +       ret = fec_enet_mii_probe(ndev);
> +       if (ret) {
> +               fec_enet_free_buffers(ndev);
> +               return ret;
> +       }
> +       phy_start(fep->phy_dev);
> +       netif_start_queue(ndev);
> +       fep->opened = 1;
> +// end hacky
> +
>          return 0;
> +
>
>   failed_register:
>          fec_enet_mii_remove(fep);
> @@ -1466,7 +1462,15 @@ fec_drv_remove(struct platform_device *pdev)
>          struct fec_enet_private *fep = netdev_priv(ndev);
>          struct resource *r;
>
> +       netif_stop_queue(ndev);
>          fec_stop(ndev);
> +
> +       if (fep->phy_dev) {
> +               phy_stop(fep->phy_dev);
> +               phy_disconnect(fep->phy_dev);
> +       }
> +
> +       fec_enet_free_buffers(ndev);
>          fec_enet_mii_remove(fep);
>          clk_disable(fep->clk);
>          clk_put(fep->clk);


  reply	other threads:[~2012-02-02 15:53 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 [this message]
2012-02-02 18:10       ` Steven Rostedt
2012-02-03 10:09         ` Hector Palacios
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=4F2AB16B.4090305@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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.