Re: [PATCH 1/2] [v4] net: emac: emac gigabit ethernet controller driver

From: Timur Tabi
Date: Tue May 10 2016 - 22:25:08 EST


Florian Fainelli wrote:
The Ethernet MAC should be started in ndo_open() and stopped in
ndo_close(), in between, there are link state changes, but you are not
supposed to stop or start your Ethernet MAC and its DMA for instance
during link change, if that is a HW requirement, your HW is pretty funky.

I think the problem is that the current driver seems to be too eager to start/stop the MAC.

Please take a look at emac_work_thread_link_check() at https://lkml.org/lkml/2016/4/13/670. Every time the PHY link goes up, it does this:

if (phy->link_up) {
if (netif_carrier_ok(netdev))
goto link_task_done;

pm_runtime_get_sync(netdev->dev.parent);
netif_info(adpt, timer, adpt->netdev, "NIC Link is Up %s\n",
speed);

emac_mac_start(adpt);
netif_carrier_on(netdev);
netif_wake_queue(netdev);


The call to emac_mac_start seems wrong to me here.

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.