Running the function with timeout parameter, I found that hard-coded 10000 value gives 10 seconds timeout, and 10*HZ value gives 2.5 seconds timeout:
usb_bulk_msg(context->udev, pipe, context->buffer, context_size, &bytes_read,
10000 ); // 10 seconds
// 10*HZ); // 2.5 seconds
HZ value printed with printk gives 250 – this value is incorrect. Looking in the Linux source: http://lxr.free-electrons.com/source/include/asm-generic/param.h#L6, I see that HZ is defined as CONFIG_HZ – looks like configuration parameter. Why this value is incorrect, is there another way to specify jiffies timeout?
Ubuntu 12.04, 32 bit, kernel version 3.2.34.
That’s because
usb_bulk_msgtakes the number milliseconds, not the number of jiffies, as its sixth argument: