[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGVrzcZMg28Cj=KncE=qDq8qLKY1WkiH5PiwrJECTYdBOe16sA@mail.gmail.com>
Date: Fri, 26 Jul 2013 11:06:06 +0100
From: Florian Fainelli <florian@...nwrt.org>
To: Duan Fugang-B38611 <B38611@...escale.com>
Cc: Stephen Hemminger <stephen@...workplumber.org>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Estevam Fabio-R49496 <r49496@...escale.com>,
Li Frank-B20596 <B20596@...escale.com>,
Shawn Guo <shawn.guo@...aro.org>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
Hector Palacios <hector.palacios@...i.com>,
Tim Sander <tim.sander@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] net/fec: call netif_carrier_off when not having link
Hello,
2013/7/26 Duan Fugang-B38611 <B38611@...escale.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? Can't you just update the duplex/speed/pause settings
directly without doing a full hardware re-init? Also the comment above
it is wrong, fec_restart() is not just called when the duplex changes,
it is called when the link/speed/duplex settings changed and when the
workqueue is scheduled from fec_timeout().
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists