public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
To: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	jgg-uk2M96/98Pc@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Selvin Xavier
	<selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Subject: [PATCH for-rc 5/6] RDMA/bnxt_re: Fix system crash during load/unload
Date: Thu, 15 Feb 2018 21:20:12 -0800	[thread overview]
Message-ID: <1518758413-20850-6-git-send-email-selvin.xavier@broadcom.com> (raw)
In-Reply-To: <1518758413-20850-1-git-send-email-selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>

During driver unload, the driver proceeds with cleanup
without waiting for the scheduled events. So the device
pointers get freed up and driver crashes when the events
are scheduled later.

Flush the bnxt_re_task work queue before starting
device removal.

Signed-off-by: Selvin Xavier <selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/bnxt_re/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
index 3d5bbf9..560520c 100644
--- a/drivers/infiniband/hw/bnxt_re/main.c
+++ b/drivers/infiniband/hw/bnxt_re/main.c
@@ -1591,6 +1591,11 @@ static void __exit bnxt_re_mod_exit(void)
 	*/
 	list_for_each_entry_safe_reverse(rdev, next, &to_be_deleted, list) {
 		dev_info(rdev_to_dev(rdev), "Unregistering Device");
+		/*
+		 * Flush out any scheduled tasks before destroying the
+		 * resources
+		 */
+		flush_workqueue(bnxt_re_wq);
 		bnxt_re_dev_stop(rdev);
 		bnxt_re_ib_unreg(rdev, true);
 		bnxt_re_remove_one(rdev);
-- 
2.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2018-02-16  5:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-16  5:20 [PATCH for-rc 0/6] RDMA/bnxt_re: Misc bug fixes Selvin Xavier
     [not found] ` <1518758413-20850-1-git-send-email-selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2018-02-16  5:20   ` [PATCH for-rc 1/6] RDMA/bnxt_re: Disable atomic capability on bnxt_re adapters Selvin Xavier
2018-02-16  5:20   ` [PATCH for-rc 2/6] RDMA/bnxt_re: Maintain GID index mapping between stack and hardware Selvin Xavier
     [not found]     ` <1518758413-20850-3-git-send-email-selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2018-02-16 16:07       ` Jason Gunthorpe
     [not found]         ` <20180216160703.GB22739-uk2M96/98Pc@public.gmane.org>
2018-02-17  6:24           ` Selvin Xavier
2018-02-16  5:20   ` [PATCH for-rc 3/6] RDMA/bnxt_re: Unpin SQ and RQ memory if QP create fails Selvin Xavier
2018-02-16  5:20   ` [PATCH for-rc 4/6] RDMA/bnxt_re: Synchronize destroy_qp with poll_cq Selvin Xavier
     [not found]     ` <1518758413-20850-5-git-send-email-selvin.xavier-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2018-02-16  7:38       ` Leon Romanovsky
     [not found]         ` <20180216073802.GM2197-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2018-02-16 11:39           ` Selvin Xavier
     [not found]             ` <CA+sbYW1=9G1YHDZQyCKeTfus9FLd-w7FZzHFUnCCPALB3ciw_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-16 15:51               ` Leon Romanovsky
2018-02-16  5:20   ` Selvin Xavier [this message]
2018-02-16  5:20   ` [PATCH for-rc 6/6] RDMA/bnxt_re: Avoid system hang during device un-reg Selvin Xavier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1518758413-20850-6-git-send-email-selvin.xavier@broadcom.com \
    --to=selvin.xavier-dy08kvg/lbpwk0htik3j/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jgg-uk2M96/98Pc@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox