Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5209
b: refs/heads/master
c: 6a0c435
h: refs/heads/master
i:
  5207: 3666842
v: v3
  • Loading branch information
Hal Rosenstock authored and Linus Torvalds committed Jul 27, 2005
1 parent e6107c0 commit 4e340ec
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d760ce8f71ec5336c4a750a1293f26c0eb938c8a
refs/heads/master: 6a0c435ef9e2473934442282054d0f58235d1de2
14 changes: 12 additions & 2 deletions trunk/drivers/infiniband/core/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
spin_lock_init(&mad_agent_priv->lock);
INIT_LIST_HEAD(&mad_agent_priv->send_list);
INIT_LIST_HEAD(&mad_agent_priv->wait_list);
INIT_LIST_HEAD(&mad_agent_priv->done_list);
INIT_WORK(&mad_agent_priv->timed_work, timeout_sends, mad_agent_priv);
INIT_LIST_HEAD(&mad_agent_priv->local_list);
INIT_WORK(&mad_agent_priv->local_work, local_completions,
Expand Down Expand Up @@ -1559,6 +1560,16 @@ find_send_req(struct ib_mad_agent_private *mad_agent_priv,
return NULL;
}

static void ib_mark_req_done(struct ib_mad_send_wr_private *mad_send_wr)
{
mad_send_wr->timeout = 0;
if (mad_send_wr->refcount == 1) {
list_del(&mad_send_wr->agent_list);
list_add_tail(&mad_send_wr->agent_list,
&mad_send_wr->mad_agent_priv->done_list);
}
}

static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv,
struct ib_mad_recv_wc *mad_recv_wc)
{
Expand All @@ -1580,8 +1591,7 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv,
wake_up(&mad_agent_priv->wait);
return;
}
/* Timeout = 0 means that we won't wait for a response */
mad_send_wr->timeout = 0;
ib_mark_req_done(mad_send_wr);
spin_unlock_irqrestore(&mad_agent_priv->lock, flags);

/* Defined behavior is to complete response before request */
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/infiniband/core/mad_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ struct ib_mad_agent_private {
spinlock_t lock;
struct list_head send_list;
struct list_head wait_list;
struct list_head done_list;
struct work_struct timed_work;
unsigned long timeout;
struct list_head local_list;
Expand Down

0 comments on commit 4e340ec

Please sign in to comment.