From 2de35d6ad4a32919722fea0ff99c22ef53537cc4 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 3 Jul 2009 19:15:15 +0000 Subject: [PATCH] Fixed the following issue reported by lockdep: ------------[ cut here ]------------ WARNING: at kernel/lockdep.c:2197 trace_hardirqs_on_caller+0x14c/0x1b0() Call Trace: [] warn_slowpath+0xaf/0x110 [] ? check_usage_forwards+0x5e/0xc0 [] ? mark_lock+0x538/0xcc0 [] ? cache_alloc_refill+0x191/0x2b0 [] ? _spin_unlock_irq+0x2b/0x40 [] trace_hardirqs_on_caller+0x14c/0x1b0 [] trace_hardirqs_on+0xd/0x10 [] _spin_unlock_irq+0x2b/0x40 [] srpt_handle_new_iu+0x2f1/0x630 [ib_srpt] [] srpt_completion+0x15b/0x300 [ib_srpt] [] mlx4_ib_cq_comp+0x12/0x20 [mlx4_ib] [] mlx4_cq_completion+0x3a/0x80 [mlx4_core] [] mlx4_eq_int+0x295/0x2a0 [mlx4_core] [] mlx4_msi_x_interrupt+0xf/0x20 [mlx4_core] [] handle_IRQ_event+0x35/0x70 [] handle_edge_irq+0xb4/0x150 [] do_IRQ+0x81/0x110 [] ret_from_intr+0x0/0xf [] ? cfb_imageblit+0x578/0x5a0 [] ? bit_putcs+0x3d9/0x6a0 [] ? trace_hardirqs_on_caller+0x162/0x1b0 [] ? trace_hardirqs_on+0xd/0x10 [] ? thread_return+0x3d/0x928 [] ? soft_cursor+0x1ab/0x220 [] ? bit_cursor+0x647/0x6b0 [] ? fbcon_putcs+0x1cb/0x320 [] ? bit_putcs+0x0/0x6a0 [] ? fbcon_redraw+0x166/0x1d0 [] ? fbcon_scroll+0x200/0xd50 [] ? scrup+0x100/0x110 [] ? lf+0x6d/0x70 [] ? do_con_write+0x9dd/0x2300 [] ? mark_held_locks+0x56/0xa0 [] ? trace_hardirqs_on_caller+0x162/0x1b0 [] ? con_write+0x19/0x30 [] ? n_tty_write+0x383/0x480 [] ? trace_hardirqs_on+0xd/0x10 [] ? default_wake_function+0x0/0x10 [] ? tty_write+0x1b4/0x280 [] ? n_tty_write+0x0/0x480 [] ? vfs_write+0xcb/0x170 [] ? sys_write+0x50/0x90 [] ? system_call_fastpath+0x16/0x1b ---[ end trace 954f4d9b9b9cdecc ]--- git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@931 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index d4a0458fe..f8ec3d873 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -911,6 +911,7 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx) scst_data_direction dir = SCST_DATA_NONE; int indirect_desc = 0; int ret; + unsigned long flags; srp_cmd = ioctx->buf; @@ -976,10 +977,10 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx) scst_cmd_set_tgt_priv(scmnd, ioctx); scst_cmd_set_expected(scmnd, dir, ioctx->data_len); - spin_lock_irq(&ch->spinlock); + spin_lock_irqsave(&ch->spinlock, flags); list_add_tail(&ioctx->scmnd_list, &ch->active_scmnd_list); ch->active_scmnd_cnt++; - spin_unlock_irq(&ch->spinlock); + spin_unlock_irqrestore(&ch->spinlock, flags); scst_cmd_init_done(scmnd, scst_estimate_context()); @@ -1083,12 +1084,13 @@ static void srpt_handle_new_iu(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx) { u8 op; + unsigned long flags; if (ch->state != RDMA_CHANNEL_LIVE) { if (ch->state == RDMA_CHANNEL_CONNECTING) { - spin_lock_irq(&ch->spinlock); + spin_lock_irqsave(&ch->spinlock, flags); list_add_tail(&ioctx->wait_list, &ch->cmd_wait_list); - spin_unlock_irq(&ch->spinlock); + spin_unlock_irqrestore(&ch->spinlock, flags); } else srpt_reset_ioctx(ch, ioctx);