]> git.baikalelectronics.ru Git - kernel.git/commit
ionic: use mutex to protect queue operations
authorShannon Nelson <snelson@pensando.io>
Mon, 20 Jul 2020 23:00:17 +0000 (16:00 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2020 01:09:38 +0000 (18:09 -0700)
commita6b059be98dad291a4e42c388fd48712b685c292
treec6c396d7b099db4a9209c894b47e808d23b2f82f
parent45ecd125b4015841c0e3a3de91f3765b97ac0c3b
ionic: use mutex to protect queue operations

The ionic_wait_on_bit_lock() was a open-coded mutex knock-off
used only for protecting the queue reset operations, and there
was no reason not to use the real thing.  We can use the lock
more correctly and to better protect the queue stop and start
operations from cross threading.  We can also remove a useless
and expensive bit operation from the Rx path.

This fixes a case found where the link_status_check from a link
flap could run into an MTU change and cause a crash.

Fixes: 1c7e71712563 ("ionic: Add the basic NDO callbacks for netdev support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_lif.c
drivers/net/ethernet/pensando/ionic/ionic_lif.h
drivers/net/ethernet/pensando/ionic/ionic_txrx.c