Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 5286
b: refs/heads/master
c: 2868bd2
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Jul 28, 2005
1 parent ebc771b commit bc43b27
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 9 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: 41c018b7ecb60b1c2c4d5dee0cd37d32a94c45af
refs/heads/master: 2868bd281fef21d1e73d6b7648a41efc3d75f10c
1 change: 1 addition & 0 deletions trunk/drivers/infiniband/core/uverbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ struct ib_uverbs_event_file {
int fd;
int is_async;
wait_queue_head_t poll_wait;
struct fasync_struct *async_queue;
struct list_head event_list;
};

Expand Down
14 changes: 13 additions & 1 deletion trunk/drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,19 @@ static void ib_uverbs_event_release(struct ib_uverbs_event_file *file)
spin_unlock_irq(&file->lock);
}

static int ib_uverbs_event_fasync(int fd, struct file *filp, int on)
{
struct ib_uverbs_event_file *file = filp->private_data;

return fasync_helper(fd, filp, on, &file->async_queue);
}

static int ib_uverbs_event_close(struct inode *inode, struct file *filp)
{
struct ib_uverbs_event_file *file = filp->private_data;

ib_uverbs_event_release(file);
ib_uverbs_event_fasync(-1, filp, 0);
kref_put(&file->uverbs_file->ref, ib_uverbs_release_file);

return 0;
Expand All @@ -276,7 +284,8 @@ static struct file_operations uverbs_event_fops = {
*/
.read = ib_uverbs_event_read,
.poll = ib_uverbs_event_poll,
.release = ib_uverbs_event_close
.release = ib_uverbs_event_close,
.fasync = ib_uverbs_event_fasync
};

void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
Expand All @@ -296,6 +305,7 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
spin_unlock_irqrestore(&file->comp_file[0].lock, flags);

wake_up_interruptible(&file->comp_file[0].poll_wait);
kill_fasync(&file->comp_file[0].async_queue, SIGIO, POLL_IN);
}

static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
Expand All @@ -316,6 +326,7 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
spin_unlock_irqrestore(&file->async_file.lock, flags);

wake_up_interruptible(&file->async_file.poll_wait);
kill_fasync(&file->async_file.async_queue, SIGIO, POLL_IN);
}

void ib_uverbs_cq_event_handler(struct ib_event *event, void *context_ptr)
Expand Down Expand Up @@ -350,6 +361,7 @@ static int ib_uverbs_event_init(struct ib_uverbs_event_file *file,
INIT_LIST_HEAD(&file->event_list);
init_waitqueue_head(&file->poll_wait);
file->uverbs_file = uverbs_file;
file->async_queue = NULL;

file->fd = get_unused_fd();
if (file->fd < 0)
Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/infiniband/hw/mthca/mthca_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,12 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
* If we're at the end of the WQE chain, or we've used up our
* doorbell count, free the CQE. Otherwise just update it for
* the next poll operation.
*
* This does not apply to mem-free HCAs: they don't use the
* doorbell count field, and so we should always free the CQE.
*/
if (!(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
if (mthca_is_memfree(dev) ||
!(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
return 0;

cqe->db_cnt = cpu_to_be16(be16_to_cpu(cqe->db_cnt) - dbd);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/infiniband/hw/mthca/mthca_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ static int mthca_mmap_uar(struct ib_ucontext *context,

vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);

if (remap_pfn_range(vma, vma->vm_start,
to_mucontext(context)->uar.pfn,
PAGE_SIZE, vma->vm_page_prot))
if (io_remap_pfn_range(vma, vma->vm_start,
to_mucontext(context)->uar.pfn,
PAGE_SIZE, vma->vm_page_prot))
return -EAGAIN;

return 0;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void ipoib_free_ah(struct kref *kref)

unsigned long flags;

if (ah->last_send <= priv->tx_tail) {
if ((int) priv->tx_tail - (int) ah->last_send >= 0) {
ipoib_dbg(priv, "Freeing ah %p\n", ah->ah);
ib_destroy_ah(ah->ah);
kfree(ah);
Expand Down Expand Up @@ -355,7 +355,7 @@ static void __ipoib_reap_ah(struct net_device *dev)

spin_lock_irq(&priv->lock);
list_for_each_entry_safe(ah, tah, &priv->dead_ahs, list)
if (ah->last_send <= priv->tx_tail) {
if ((int) priv->tx_tail - (int) ah->last_send >= 0) {
list_del(&ah->list);
list_add_tail(&ah->list, &remove_list);
}
Expand Down Expand Up @@ -486,7 +486,7 @@ int ipoib_ib_dev_stop(struct net_device *dev)
* assume the HW is wedged and just free up
* all our pending work requests.
*/
while (priv->tx_tail < priv->tx_head) {
while ((int) priv->tx_tail - (int) priv->tx_head < 0) {
tx_req = &priv->tx_ring[priv->tx_tail &
(IPOIB_TX_RING_SIZE - 1)];
dma_unmap_single(priv->ca->dma_device,
Expand Down

0 comments on commit bc43b27

Please sign in to comment.