interruptible_sleep_on_timeout replacement

Mason slash.tmp at free.fr
Fri Nov 27 09:37:47 PST 2015


Hello Arnd,

I have to port /ancient/ code to v4.1
The problematic line is:

  long timeout_jiffies = US_TO_JIFFIES(wait_param->timeout_microsecond);
  ...
  timeout_jiffies = interruptible_sleep_on_timeout(&(llad_context.irq_queue), timeout_jiffies);
  wait_param->timeout_microsecond = JIFFIES_TO_US(timeout_jiffies);

IIUC, the appropriate replacement is

  wait_event_interruptible_timeout(wq, condition, timeout)

where wq and timeout are the original parameters?

To determine the condition... do I have to examine the corresponding
wake_up_interruptible() calls? I do see several

	if (status & SOME_VAL) {
		if (!test_and_set_bit(LOG2_SOME_VAL, &(llad_context.irq_bits)))
			wake_up_interruptible(&(llad_context.irq_queue));
	}

Also I'm not sure the return value is a direct match?

Regards.



More information about the linux-arm-kernel mailing list