linaro-swg / linux

Linux kernel source tree
Other
41 stars 79 forks source link

uninterruptible msleep() in handle_rpc_func_cmd_wait() #41

Closed tiger-yu99 closed 7 years ago

tiger-yu99 commented 7 years ago

Hi, I just cloned the latest tee driver code from this tee branch. I found a issue about using msleep() in handle_rpc_func_cmd_wait() function. msleep() will call schedule_timeout_uninterruptible() internally and calling thread will become uninterruptible, so it has no effect to call "set_current_state(TASK_INTERRUPTIBLE)" before calling msleep(). I suggest to use msleep_interruptible() directly to substitute following code segment:

/* set task's state to interruptible sleep */
set_current_state(TASK_INTERRUPTIBLE);

/* take a nap */
msleep(msec_to_wait);

Please review, thanks

jenswi-linaro commented 7 years ago

Thanks, looks good to me. Please create a pull request on github.

tiger-yu99 commented 7 years ago

I've created a pull request for it, please review. thanks