lkml.org 
[lkml]   [2018]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH AUTOSEL for 4.9 038/281] vmxnet3: ensure that adapter is in proper state during force_close
    Date
    From: Neil Horman <nhorman@tuxdriver.com>

    [ Upstream commit 1c4d5f51a812a82de97beee24f48ed05c65ebda5 ]

    There are several paths in vmxnet3, where settings changes cause the
    adapter to be brought down and back up (vmxnet3_set_ringparam among
    them). Should part of the reset operation fail, these paths call
    vmxnet3_force_close, which enables all napi instances prior to calling
    dev_close (with the expectation that vmxnet3_close will then properly
    disable them again). However, vmxnet3_force_close neglects to clear
    VMXNET3_STATE_BIT_QUIESCED prior to calling dev_close. As a result
    vmxnet3_quiesce_dev (called from vmxnet3_close), returns early, and
    leaves all the napi instances in a enabled state while the device itself
    is closed. If a device in this state is activated again, napi_enable
    will be called on already enabled napi_instances, leading to a BUG halt.

    The fix is to simply enausre that the QUIESCED bit is cleared in
    vmxnet3_force_close to allow quesence to be completed properly on close.

    Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
    CC: Shrikrishna Khare <skhare@vmware.com>
    CC: "VMware, Inc." <pv-drivers@vmware.com>
    CC: "David S. Miller" <davem@davemloft.net>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
    ---
    drivers/net/vmxnet3/vmxnet3_drv.c | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
    index 4afba17e2403..f809eed0343c 100644
    --- a/drivers/net/vmxnet3/vmxnet3_drv.c
    +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
    @@ -2962,6 +2962,11 @@ vmxnet3_force_close(struct vmxnet3_adapter *adapter)
    /* we need to enable NAPI, otherwise dev_close will deadlock */
    for (i = 0; i < adapter->num_rx_queues; i++)
    napi_enable(&adapter->rx_queue[i].napi);
    + /*
    + * Need to clear the quiesce bit to ensure that vmxnet3_close
    + * can quiesce the device properly
    + */
    + clear_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state);
    dev_close(adapter->netdev);
    }

    --
    2.14.1
    \
     
     \ /
      Last update: 2018-03-19 22:41    [W:4.028 / U:0.268 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site