Skip to content

Commit

Permalink
IB/sa_query: Flush scheduled work before unloading module
Browse files Browse the repository at this point in the history
sa_query schedules work on IB asynchronous events.  After
unregistering the async event handler, make sure that this work has
completed before releasing the IB device (and possibly allowing the
sa_query module text to go away).

Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Michael S. Tsirkin authored and Roland Dreier committed Jan 17, 2006
1 parent cc76e33 commit 0f47ae0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/infiniband/core/sa_query.c
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,8 @@ static void ib_sa_remove_one(struct ib_device *device)

ib_unregister_event_handler(&sa_dev->event_handler);

flush_scheduled_work();

for (i = 0; i <= sa_dev->end_port - sa_dev->start_port; ++i) {
ib_unregister_mad_agent(sa_dev->port[i].agent);
kref_put(&sa_dev->port[i].sm_ah->ref, free_sm_ah);
Expand Down

0 comments on commit 0f47ae0

Please sign in to comment.