diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-05-19 20:19:10 -0700 |
---|---|---|
committer | James Bottomley <jbottomley@parallels.com> | 2011-05-24 12:58:17 -0400 |
commit | 53ab6709b4d35b1924240854d794482fd7d33d4a (patch) | |
tree | 9a1b10d03d4c6aa91076dd6ea55a3874f0db590c /drivers/target/target_core_device.c | |
parent | 97868c8905a1537153d406c4a3aa39a503a5c299 (diff) | |
download | kernel_samsung_smdk4412-53ab6709b4d35b1924240854d794482fd7d33d4a.zip kernel_samsung_smdk4412-53ab6709b4d35b1924240854d794482fd7d33d4a.tar.gz kernel_samsung_smdk4412-53ab6709b4d35b1924240854d794482fd7d33d4a.tar.bz2 |
[SCSI] target: Fix interrupt context bug with stats_lock and core_tmr_alloc_req
This patch fixes two bugs wrt to the interrupt context usage of target
core with HW target mode drivers. It first converts the usage of struct
se_device->stats_lock in transport_get_lun_for_cmd() and core_tmr_lun_reset()
to properly use spin_lock_irq() to address an BUG with CONFIG_LOCKDEP_SUPPORT=y
enabled.
This patch also adds a 'in_interrupt()' check to allow GFP_ATOMIC usage from
core_tmr_alloc_req() to fix a 'sleeping in interrupt context' BUG with HW
target fabrics that require this logic to function.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r-- | drivers/target/target_core_device.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index d25e208..fc10ed4 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -150,13 +150,13 @@ out: { struct se_device *dev = se_lun->lun_se_dev; - spin_lock(&dev->stats_lock); + spin_lock_irq(&dev->stats_lock); dev->num_cmds++; if (se_cmd->data_direction == DMA_TO_DEVICE) dev->write_bytes += se_cmd->data_length; else if (se_cmd->data_direction == DMA_FROM_DEVICE) dev->read_bytes += se_cmd->data_length; - spin_unlock(&dev->stats_lock); + spin_unlock_irq(&dev->stats_lock); } /* |