From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhu Yanjun Subject: [PATCH 2/5] rds: ib: replace spin_lock_irq with spin_lock_irqsave Date: Thu, 9 Mar 2017 02:26:42 -0500 Message-ID: <1489044405-26150-2-git-send-email-yanjun.zhu@oracle.com> References: <1489044405-26150-1-git-send-email-yanjun.zhu@oracle.com> Return-path: In-Reply-To: <1489044405-26150-1-git-send-email-yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: santosh.shilimkar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, rds-devel-N0ozoZBvEnrZJqsBc5GL+g@public.gmane.org List-Id: linux-rdma@vger.kernel.org It is difficult to make sure the state of the interrupt when this function is called. As such, it is safer to use spin_lock_irqsave than spin_lock_irq. Cc: Joe Jin Cc: Junxiao Bi Signed-off-by: Zhu Yanjun --- net/rds/ib_cm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/rds/ib_cm.c b/net/rds/ib_cm.c index eca3d5f..87ec4dd 100644 --- a/net/rds/ib_cm.c +++ b/net/rds/ib_cm.c @@ -963,6 +963,7 @@ void rds_ib_conn_free(void *arg) { struct rds_ib_connection *ic = arg; spinlock_t *lock_ptr; + unsigned long flags; rdsdebug("ic %p\n", ic); @@ -973,9 +974,9 @@ void rds_ib_conn_free(void *arg) */ lock_ptr = ic->rds_ibdev ? &ic->rds_ibdev->spinlock : &ib_nodev_conns_lock; - spin_lock_irq(lock_ptr); + spin_lock_irqsave(lock_ptr, flags); list_del(&ic->ib_node); - spin_unlock_irq(lock_ptr); + spin_unlock_irqrestore(lock_ptr, flags); rds_ib_recv_free_caches(ic); -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html