mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 13:11:27 +00:00
scst_user, rt: Wake command processing thread when needed
In a fully-preemptible realtime kernel (CONFIG_PREEMPT_RT_FULL=y), SCSI commands from an initiator time out because the userland target application is never woken to process them. This is because in a fully-preemptible realtime kernel, soft-IRQ (tasklet) execution always occurs in a ksoftirqd thread and preempt_count is not manipulated on soft-IRQ processing entry/exit. This makes in_interrupt() useless for determining whether soft-IRQ processing is occurring; instead, in_serving_softirq() should be used for that purpose. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> [bvanassche: Elaborated source code comment] git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5272 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1129,7 +1129,12 @@ static void dev_user_add_to_ready(struct scst_user_cmd *ucmd)
|
||||
{
|
||||
struct scst_user_dev *dev = ucmd->dev;
|
||||
unsigned long flags;
|
||||
int do_wake = in_interrupt();
|
||||
/*
|
||||
* Note, a separate softIRQ check is required for real-time kernels
|
||||
* (CONFIG_PREEMPT_RT_FULL=y) since on such kernels softIRQ's are
|
||||
* served in thread context. See also http://lwn.net/Articles/302043/.
|
||||
*/
|
||||
int do_wake = in_interrupt() || in_serving_softirq();
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user