On Wed, Jan 15, 2020 at 05:49:13PM +0800, Yixian Liu wrote: > - if (ret) { > - spin_unlock_irqrestore(&qp->sq.lock, flags); > - *bad_wr = wr; > - return ret; > + if (atomic_read(&qp->flush_cnt) == 0) { > + atomic_set(&qp->flush_cnt, 1); > + init_flush_work(hr_dev, qp); > + } else { > + atomic_inc(&qp->flush_cnt); > } Surely this should be written using atomic_add_return ?? Jason