diff options
author | Mustafa Ismail <mustafa.ismail@intel.com> | 2016-11-30 23:59:26 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-12-06 00:09:40 +0300 |
commit | d59659340c61e777208524f77c268fe6edc6fe37 (patch) | |
tree | 993c3c1da535fb679f35b72d6bd4efa183ea475d /drivers/infiniband/hw/i40iw/i40iw_main.c | |
parent | f26c7c83395b72f30d111f4e3adb3437c0a30b77 (diff) | |
download | linux-d59659340c61e777208524f77c268fe6edc6fe37.tar.xz |
i40iw: Add missing cleanup on device close
On i40iw device close, disconnect all connected QPs by moving
them to error state; and block further QPs, PDs and CQs from
being created. Additionally, make sure all resources have been
freed before deallocating the ibdev as part of the device close.
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/i40iw/i40iw_main.c')
-rw-r--r-- | drivers/infiniband/hw/i40iw/i40iw_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/i40iw/i40iw_main.c b/drivers/infiniband/hw/i40iw/i40iw_main.c index 9d3b9ee20ba7..d86bb6e98f07 100644 --- a/drivers/infiniband/hw/i40iw/i40iw_main.c +++ b/drivers/infiniband/hw/i40iw/i40iw_main.c @@ -1546,6 +1546,7 @@ static enum i40iw_status_code i40iw_setup_init_state(struct i40iw_handler *hdl, init_waitqueue_head(&iwdev->vchnl_waitq); init_waitqueue_head(&dev->vf_reqs); + init_waitqueue_head(&iwdev->close_wq); status = i40iw_initialize_dev(iwdev, ldev); exit: @@ -1748,6 +1749,9 @@ static void i40iw_close(struct i40e_info *ldev, struct i40e_client *client, bool return; iwdev = &hdl->device; + iwdev->closing = true; + + i40iw_cm_disconnect_all(iwdev); destroy_workqueue(iwdev->virtchnl_wq); i40iw_deinit_device(iwdev, reset); } |