Piling onto this thread, there's actually another use in the SCSI
target stack that I think wants something similar to this.  In
drivers/scsi/qla2xxx/tcm_qla2xxx.c there's some code (for example
tcm_qla2xxx_tpg_store_enable()) which is called from a configfs
callback, and defers a call to configfs_depend_item() (indirectly via
tcm_qla2xxx_depend_tpg() -> target_depend_item()) to a workqueue
because "configfs callbacks can't call configfs_depend_item()."

The code here is trying to express the fact that enabling a target on
an NPIV device (virtual FC port) depends on keeping the base physical
port around.  So I think we need case 1) (depend on an item in the
same subsystem without relocking).

But of course deferring to a workqueue doesn't solve anything because
schedule_work() and wait_for_completion() on a completion completed by
the work item does not avoid any lock dependencies — it's pretty much
equivalent to a direct function call.

So something like this patch would be welcome for solving that problem too.

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to