From 6219e4933329f71b05dd08e00baad04d78640ba5 Mon Sep 17 00:00:00 2001 From: David Binder Date: Mon, 9 Jan 2017 13:02:25 -0500 Subject: [PATCH] staging: unisys: visornic: Reorder logic in visornic_enable_with_timeout() Moves the call to napi_enable() before the call to init_rcv_bufs(), ensuring that messages are not put into the receive queue until the guest is ready to receive interrupts. Signed-off-by: David Binder Signed-off-by: David Kershner Signed-off-by: Greg Kroah-Hartman --- drivers/staging/unisys/visornic/visornic_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index 6c49288e52fa..cbc88100021a 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -572,6 +572,8 @@ visornic_enable_with_timeout(struct net_device *netdev, const int timeout) unsigned long flags; int wait = 0; + napi_enable(&devdata->napi); + /* NOTE: the other end automatically unposts the rcv buffers when it * gets a disable. */ @@ -595,7 +597,6 @@ visornic_enable_with_timeout(struct net_device *netdev, const int timeout) /* send enable and wait for ack -- don't hold lock when sending enable * because if the queue is full, insert might sleep. */ - napi_enable(&devdata->napi); send_enbdis(netdev, 1, devdata); spin_lock_irqsave(&devdata->priv_lock, flags); -- 2.20.1