From: Sascha Hauer <s.hauer@pengutronix.de>
To: Florian Fainelli <florian@openwrt.org>
Cc: "Duan Fugang-B38611" <B38611@freescale.com>,
"Stephen Hemminger" <stephen@networkplumber.org>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
"Estevam Fabio-R49496" <r49496@freescale.com>,
"Li Frank-B20596" <B20596@freescale.com>,
"Shawn Guo" <shawn.guo@linaro.org>,
"kernel@pengutronix.de" <kernel@pengutronix.de>,
"Hector Palacios" <hector.palacios@digi.com>,
"Tim Sander" <tim.sander@hbm.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [PATCH] net/fec: call netif_carrier_off when not having link
Date: Fri, 26 Jul 2013 12:52:17 +0200 [thread overview]
Message-ID: <20130726105217.GG2737@pengutronix.de> (raw)
In-Reply-To: <CAGVrzcZMg28Cj=KncE=qDq8qLKY1WkiH5PiwrJECTYdBOe16sA@mail.gmail.com>
On Fri, Jul 26, 2013 at 11:06:06AM +0100, Florian Fainelli wrote:
> Hello,
>
> 2013/7/26 Duan Fugang-B38611 <B38611@freescale.com>:
> > On Fir, 26 Jul 2013 12:04, Stephen Hemminger wrote:
> >>> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> >>> b/drivers/net/ethernet/freescale/fec_main.c
> >>> index 0642006..631bd5a 100644
> >>> --- a/drivers/net/ethernet/freescale/fec_main.c
> >>> +++ b/drivers/net/ethernet/freescale/fec_main.c
> >>> @@ -280,11 +280,6 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
> >>> unsigned short status;
> >>> unsigned int index;
> >>>
> >>> - if (!fep->link) {
> >>> - /* Link is down or auto-negotiation is in progress. */
> >>> - return NETDEV_TX_BUSY;
> >>> - }
> >>> -
> >>
> >>That is a bug anyway. Since it would cause spin loop in transmit code (even without -rt).
> >>If the driver cared to test it (most drivers just let hardware deal with this situation),
> >>then it should free packet and return TX_OK.
> >
> > When link is down, the logic is
> > - call netif_stop_queue() to stop queue
> > - and then notify there have no link using netif_carrier_off().
>
> netif_carrier_off() is handled by the PHY library before calling the
> adjust_link callback in FEC.
>
> >
> > But the flow must be handled in fec_enet_adjust_link() function, not in xmit().
>
> What is special about this hardware that fec_restart() needs to do all
> that work?
The special thing is that the driver is written in a braindamaged way.
fec_restart is kind of a suicide-and-resurrect function which is called
whenever something changes.
> Can't you just update the duplex/speed/pause settings
> directly without doing a full hardware re-init?
Yes, that's possible. I made some initial patches for this which we'll
probably send soon.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2013-07-26 10:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 13:27 [PATCH] net/fec: call netif_carrier_off when not having link Uwe Kleine-König
2013-07-25 16:03 ` Stephen Hemminger
2013-07-26 9:35 ` Duan Fugang-B38611
2013-07-26 10:06 ` Florian Fainelli
2013-07-26 10:52 ` Sascha Hauer [this message]
2013-07-26 15:31 ` Ben Hutchings
2013-07-29 2:10 ` Duan Fugang-B38611
2013-07-29 2:14 ` Duan Fugang-B38611
2013-07-30 9:29 ` [PATCH] net/fec: Don't let ndo_start_xmit return NETDEV_TX_BUSY without link Uwe Kleine-König
2013-07-30 9:59 ` Duan Fugang-B38611
2013-07-30 23:05 ` David Miller
2013-07-31 8:16 ` Uwe Kleine-König
2013-07-31 18:51 ` David Miller
2013-08-01 2:01 ` Duan Fugang-B38611
2013-08-01 2:25 ` Steven Rostedt
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=20130726105217.GG2737@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=B20596@freescale.com \
--cc=B38611@freescale.com \
--cc=davem@davemloft.net \
--cc=florian@openwrt.org \
--cc=hector.palacios@digi.com \
--cc=kernel@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=r49496@freescale.com \
--cc=rostedt@goodmis.org \
--cc=shawn.guo@linaro.org \
--cc=stephen@networkplumber.org \
--cc=tglx@linutronix.de \
--cc=tim.sander@hbm.com \
--cc=u.kleine-koenig@pengutronix.de \
/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).