Skip to content

Commit

Permalink
hrtimer: Remove all hrtimeout functions
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Frade <kernel@xanmod.org>
  • Loading branch information
xanmod committed Dec 22, 2021
1 parent 7f25f42 commit 7694270
Show file tree
Hide file tree
Showing 57 changed files with 98 additions and 279 deletions.
4 changes: 2 additions & 2 deletions drivers/accessibility/speakup/speakup_acntpc.c
Expand Up @@ -198,7 +198,7 @@ static void do_catch_up(struct spk_synth *synth)
full_time_val = full_time->u.n.value;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (synth_full()) {
schedule_msec_hrtimeout((full_time_val));
schedule_timeout(msecs_to_jiffies(full_time_val));
continue;
}
set_current_state(TASK_RUNNING);
Expand Down Expand Up @@ -226,7 +226,7 @@ static void do_catch_up(struct spk_synth *synth)
jiffy_delta_val = jiffy_delta->u.n.value;
delay_time_val = delay_time->u.n.value;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
schedule_msec_hrtimeout(delay_time_val);
schedule_timeout(msecs_to_jiffies(delay_time_val));
jiff_max = jiffies + jiffy_delta_val;
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/accessibility/speakup/speakup_apollo.c
Expand Up @@ -165,7 +165,7 @@ static void do_catch_up(struct spk_synth *synth)
if (!synth->io_ops->synth_out(synth, ch)) {
synth->io_ops->tiocmset(0, UART_MCR_RTS);
synth->io_ops->tiocmset(UART_MCR_RTS, 0);
schedule_msec_hrtimeout(full_time_val);
schedule_timeout(msecs_to_jiffies(full_time_val));
continue;
}
if (time_after_eq(jiffies, jiff_max) && (ch == SPACE)) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/accessibility/speakup/speakup_decext.c
Expand Up @@ -180,7 +180,7 @@ static void do_catch_up(struct spk_synth *synth)
if (ch == '\n')
ch = 0x0D;
if (synth_full() || !synth->io_ops->synth_out(synth, ch)) {
schedule_msec_hrtimeout(delay_time_val);
schedule_timeout(msecs_to_jiffies(delay_time_val));
continue;
}
set_current_state(TASK_RUNNING);
Expand Down
2 changes: 1 addition & 1 deletion drivers/accessibility/speakup/speakup_decpc.c
Expand Up @@ -398,7 +398,7 @@ static void do_catch_up(struct spk_synth *synth)
if (ch == '\n')
ch = 0x0D;
if (dt_sendchar(ch)) {
schedule_msec_hrtimeout((delay_time_val));
schedule_timeout(msecs_to_jiffies(delay_time_val));
continue;
}
set_current_state(TASK_RUNNING);
Expand Down
2 changes: 1 addition & 1 deletion drivers/accessibility/speakup/speakup_dectlk.c
Expand Up @@ -247,7 +247,7 @@ static void do_catch_up(struct spk_synth *synth)
if (ch == '\n')
ch = 0x0D;
if (synth_full_val || !synth->io_ops->synth_out(synth, ch)) {
schedule_msec_hrtimeout(delay_time_val);
schedule_timeout(msecs_to_jiffies(delay_time_val));
continue;
}
set_current_state(TASK_RUNNING);
Expand Down
4 changes: 2 additions & 2 deletions drivers/accessibility/speakup/speakup_dtlk.c
Expand Up @@ -211,7 +211,7 @@ static void do_catch_up(struct spk_synth *synth)
delay_time_val = delay_time->u.n.value;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (synth_full()) {
schedule_msec_hrtimeout((delay_time_val));
schedule_timeout(msecs_to_jiffies(delay_time_val));
continue;
}
set_current_state(TASK_RUNNING);
Expand All @@ -227,7 +227,7 @@ static void do_catch_up(struct spk_synth *synth)
delay_time_val = delay_time->u.n.value;
jiffy_delta_val = jiffy_delta->u.n.value;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
schedule_msec_hrtimeout((delay_time_val));
schedule_timeout(msecs_to_jiffies(delay_time_val));
jiff_max = jiffies + jiffy_delta_val;
}
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/accessibility/speakup/speakup_keypc.c
Expand Up @@ -199,7 +199,7 @@ static void do_catch_up(struct spk_synth *synth)
full_time_val = full_time->u.n.value;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (synth_full()) {
schedule_msec_hrtimeout((full_time_val));
schedule_timeout(msecs_to_jiffies(full_time_val));
continue;
}
set_current_state(TASK_RUNNING);
Expand Down Expand Up @@ -232,7 +232,7 @@ static void do_catch_up(struct spk_synth *synth)
jiffy_delta_val = jiffy_delta->u.n.value;
delay_time_val = delay_time->u.n.value;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
schedule_msec_hrtimeout(delay_time_val);
schedule_timeout(msecs_to_jiffies(delay_time_val));
jiff_max = jiffies + jiffy_delta_val;
}
}
Expand Down
14 changes: 10 additions & 4 deletions drivers/accessibility/speakup/synth.c
Expand Up @@ -93,8 +93,12 @@ static void _spk_do_catch_up(struct spk_synth *synth, int unicode)
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (ch == '\n')
ch = synth->procspeech;
if (!synth->io_ops->synth_out(synth, ch)) {
schedule_msec_hrtimeout(full_time_val);
if (unicode)
ret = synth->io_ops->synth_out_unicode(synth, ch);
else
ret = synth->io_ops->synth_out(synth, ch);
if (!ret) {
schedule_timeout(msecs_to_jiffies(full_time_val));
continue;
}
if (time_after_eq(jiffies, jiff_max) && (ch == SPACE)) {
Expand All @@ -104,9 +108,11 @@ static void _spk_do_catch_up(struct spk_synth *synth, int unicode)
full_time_val = full_time->u.n.value;
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
if (synth->io_ops->synth_out(synth, synth->procspeech))
schedule_msec_hrtimeout(delay_time_val);
schedule_timeout(
msecs_to_jiffies(delay_time_val));
else
schedule_msec_hrtimeout(full_time_val);
schedule_timeout(
msecs_to_jiffies(full_time_val));
jiff_max = jiffies + jiffy_delta_val;
}
set_current_state(TASK_RUNNING);
Expand Down
5 changes: 2 additions & 3 deletions drivers/block/swim.c
Expand Up @@ -328,7 +328,7 @@ static inline void swim_motor(struct swim __iomem *base,
if (swim_readbit(base, MOTOR_ON))
break;
set_current_state(TASK_INTERRUPTIBLE);
schedule_min_hrtimeout();
schedule_timeout(1);
}
} else if (action == OFF) {
swim_action(base, MOTOR_OFF);
Expand All @@ -347,7 +347,7 @@ static inline void swim_eject(struct swim __iomem *base)
if (!swim_readbit(base, DISK_IN))
break;
set_current_state(TASK_INTERRUPTIBLE);
schedule_min_hrtimeout();
schedule_timeout(1);
}
swim_select(base, RELAX);
}
Expand All @@ -372,7 +372,6 @@ static inline int swim_step(struct swim __iomem *base)

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(1);
schedule_min_hrtimeout();

swim_select(base, RELAX);
if (!swim_readbit(base, STEP))
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/ipmi/ipmi_msghandler.c
Expand Up @@ -3564,7 +3564,7 @@ static void cleanup_smi_msgs(struct ipmi_smi *intf)
/* Current message first, to preserve order */
while (intf->curr_msg && !list_empty(&intf->waiting_rcv_msgs)) {
/* Wait for the message to clear out. */
schedule_min_hrtimeout();
schedule_timeout(1);
}

/* No need for locks, the interface is down. */
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/ipmi/ipmi_ssif.c
Expand Up @@ -1288,7 +1288,7 @@ static void shutdown_ssif(void *send_info)

/* make sure the driver is not looking for flags any more. */
while (ssif_info->ssif_state != SSIF_NORMAL)
schedule_min_hrtimeout();
schedule_timeout(1);

ssif_info->stopping = true;
del_timer_sync(&ssif_info->watch_timer);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
Expand Up @@ -235,7 +235,7 @@ static int vmw_fifo_wait_noirq(struct vmw_private *dev_priv,
DRM_ERROR("SVGA device lockup.\n");
break;
}
schedule_min_hrtimeout();
schedule_timeout(1);
if (interruptible && signal_pending(current)) {
ret = -ERESTARTSYS;
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/vmwgfx/vmwgfx_irq.c
Expand Up @@ -203,7 +203,7 @@ int vmw_fallback_wait(struct vmw_private *dev_priv,
break;
}
if (lazy)
schedule_min_hrtimeout();
schedule_timeout(1);
else if ((++count & 0x0F) == 0) {
/**
* FIXME: Use schedule_hr_timeout here for
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/fam15h_power.c
Expand Up @@ -221,7 +221,7 @@ static ssize_t power1_average_show(struct device *dev,
prev_ptsc[cu] = data->cpu_sw_pwr_ptsc[cu];
}

leftover = schedule_msec_hrtimeout_interruptible((data->power_period));
leftover = schedule_timeout_interruptible(msecs_to_jiffies(data->power_period));
if (leftover)
return 0;

Expand Down
6 changes: 5 additions & 1 deletion drivers/iio/light/tsl2563.c
Expand Up @@ -269,7 +269,11 @@ static void tsl2563_wait_adc(struct tsl2563_chip *chip)
default:
delay = 402;
}
schedule_msec_hrtimeout_interruptible(delay + 1);
/*
* TODO: Make sure that we wait at least required delay but why we
* have to extend it one tick more?
*/
schedule_timeout_interruptible(msecs_to_jiffies(delay) + 2);
}

static int tsl2563_adjust_gainlevel(struct tsl2563_chip *chip, u16 adc)
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/i2c/msp3400-driver.c
Expand Up @@ -170,7 +170,7 @@ static int msp_read(struct i2c_client *client, int dev, int addr)
break;
dev_warn(&client->dev, "I/O error #%d (read 0x%02x/0x%02x)\n", err,
dev, addr);
schedule_msec_hrtimeout_interruptible((10));
schedule_timeout_interruptible(msecs_to_jiffies(10));
}
if (err == 3) {
dev_warn(&client->dev, "resetting chip, sound will go off.\n");
Expand Down Expand Up @@ -211,7 +211,7 @@ static int msp_write(struct i2c_client *client, int dev, int addr, int val)
break;
dev_warn(&client->dev, "I/O error #%d (write 0x%02x/0x%02x)\n", err,
dev, addr);
schedule_msec_hrtimeout_interruptible((10));
schedule_timeout_interruptible(msecs_to_jiffies(10));
}
if (err == 3) {
dev_warn(&client->dev, "resetting chip, sound will go off.\n");
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/cx18/cx18-gpio.c
Expand Up @@ -81,11 +81,11 @@ static void gpio_reset_seq(struct cx18 *cx, u32 active_lo, u32 active_hi,

/* Assert */
gpio_update(cx, mask, ~active_lo);
schedule_msec_hrtimeout_uninterruptible((assert_msecs));
schedule_timeout_uninterruptible(msecs_to_jiffies(assert_msecs));

/* Deassert */
gpio_update(cx, mask, ~active_hi);
schedule_msec_hrtimeout_uninterruptible((recovery_msecs));
schedule_timeout_uninterruptible(msecs_to_jiffies(recovery_msecs));
}

/*
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/pci/ivtv/ivtv-gpio.c
Expand Up @@ -105,7 +105,7 @@ void ivtv_reset_ir_gpio(struct ivtv *itv)
curout = (curout & ~0xF) | 1;
write_reg(curout, IVTV_REG_GPIO_OUT);
/* We could use something else for smaller time */
schedule_msec_hrtimeout_interruptible((1));
schedule_timeout_interruptible(msecs_to_jiffies(1));
curout |= 2;
write_reg(curout, IVTV_REG_GPIO_OUT);
curdir &= ~0x80;
Expand All @@ -125,11 +125,11 @@ int ivtv_reset_tuner_gpio(void *dev, int component, int cmd, int value)
curout = read_reg(IVTV_REG_GPIO_OUT);
curout &= ~(1 << itv->card->xceive_pin);
write_reg(curout, IVTV_REG_GPIO_OUT);
schedule_msec_hrtimeout_interruptible((1));
schedule_timeout_interruptible(msecs_to_jiffies(1));

curout |= 1 << itv->card->xceive_pin;
write_reg(curout, IVTV_REG_GPIO_OUT);
schedule_msec_hrtimeout_interruptible((1));
schedule_timeout_interruptible(msecs_to_jiffies(1));
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/ivtv/ivtv-ioctl.c
Expand Up @@ -1139,7 +1139,7 @@ void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id std)
TASK_UNINTERRUPTIBLE);
if ((read_reg(IVTV_REG_DEC_LINE_FIELD) >> 16) < 100)
break;
schedule_msec_hrtimeout((25));
schedule_timeout(msecs_to_jiffies(25));
}
finish_wait(&itv->vsync_waitq, &wait);
mutex_lock(&itv->serialize_lock);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/ivtv/ivtv-streams.c
Expand Up @@ -849,7 +849,7 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
while (!test_bit(IVTV_F_I_EOS, &itv->i_flags) &&
time_before(jiffies,
then + msecs_to_jiffies(2000))) {
schedule_msec_hrtimeout((10));
schedule_timeout(msecs_to_jiffies(10));
}

/* To convert jiffies to ms, we must multiply by 1000
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-mr800.c
Expand Up @@ -366,7 +366,7 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *priv,
retval = -ENODATA;
break;
}
if (schedule_msec_hrtimeout_interruptible((10))) {
if (schedule_timeout_interruptible(msecs_to_jiffies(10))) {
retval = -ERESTARTSYS;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/radio-tea5777.c
Expand Up @@ -235,7 +235,7 @@ static int radio_tea5777_update_read_reg(struct radio_tea5777 *tea, int wait)
}

if (wait) {
if (schedule_msec_hrtimeout_interruptible((wait)))
if (schedule_timeout_interruptible(msecs_to_jiffies(wait)))
return -ERESTARTSYS;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/radio/tea575x.c
Expand Up @@ -401,7 +401,7 @@ int snd_tea575x_s_hw_freq_seek(struct file *file, struct snd_tea575x *tea,
for (;;) {
if (time_after(jiffies, timeout))
break;
if (schedule_msec_hrtimeout_interruptible((10))) {
if (schedule_timeout_interruptible(msecs_to_jiffies(10))) {
/* some signal arrived, stop search */
tea->val &= ~TEA575X_BIT_SEARCH;
snd_tea575x_set_freq(tea);
Expand Down
2 changes: 1 addition & 1 deletion drivers/mfd/ucb1x00-core.c
Expand Up @@ -250,7 +250,7 @@ unsigned int ucb1x00_adc_read(struct ucb1x00 *ucb, int adc_channel, int sync)
break;
/* yield to other processes */
set_current_state(TASK_INTERRUPTIBLE);
schedule_min_hrtimeout();
schedule_timeout(1);
}

return UCB_ADC_DAT(val);
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/sgi-xp/xpc_channel.c
Expand Up @@ -834,7 +834,7 @@ xpc_allocate_msg_wait(struct xpc_channel *ch)

atomic_inc(&ch->n_on_msg_allocate_wq);
prepare_to_wait(&ch->msg_allocate_wq, &wait, TASK_INTERRUPTIBLE);
ret = schedule_min_hrtimeout();
ret = schedule_timeout(1);
finish_wait(&ch->msg_allocate_wq, &wait);
atomic_dec(&ch->n_on_msg_allocate_wq);

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/caif/caif_hsi.c
Expand Up @@ -924,7 +924,7 @@ static void cfhsi_wake_down(struct work_struct *work)
break;

set_current_state(TASK_INTERRUPTIBLE);
schedule_min_hrtimeout();
schedule_timeout(1);
retry--;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/usb/peak_usb/pcan_usb.c
Expand Up @@ -291,7 +291,7 @@ static int pcan_usb_write_mode(struct peak_usb_device *dev, u8 onoff)
} else {
/* the PCAN-USB needs time to init */
set_current_state(TASK_INTERRUPTIBLE);
schedule_msec_hrtimeout((PCAN_USB_STARTUP_TIMEOUT));
schedule_timeout(msecs_to_jiffies(PCAN_USB_STARTUP_TIMEOUT));
}

return err;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/lan78xx.c
Expand Up @@ -2674,7 +2674,7 @@ static void lan78xx_terminate_urbs(struct lan78xx_net *dev)
while (!skb_queue_empty(&dev->rxq) &&
!skb_queue_empty(&dev->txq) &&
!skb_queue_empty(&dev->done)) {
schedule_msec_hrtimeout((UNLINK_TIMEOUT_MS));
schedule_timeout(msecs_to_jiffies(UNLINK_TIMEOUT_MS));
set_current_state(TASK_UNINTERRUPTIBLE);
netif_dbg(dev, ifdown, dev->net,
"waited for %d urb completions\n", temp);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/usb/usbnet.c
Expand Up @@ -764,7 +764,7 @@ static void wait_skb_queue_empty(struct sk_buff_head *q)
spin_lock_irqsave(&q->lock, flags);
while (!skb_queue_empty(q)) {
spin_unlock_irqrestore(&q->lock, flags);
schedule_msec_hrtimeout((UNLINK_TIMEOUT_MS));
schedule_timeout(msecs_to_jiffies(UNLINK_TIMEOUT_MS));
set_current_state(TASK_UNINTERRUPTIBLE);
spin_lock_irqsave(&q->lock, flags);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/wireless/intel/ipw2x00/ipw2100.c
Expand Up @@ -815,7 +815,7 @@ static int ipw2100_hw_send_command(struct ipw2100_priv *priv,
* doesn't seem to have as many firmware restart cycles...
*
* As a test, we're sticking in a 1/100s delay here */
schedule_msec_hrtimeout_uninterruptible((10));
schedule_timeout_uninterruptible(msecs_to_jiffies(10));

return 0;

Expand Down Expand Up @@ -1266,7 +1266,7 @@ static int ipw2100_start_adapter(struct ipw2100_priv *priv)
IPW_DEBUG_FW("Waiting for f/w initialization to complete...\n");
i = 5000;
do {
schedule_msec_hrtimeout_uninterruptible((40));
schedule_timeout_uninterruptible(msecs_to_jiffies(40));
/* Todo... wait for sync command ... */

read_register(priv->net_dev, IPW_REG_INTA, &inta);
Expand Down
2 changes: 1 addition & 1 deletion drivers/parport/ieee1284.c
Expand Up @@ -202,7 +202,7 @@ int parport_wait_peripheral(struct parport *port,
/* parport_wait_event didn't time out, but the
* peripheral wasn't actually ready either.
* Wait for another 10ms. */
schedule_msec_hrtimeout_interruptible((10));
schedule_timeout_interruptible(msecs_to_jiffies(10));
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/parport/ieee1284_ops.c
Expand Up @@ -520,7 +520,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port,
/* Yield the port for a while. */
if (dev->port->irq != PARPORT_IRQ_NONE) {
parport_release (dev);
schedule_msec_hrtimeout_interruptible((40));
schedule_timeout_interruptible(msecs_to_jiffies(40));
parport_claim_or_block (dev);
}
else
Expand Down

0 comments on commit 7694270

Please sign in to comment.