Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 59349
b: refs/heads/master
c: 9844b71
h: refs/heads/master
i:
  59347: 4fd47c4
v: v3
  • Loading branch information
Joachim Fenkes authored and Roland Dreier committed Jul 10, 2007
1 parent f1fb12e commit 10f250a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 37 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: 15f001ec47b049051f679f8b8c965ac9aae95b3e
refs/heads/master: 9844b71baa60270110eabaa9589d3260443d1a71
1 change: 0 additions & 1 deletion trunk/drivers/infiniband/hw/ehca/ehca_classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ void ehca_cleanup_mrmw_cache(void);

extern spinlock_t ehca_qp_idr_lock;
extern spinlock_t ehca_cq_idr_lock;
extern spinlock_t hcall_lock;
extern struct idr ehca_qp_idr;
extern struct idr ehca_cq_idr;

Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/infiniband/hw/ehca/ehca_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ int ehca_cq_assign_qp(struct ehca_cq *cq, struct ehca_qp *qp)
{
unsigned int qp_num = qp->real_qp_num;
unsigned int key = qp_num & (QP_HASHTAB_LEN-1);
unsigned long spl_flags;
unsigned long flags;

spin_lock_irqsave(&cq->spinlock, spl_flags);
spin_lock_irqsave(&cq->spinlock, flags);
hlist_add_head(&qp->list_entries, &cq->qp_hashtab[key]);
spin_unlock_irqrestore(&cq->spinlock, spl_flags);
spin_unlock_irqrestore(&cq->spinlock, flags);

ehca_dbg(cq->ib_cq.device, "cq_num=%x real_qp_num=%x",
cq->cq_number, qp_num);
Expand All @@ -74,9 +74,9 @@ int ehca_cq_unassign_qp(struct ehca_cq *cq, unsigned int real_qp_num)
unsigned int key = real_qp_num & (QP_HASHTAB_LEN-1);
struct hlist_node *iter;
struct ehca_qp *qp;
unsigned long spl_flags;
unsigned long flags;

spin_lock_irqsave(&cq->spinlock, spl_flags);
spin_lock_irqsave(&cq->spinlock, flags);
hlist_for_each(iter, &cq->qp_hashtab[key]) {
qp = hlist_entry(iter, struct ehca_qp, list_entries);
if (qp->real_qp_num == real_qp_num) {
Expand All @@ -88,7 +88,7 @@ int ehca_cq_unassign_qp(struct ehca_cq *cq, unsigned int real_qp_num)
break;
}
}
spin_unlock_irqrestore(&cq->spinlock, spl_flags);
spin_unlock_irqrestore(&cq->spinlock, flags);
if (ret)
ehca_err(cq->ib_cq.device,
"qp not found cq_num=%x real_qp_num=%x",
Expand Down
18 changes: 4 additions & 14 deletions trunk/drivers/infiniband/hw/ehca/ehca_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,13 @@ MODULE_PARM_DESC(static_rate,
MODULE_PARM_DESC(scaling_code,
"set scaling code (0: disabled/default, 1: enabled)");

spinlock_t ehca_qp_idr_lock;
spinlock_t ehca_cq_idr_lock;
spinlock_t hcall_lock;
DEFINE_SPINLOCK(ehca_qp_idr_lock);
DEFINE_SPINLOCK(ehca_cq_idr_lock);
DEFINE_IDR(ehca_qp_idr);
DEFINE_IDR(ehca_cq_idr);


static struct list_head shca_list; /* list of all registered ehcas */
static spinlock_t shca_list_lock;
static LIST_HEAD(shca_list); /* list of all registered ehcas */
static DEFINE_SPINLOCK(shca_list_lock);

static struct timer_list poll_eqs_timer;

Expand Down Expand Up @@ -864,14 +862,6 @@ int __init ehca_module_init(void)

printk(KERN_INFO "eHCA Infiniband Device Driver "
"(Rel.: SVNEHCA_0023)\n");
idr_init(&ehca_qp_idr);
idr_init(&ehca_cq_idr);
spin_lock_init(&ehca_qp_idr_lock);
spin_lock_init(&ehca_cq_idr_lock);
spin_lock_init(&hcall_lock);

INIT_LIST_HEAD(&shca_list);
spin_lock_init(&shca_list_lock);

if ((ret = ehca_create_comp_pool())) {
ehca_gen_err("Cannot create comp pool.");
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/infiniband/hw/ehca/ehca_qp.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
u64 h_ret;
int bad_wqe_cnt = 0;
int squeue_locked = 0;
unsigned long spl_flags = 0;
unsigned long flags = 0;

/* do query_qp to obtain current attr values */
mqpcb = ehca_alloc_fw_ctrlblock(GFP_KERNEL);
Expand Down Expand Up @@ -1074,7 +1074,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,
if (!ibqp->uobject) {
struct ehca_wqe *wqe;
/* lock send queue */
spin_lock_irqsave(&my_qp->spinlock_s, spl_flags);
spin_lock_irqsave(&my_qp->spinlock_s, flags);
squeue_locked = 1;
/* mark next free wqe */
wqe = (struct ehca_wqe*)
Expand Down Expand Up @@ -1360,7 +1360,7 @@ static int internal_modify_qp(struct ib_qp *ibqp,

modify_qp_exit2:
if (squeue_locked) { /* this means: sqe -> rts */
spin_unlock_irqrestore(&my_qp->spinlock_s, spl_flags);
spin_unlock_irqrestore(&my_qp->spinlock_s, flags);
my_qp->sqerr_purgeflag = 1;
}

Expand Down
24 changes: 12 additions & 12 deletions trunk/drivers/infiniband/hw/ehca/ehca_reqs.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ int ehca_post_send(struct ib_qp *qp,
struct ehca_wqe *wqe_p;
int wqe_cnt = 0;
int ret = 0;
unsigned long spl_flags;
unsigned long flags;

/* LOCK the QUEUE */
spin_lock_irqsave(&my_qp->spinlock_s, spl_flags);
spin_lock_irqsave(&my_qp->spinlock_s, flags);

/* loop processes list of send reqs */
for (cur_send_wr = send_wr; cur_send_wr != NULL;
Expand Down Expand Up @@ -408,7 +408,7 @@ int ehca_post_send(struct ib_qp *qp,

post_send_exit0:
/* UNLOCK the QUEUE */
spin_unlock_irqrestore(&my_qp->spinlock_s, spl_flags);
spin_unlock_irqrestore(&my_qp->spinlock_s, flags);
iosync(); /* serialize GAL register access */
hipz_update_sqa(my_qp, wqe_cnt);
return ret;
Expand All @@ -423,7 +423,7 @@ static int internal_post_recv(struct ehca_qp *my_qp,
struct ehca_wqe *wqe_p;
int wqe_cnt = 0;
int ret = 0;
unsigned long spl_flags;
unsigned long flags;

if (unlikely(!HAS_RQ(my_qp))) {
ehca_err(dev, "QP has no RQ ehca_qp=%p qp_num=%x ext_type=%d",
Expand All @@ -432,7 +432,7 @@ static int internal_post_recv(struct ehca_qp *my_qp,
}

/* LOCK the QUEUE */
spin_lock_irqsave(&my_qp->spinlock_r, spl_flags);
spin_lock_irqsave(&my_qp->spinlock_r, flags);

/* loop processes list of send reqs */
for (cur_recv_wr = recv_wr; cur_recv_wr != NULL;
Expand Down Expand Up @@ -473,7 +473,7 @@ static int internal_post_recv(struct ehca_qp *my_qp,
} /* eof for cur_recv_wr */

post_recv_exit0:
spin_unlock_irqrestore(&my_qp->spinlock_r, spl_flags);
spin_unlock_irqrestore(&my_qp->spinlock_r, flags);
iosync(); /* serialize GAL register access */
hipz_update_rqa(my_qp, wqe_cnt);
return ret;
Expand Down Expand Up @@ -536,7 +536,7 @@ static inline int ehca_poll_cq_one(struct ib_cq *cq, struct ib_wc *wc)
if (unlikely(cqe->status & WC_STATUS_PURGE_BIT)) {
struct ehca_qp *qp=ehca_cq_get_qp(my_cq, cqe->local_qp_number);
int purgeflag;
unsigned long spl_flags;
unsigned long flags;
if (!qp) {
ehca_err(cq->device, "cq_num=%x qp_num=%x "
"could not find qp -> ignore cqe",
Expand All @@ -546,9 +546,9 @@ static inline int ehca_poll_cq_one(struct ib_cq *cq, struct ib_wc *wc)
/* ignore this purged cqe */
goto poll_cq_one_read_cqe;
}
spin_lock_irqsave(&qp->spinlock_s, spl_flags);
spin_lock_irqsave(&qp->spinlock_s, flags);
purgeflag = qp->sqerr_purgeflag;
spin_unlock_irqrestore(&qp->spinlock_s, spl_flags);
spin_unlock_irqrestore(&qp->spinlock_s, flags);

if (purgeflag) {
ehca_dbg(cq->device, "Got CQE with purged bit qp_num=%x "
Expand Down Expand Up @@ -633,7 +633,7 @@ int ehca_poll_cq(struct ib_cq *cq, int num_entries, struct ib_wc *wc)
int nr;
struct ib_wc *current_wc = wc;
int ret = 0;
unsigned long spl_flags;
unsigned long flags;

if (num_entries < 1) {
ehca_err(cq->device, "Invalid num_entries=%d ehca_cq=%p "
Expand All @@ -642,14 +642,14 @@ int ehca_poll_cq(struct ib_cq *cq, int num_entries, struct ib_wc *wc)
goto poll_cq_exit0;
}

spin_lock_irqsave(&my_cq->spinlock, spl_flags);
spin_lock_irqsave(&my_cq->spinlock, flags);
for (nr = 0; nr < num_entries; nr++) {
ret = ehca_poll_cq_one(cq, current_wc);
if (ret)
break;
current_wc++;
} /* eof for nr */
spin_unlock_irqrestore(&my_cq->spinlock, spl_flags);
spin_unlock_irqrestore(&my_cq->spinlock, flags);
if (ret == -EAGAIN || !ret)
ret = nr;

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/infiniband/hw/ehca/hcp_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
#define H_MP_SHUTDOWN EHCA_BMASK_IBM(48, 48)
#define H_MP_RESET_QKEY_CTR EHCA_BMASK_IBM(49, 49)

static DEFINE_SPINLOCK(hcall_lock);

static u32 get_longbusy_msecs(int longbusy_rc)
{
switch (longbusy_rc) {
Expand Down

0 comments on commit 10f250a

Please sign in to comment.