OSDN Git Service

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)
commit0925e9db4dc86daf666d9a3d53c7db14ac6d5d00
treec6c396d7b099db4a9209c894b47e808d23b2f82f
parentbdff46665ee655600d0fe2a0e5f62ec7853d3b22
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: beead698b173 ("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