Re: [PATCH] target: Make transport_lookup_cmd_lun() locking IRQ-safe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux