u32 opcode;
                u32 psn;
                int diff;
-               unsigned long flags;
 
                /* Sanity check packet */
                if (tlen < 24)
 
                        switch (qp->ibqp.qp_type) {
                        case IB_QPT_RC:
-                               spin_lock_irqsave(&qp->s_lock, flags);
                                ruc_res =
                                        qib_ruc_check_hdr(
                                                ibp, hdr,
                                                qp,
                                                be32_to_cpu(ohdr->bth[0]));
                                if (ruc_res) {
-                                       spin_unlock_irqrestore(&qp->s_lock,
-                                                              flags);
                                        goto unlock;
                                }
-                               spin_unlock_irqrestore(&qp->s_lock, flags);
 
                                /* Only deal with RDMA Writes for now */
                                if (opcode <
 
        }
 
        opcode = be32_to_cpu(ohdr->bth[0]);
-       spin_lock_irqsave(&qp->s_lock, flags);
        if (qib_ruc_check_hdr(ibp, hdr, has_grh, qp, opcode))
-               goto sunlock;
-       spin_unlock_irqrestore(&qp->s_lock, flags);
+               return;
 
        psn = be32_to_cpu(ohdr->bth[2]);
        opcode >>= 24;
 
 
 /*
  *
- * This should be called with the QP s_lock held.
+ * This should be called with the QP r_lock held.
+ *
+ * The s_lock will be acquired around the qib_migrate_qp() call.
  */
 int qib_ruc_check_hdr(struct qib_ibport *ibp, struct qib_ib_header *hdr,
                      int has_grh, struct qib_qp *qp, u32 bth0)
 {
        __be64 guid;
+       unsigned long flags;
 
        if (qp->s_mig_state == IB_MIG_ARMED && (bth0 & IB_BTH_MIG_REQ)) {
                if (!has_grh) {
                if (be16_to_cpu(hdr->lrh[3]) != qp->alt_ah_attr.dlid ||
                    ppd_from_ibp(ibp)->port != qp->alt_ah_attr.port_num)
                        goto err;
+               spin_lock_irqsave(&qp->s_lock, flags);
                qib_migrate_qp(qp);
+               spin_unlock_irqrestore(&qp->s_lock, flags);
        } else {
                if (!has_grh) {
                        if (qp->remote_ah_attr.ah_flags & IB_AH_GRH)
 
                int has_grh, void *data, u32 tlen, struct qib_qp *qp)
 {
        struct qib_other_headers *ohdr;
-       unsigned long flags;
        u32 opcode;
        u32 hdrsize;
        u32 psn;
        }
 
        opcode = be32_to_cpu(ohdr->bth[0]);
-       spin_lock_irqsave(&qp->s_lock, flags);
        if (qib_ruc_check_hdr(ibp, hdr, has_grh, qp, opcode))
-               goto sunlock;
-       spin_unlock_irqrestore(&qp->s_lock, flags);
+               return;
 
        psn = be32_to_cpu(ohdr->bth[2]);
        opcode >>= 24;
        qib_rc_error(qp, IB_WC_LOC_QP_OP_ERR);
        return;
 
-sunlock:
-       spin_unlock_irqrestore(&qp->s_lock, flags);
 }