Skip to content

Commit

Permalink
snsc: pass timeout as HZ independent value
Browse files Browse the repository at this point in the history
schedule_timeout takes a timeout in jiffies but the code currently is
passing in a constant SCDRV_TIMEOUT which makes this timeout HZ
dependent, so pass it through msecs_to_jiffies() to fix this up.

patch was compile tested with generic_defconfig (implies CONFIG_SGI_SNSC=y)

Patch is against 4.0-rc5 (localversion-next is -next-20150527)

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Nicholas Mc Guire authored and Greg Kroah-Hartman committed Jun 1, 2015
1 parent 0e4a566 commit fdd2db2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/char/snsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ scdrv_read(struct file *file, char __user *buf, size_t count, loff_t *f_pos)
add_wait_queue(&sd->sd_rq, &wait);
spin_unlock_irqrestore(&sd->sd_rlock, flags);

schedule_timeout(SCDRV_TIMEOUT);
schedule_timeout(msecs_to_jiffies(SCDRV_TIMEOUT));

remove_wait_queue(&sd->sd_rq, &wait);
if (signal_pending(current)) {
Expand Down Expand Up @@ -294,7 +294,7 @@ scdrv_write(struct file *file, const char __user *buf,
add_wait_queue(&sd->sd_wq, &wait);
spin_unlock_irqrestore(&sd->sd_wlock, flags);

schedule_timeout(SCDRV_TIMEOUT);
schedule_timeout(msecs_to_jiffies(SCDRV_TIMEOUT));

remove_wait_queue(&sd->sd_wq, &wait);
if (signal_pending(current)) {
Expand Down

0 comments on commit fdd2db2

Please sign in to comment.