Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270959
b: refs/heads/master
c: b338c78
h: refs/heads/master
i:
  270957: ac00579
  270955: 1415f02
  270951: 71dca33
  270943: 15067db
v: v3
  • Loading branch information
Bhanu Prakash Gollapudi authored and James Bottomley committed Aug 27, 2011
1 parent 4d60e05 commit 1bb129c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 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: 81214013130cd24142f6465f7f5a256fed530c17
refs/heads/master: b338c785c5c945383046ff39092e3021ea5b1d95
10 changes: 7 additions & 3 deletions trunk/drivers/scsi/bnx2fc/bnx2fc_hwi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt)
u32 cq_cons;
struct fcoe_cqe *cqe;
u32 num_free_sqes = 0;
u32 num_cqes = 0;
u16 wqe;

/*
Expand Down Expand Up @@ -1058,10 +1059,11 @@ int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt)
wake_up_process(fps->iothread);
else
bnx2fc_process_cq_compl(tgt, wqe);
num_free_sqes++;
}
cqe++;
tgt->cq_cons_idx++;
num_free_sqes++;
num_cqes++;

if (tgt->cq_cons_idx == BNX2FC_CQ_WQES_MAX) {
tgt->cq_cons_idx = 0;
Expand All @@ -1070,8 +1072,10 @@ int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt)
1 - tgt->cq_curr_toggle_bit;
}
}
if (num_free_sqes) {
bnx2fc_arm_cq(tgt);
if (num_cqes) {
/* Arm CQ only if doorbell is mapped */
if (tgt->ctx_base)
bnx2fc_arm_cq(tgt);
atomic_add(num_free_sqes, &tgt->free_sqes);
}
spin_unlock_bh(&tgt->cq_lock);
Expand Down
19 changes: 11 additions & 8 deletions trunk/drivers/scsi/bnx2fc/bnx2fc_tgt.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ static void bnx2fc_offload_session(struct fcoe_port *port,
printk(KERN_ERR PFX "map doorbell failed - no mem\n");
/* upload will take care of cleaning up sess resc */
lport->tt.rport_logoff(rdata);
}
/* Arm CQ */
bnx2fc_arm_cq(tgt);
} else
/* Arm CQ */
bnx2fc_arm_cq(tgt);
return;

ofld_err:
Expand Down Expand Up @@ -806,14 +806,14 @@ static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
struct bnx2fc_rport *tgt)
{
BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n");
void __iomem *ctx_base_ptr;

if (tgt->ctx_base) {
iounmap(tgt->ctx_base);
tgt->ctx_base = NULL;
}
BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n");

spin_lock_bh(&tgt->cq_lock);
ctx_base_ptr = tgt->ctx_base;
tgt->ctx_base = NULL;

/* Free LCQ */
if (tgt->lcq) {
dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size,
Expand Down Expand Up @@ -867,4 +867,7 @@ static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
tgt->sq = NULL;
}
spin_unlock_bh(&tgt->cq_lock);

if (ctx_base_ptr)
iounmap(ctx_base_ptr);
}

0 comments on commit 1bb129c

Please sign in to comment.