kernel-fxtec-pro1x/drivers/net/ethernet/micrel
Marek Vasut a17fcd59a2 net: ks8851-ml: Fix IRQ handling and locking
[ Upstream commit 44343418d0f2f623cb9da6f5000df793131cbe3b ]

The KS8851 requires that packet RX and TX are mutually exclusive.
Currently, the driver hopes to achieve this by disabling interrupt
from the card by writing the card registers and by disabling the
interrupt on the interrupt controller. This however is racy on SMP.

Replace this approach by expanding the spinlock used around the
ks_start_xmit() TX path to ks_irq() RX path to assure true mutual
exclusion and remove the interrupt enabling/disabling, which is
now not needed anymore. Furthermore, disable interrupts also in
ks_net_stop(), which was missing before.

Note that a massive improvement here would be to re-use the KS8851
driver approach, which is to move the TX path into a worker thread,
interrupt handling to threaded interrupt, and synchronize everything
with mutexes, but that would be a much bigger rework, for a separate
patch.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Petr Stetiar <ynezz@true.cz>
Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-03-20 11:55:53 +01:00
..
Kconfig
ks8695net.c net: micrel: fix return type of ndo_start_xmit function 2019-11-20 18:47:14 +01:00
ks8695net.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ks8842.c networking: make skb_put & friends return void pointers 2017-06-16 11:48:39 -04:00
ks8851.c net: ks8851: Set initial carrier state to down 2019-05-04 09:20:16 +02:00
ks8851.h
ks8851_mll.c net: ks8851-ml: Fix IRQ handling and locking 2020-03-20 11:55:53 +01:00
ksz884x.c ethernet: micrel: remove redundant pointer 'info' 2018-07-04 22:39:11 +09:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00