On Tue, Jun 14, 2011 at 1:12 AM, Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote: >> transport_lookup_cmd_lun() may be called from interrupt context (eg >> tcm_loop_allocate_core_cmd() calls it, and it has a comment that says, >> "Can be called from interrupt context"), so it needs to use >> spin_lock_irqsave() instead of spin_lock_irq() to avoid enabling >> interrupts at the wrong time. > It currently is, but I think we'd better be off stopping to call it from > IRQ context. Soon after we offload the work to thread context anyway. > By moving the point of offloading a little earlier we can simply the > calling conventions a lot, and keep the amount of code that needs > IRQ-safe locking minimal. Fair enough... however that seems like a much more major project, as eg the qla2xxx code does a fair bit from interrupt context. Also it seems even if we are running from thread context it would be legitimate for a target driver to do spin_lock_irq(&internal_target_lock); ... transport_lookup_cmd_lun(); ... spin_unlock_irq and so transport_lookup_cmd_lun() shouldn't be reenabling IRQs unconditionally. Thanks, Roland -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html