net: sonic: return NETDEV_TX_OK if failed to map buffer
authorMao Wenan <maowenan@huawei.com>
Thu, 5 Sep 2019 01:57:12 +0000 (09:57 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:51:11 +0000 (14:51 +0100)
commited11b619d490ee1a0670447cc3a7e8c57e9733e1
treeb1c0a5e12195948a013e9e32178a641e525906cc
parentb6a99e96125a4bb7b1235eb73b6f1166a21b10b0
net: sonic: return NETDEV_TX_OK if failed to map buffer

[ Upstream commit 6e1cdedcf0362fed3aedfe051d46bd7ee2a85fe1 ]

NETDEV_TX_BUSY really should only be used by drivers that call
netif_tx_stop_queue() at the wrong moment. If dma_map_single() is
failed to map tx DMA buffer, it might trigger an infinite loop.
This patch use NETDEV_TX_OK instead of NETDEV_TX_BUSY, and change
printk to pr_err_ratelimited.

Fixes: d9fb9f384292 ("*sonic/natsemi/ns83829: Move the National Semi-conductor drivers")
Signed-off-by: Mao Wenan <maowenan@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/natsemi/sonic.c