[SCSI] bnx2fc: Do not arm CQ when there are no CQEs
Bhanu Prakash Gollapudi [Wed, 27 Jul 2011 18:32:11 +0000 (11:32 -0700)]
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

drivers/scsi/bnx2fc/bnx2fc_hwi.c

index 9f38c57..357a63d 100644 (file)
@@ -1070,8 +1070,10 @@ unlock:
                                1 - tgt->cq_curr_toggle_bit;
                }
        }
-       bnx2fc_arm_cq(tgt);
-       atomic_add(num_free_sqes, &tgt->free_sqes);
+       if (num_free_sqes) {
+               bnx2fc_arm_cq(tgt);
+               atomic_add(num_free_sqes, &tgt->free_sqes);
+       }
        spin_unlock_bh(&tgt->cq_lock);
        return 0;
 }