From a7648c418e01ab8e5de239646e67876595b3ebd3 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 4 Jun 2014 15:17:59 +0000 Subject: [PATCH] ib_srpt: Avoid triggering a SCSI command timeout after login git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5567 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 7be179840..b04e302d3 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -2059,6 +2059,16 @@ static int srpt_compl_thread(void *arg) ch = arg; BUG_ON(!ch); + while (ch->state < CH_LIVE) { + set_current_state(TASK_INTERRUPTIBLE); + if (srpt_process_completion(ch, poll_budget) >= poll_budget) + cond_resched(); + else + schedule(); + } + + srpt_process_wait_list(ch); + while (ch->state < CH_DISCONNECTED) { set_current_state(TASK_INTERRUPTIBLE); if (srpt_process_completion(ch, poll_budget) >= poll_budget)