net: macb: Only disable NAPI on the actual error path

A recent change added a disable to NAPI into macb_open, this was
intended to only happen on the error path but accidentally applies
to all paths. This causes NAPI to be disabled on the success path, which
leads to the network to no longer functioning.

Fixes: 014406babc ("net: cadence: macb: disable NAPI on error")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Corentin Labbe <clabbe@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Charles Keepax 2020-06-15 14:18:54 +01:00 коммит произвёл David S. Miller
Родитель 0acb47a3a0
Коммит 939a5bf7c9
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -2565,16 +2565,15 @@ static int macb_open(struct net_device *dev)
if (bp->ptp_info) if (bp->ptp_info)
bp->ptp_info->ptp_init(dev); bp->ptp_info->ptp_init(dev);
return 0;
napi_exit: napi_exit:
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
napi_disable(&queue->napi); napi_disable(&queue->napi);
pm_exit: pm_exit:
if (err) {
pm_runtime_put_sync(&bp->pdev->dev); pm_runtime_put_sync(&bp->pdev->dev);
return err; return err;
} }
return 0;
}
static int macb_close(struct net_device *dev) static int macb_close(struct net_device *dev)
{ {