Displaying 20 results from an estimated 168 matches for "msecs_to_jiffi".
Did you mean:
  msecs_to_jiffies
  
2025 Jan 23
2
[PATCH] drm/sched: Use struct for drm_sched_init() params
...params, 0, sizeof(struct drm_sched_init_params));
> > +
> > +	params->submit_wq = NULL; /* Use the system_wq. */
> > +	params->num_rqs = DRM_SCHED_PRIORITY_COUNT;
> > +	params->credit_limit = 1;
> > +	params->hang_limit = 0;
> > +	params->timeout = msecs_to_jiffies(500);
> > +	params->timeout_wq = NULL; /* Use the system_wq. */
> > +	params->score = NULL;
> > +	params->dev = dev;
> > +}
> 
> Could we use only one function that takes struct v3d_dev *v3d, enum
> v3d_queue, and sched_ops as arguments (instead of one fu...
2025 Jan 22
1
[PATCH] drm/sched: Use struct for drm_sched_init() params
...e *dev)
> +{
> +	memset(params, 0, sizeof(struct drm_sched_init_params));
> +
> +	params->submit_wq = NULL; /* Use the system_wq. */
> +	params->num_rqs = DRM_SCHED_PRIORITY_COUNT;
> +	params->credit_limit = 1;
> +	params->hang_limit = 0;
> +	params->timeout = msecs_to_jiffies(500);
> +	params->timeout_wq = NULL; /* Use the system_wq. */
> +	params->score = NULL;
> +	params->dev = dev;
> +}
Could we use only one function that takes struct v3d_dev *v3d, enum
v3d_queue, and sched_ops as arguments (instead of one function per
queue)? You can get the...
2025 Jan 22
5
[PATCH] drm/sched: Use struct for drm_sched_init() params
...iv_gem_submit *submit)
 int etnaviv_sched_init(struct etnaviv_gpu *gpu)
 {
 	int ret;
+	struct drm_sched_init_params params;
 
-	ret = drm_sched_init(&gpu->sched, &etnaviv_sched_ops, NULL,
-			     DRM_SCHED_PRIORITY_COUNT,
-			     etnaviv_hw_jobs_limit, etnaviv_job_hang_limit,
-			     msecs_to_jiffies(500), NULL, NULL,
-			     dev_name(gpu->dev), gpu->dev);
+	memset(¶ms, 0, sizeof(struct drm_sched_init_params));
+
+	params.ops = &etnaviv_sched_ops;
+	params.submit_wq = NULL; /* Use the system_wq. */
+	params.num_rqs = DRM_SCHED_PRIORITY_COUNT;
+	params.credit_limit = etnaviv...
2017 Sep 13
2
Nouveau: kernel hang on Optimus+Intel+NVidia GeForce 1060m
...+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue.c
@@ -326,7 +326,7 @@ nvkm_msgqueue_post(struct nvkm_msgqueue *priv, enum
msgqueue_msg_priority prio,
        int ret;
 
        if (wait_init && !wait_for_completion_timeout(&priv->init_done,
-                                        msecs_to_jiffies(1000)))
+                                        msecs_to_jiffies(5000)))
                return -ETIMEDOUT;
 
        queue = priv->func->cmd_queue(priv, prio);
diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
b/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
i...
2011 Feb 11
1
[PATCH 2/3]: Staging: hv: Use native wait primitives
...@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 		goto Cleanup;
 	}
 
-	/* FIXME: Need to time-out here */
-	osd_waitevent_wait(openInfo->waitevent);
+	openInfo->wait_condition = 0;
+	wait_event_timeout(openInfo->waitevent,
+			openInfo->wait_condition,
+			msecs_to_jiffies(1000));
+	if (openInfo->wait_condition == 0) {
+		err = -ETIMEDOUT;
+		goto errorout;
+	}
+
 
 	if (openInfo->response.open_result.status == 0)
 		DPRINT_INFO(VMBUS, "channel <%p> open success!!", newchannel);
@@ -294,7 +299,6 @@ Cleanup:
 	list_del(&openInfo->msglist...
2011 Feb 11
1
[PATCH 2/3]: Staging: hv: Use native wait primitives
...@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 		goto Cleanup;
 	}
 
-	/* FIXME: Need to time-out here */
-	osd_waitevent_wait(openInfo->waitevent);
+	openInfo->wait_condition = 0;
+	wait_event_timeout(openInfo->waitevent,
+			openInfo->wait_condition,
+			msecs_to_jiffies(1000));
+	if (openInfo->wait_condition == 0) {
+		err = -ETIMEDOUT;
+		goto errorout;
+	}
+
 
 	if (openInfo->response.open_result.status == 0)
 		DPRINT_INFO(VMBUS, "channel <%p> open success!!", newchannel);
@@ -294,7 +299,6 @@ Cleanup:
 	list_del(&openInfo->msglist...
2005 Aug 15
3
[-mm PATCH 2/32] fs: fix-up schedule_timeout() usage
...13-rc5-mm1-dev/fs/cifs/connect.c	2005-08-12 13:42:49.000000000 -0700
@@ -3215,10 +3215,8 @@ cifs_umount(struct super_block *sb, stru
 	}
 	
 	cifs_sb->tcon = NULL;
-	if (ses) {
-		set_current_state(TASK_INTERRUPTIBLE);
-		schedule_timeout(HZ / 2);
-	}
+	if (ses)
+		schedule_timeout_interruptible(msecs_to_jiffies(500));
 	if (ses)
 		sesInfoFree(ses);
 
diff -urpN 2.6.13-rc5-mm1/fs/jbd/transaction.c 2.6.13-rc5-mm1-dev/fs/jbd/transaction.c
--- 2.6.13-rc5-mm1/fs/jbd/transaction.c	2005-08-07 10:05:22.000000000 -0700
+++ 2.6.13-rc5-mm1-dev/fs/jbd/transaction.c	2005-08-10 15:03:33.000000000 -0700
@@ -1340,8 +1...
2025 Jan 22
1
[PATCH] drm/sched: Use struct for drm_sched_init() params
...t's not modified after the
declaration.
> > 		.ops = &panthor_queue_sched_ops,
> > 		.submit_wq = group->ptdev->scheduler->wq,
> > 		.num_rqs = 1,
> > 		.credit_limit = args->ringbuf_size / sizeof(u64),
> > 		.hang_limit = 0,
> > 		.timeout = msecs_to_jiffies(JOB_TIMEOUT_MS),
> > 		.timeout_wq = group->ptdev->reset.wq,
> > 		.name = "panthor-queue",
> > 		.dev = group->ptdev->base.dev,
> >          };  
> 
> +1 on this as a general approach for the whole series. And I'd drop the 
> explicit ze...
2025 Jan 23
1
[PATCH] drm/sched: Use struct for drm_sched_init() params
...aration.
> 
> > > 		.ops = &panthor_queue_sched_ops,
> > > 		.submit_wq = group->ptdev->scheduler->wq,
> > > 		.num_rqs = 1,
> > > 		.credit_limit = args->ringbuf_size / sizeof(u64),
> > > 		.hang_limit = 0,
> > > 		.timeout = msecs_to_jiffies(JOB_TIMEOUT_MS),
> > > 		.timeout_wq = group->ptdev->reset.wq,
> > > 		.name = "panthor-queue",
> > > 		.dev = group->ptdev->base.dev,
> > >          };  
> > 
+2
Matt
> > +1 on this as a general approach for the whole serie...
2013 Oct 28
3
[PATCH net V2] xen-netback: use jiffies_64 value to calculate credit timeout
...1c..8644aca 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1185,18 +1185,17 @@ out:
 
 static bool tx_credit_exceeded(struct xenvif *vif, unsigned size)
 {
-	unsigned long now = jiffies;
-	unsigned long next_credit =
-		vif->credit_timeout.expires +
-		msecs_to_jiffies(vif->credit_usec / 1000);
+	u64 now = get_jiffies_64();
+	u64 next_credit = vif->credit_window_start +
+		(u64)msecs_to_jiffies(vif->credit_usec / 1000);
 
 	/* Timer could already be pending in rare cases. */
 	if (timer_pending(&vif->credit_timeout))
 		return true;
 
 	/* Passe...
2014 Mar 24
2
[PATCH 06/12] drm/nouveau/ibus: add GK20A support
...er ack\n");
> +}
Perhaps I'm being paranoid, but this loop now depends on the frequency
of the various clocks involved and therefore might break at some point
if the frequencies get sufficiently high.
So a slightly safer implementation would use a proper timeout using a
combination of msecs_to_jiffies(), time_before() and usleep_range(),
like so:
	timeout = jiffies + msecs_to_jiffies(...);
	while (time_before(jiffies, timeout)) {
		command = nv_rd32(...) & 0x3f;
		if (command == 0)
			break;
		usleep_range(...);
	}
	if (time_after(jiffies, timeout))
		nv_warn(...);
This assumes that t...
2024 Jul 12
1
[PATCH v2] drm/nouveau: Improve variable names in nouveau_sched_init()
...uveau_sched.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sched.c
@@ -404,7 +404,7 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm,
 {
 	struct drm_gpu_scheduler *drm_sched = &sched->base;
 	struct drm_sched_entity *entity = &sched->entity;
-	long job_hang_limit = msecs_to_jiffies(NOUVEAU_SCHED_JOB_TIMEOUT_MS);
+	const long timeout = msecs_to_jiffies(NOUVEAU_SCHED_JOB_TIMEOUT_MS);
 	int ret;
 
 	if (!wq) {
@@ -418,7 +418,7 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm,
 
 	ret = drm_sched_init(drm_sched, &nouveau_sched_ops, wq,
 			     NOU...
2024 Jul 11
1
[PATCH] drm/nouveau: Improve variable names in nouveau_sched_init()
...uveau_sched.c
+++ b/drivers/gpu/drm/nouveau/nouveau_sched.c
@@ -404,7 +404,8 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm,
 {
 	struct drm_gpu_scheduler *drm_sched = &sched->base;
 	struct drm_sched_entity *entity = &sched->entity;
-	long job_hang_limit = msecs_to_jiffies(NOUVEAU_SCHED_JOB_TIMEOUT_MS);
+	const long timeout = msecs_to_jiffies(NOUVEAU_SCHED_JOB_TIMEOUT_MS);
+	const unsigned int hang_limit = 0;
 	int ret;
 
 	if (!wq) {
@@ -418,7 +419,7 @@ nouveau_sched_init(struct nouveau_sched *sched, struct nouveau_drm *drm,
 
 	ret = drm_sched_init(drm_sched, &am...
2014 Jul 14
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...rng);
> +}
> +
> +static void add_early_randomness(struct hwrng *rng)
The add/get naming seems awkward in the above hunks.
> +{
> +	if (!(rng->flags & HWRNG_DELAY_READ_AT_INIT))
> +		return get_early_randomness(rng);
> +
> +	schedule_delayed_work(&rng->dwork, msecs_to_jiffies(500));
> +}
> +
Perhaps instead of rng->flags and a hardcoded delay, we could have
rng->seed_delay = msecs_to_jiffies(500) in virtio-rng?  Then you can
just call unconditionally:
	schedule_delayed_work(&rng->dwork, rng->seed_delay);
I think that would be a more extensible...
2014 Jul 14
2
[RFC PATCH 1/3] hw_random: allow RNG devices to give early randomness after a delay
...rng);
> +}
> +
> +static void add_early_randomness(struct hwrng *rng)
The add/get naming seems awkward in the above hunks.
> +{
> +	if (!(rng->flags & HWRNG_DELAY_READ_AT_INIT))
> +		return get_early_randomness(rng);
> +
> +	schedule_delayed_work(&rng->dwork, msecs_to_jiffies(500));
> +}
> +
Perhaps instead of rng->flags and a hardcoded delay, we could have
rng->seed_delay = msecs_to_jiffies(500) in virtio-rng?  Then you can
just call unconditionally:
	schedule_delayed_work(&rng->dwork, rng->seed_delay);
I think that would be a more extensible...
2023 May 31
1
[PATCH V2] virtio-fs: Improved request latencies when Virtio queue is full
...88,8 +391,6 @@ static void virtio_fs_request_dispatch_work(struct work_struct *work)
 			if (ret == -ENOMEM || ret == -ENOSPC) {
 				spin_lock(&fsvq->lock);
 				list_add_tail(&req->list, &fsvq->queued_reqs);
-				schedule_delayed_work(&fsvq->dispatch_work,
-						      msecs_to_jiffies(1));
 				spin_unlock(&fsvq->lock);
 				return;
 			}
@@ -436,8 +437,6 @@ static int send_forget_request(struct virtio_fs_vq *fsvq,
 			pr_debug("virtio-fs: Could not queue FORGET: err=%d. Will try later\n",
 				 ret);
 			list_add_tail(&forget->list, &fsvq->queue...
2025 Jan 23
0
[PATCH] drm/sched: Use struct for drm_sched_init() params
...> +
>>>>> +	params->submit_wq = NULL; /* Use the system_wq. */
>>>>> +	params->num_rqs = DRM_SCHED_PRIORITY_COUNT;
>>>>> +	params->credit_limit = 1;
>>>>> +	params->hang_limit = 0;
>>>>> +	params->timeout = msecs_to_jiffies(500);
>>>>> +	params->timeout_wq = NULL; /* Use the system_wq. */
>>>>> +	params->score = NULL;
>>>>> +	params->dev = dev;
>>>>> +}
>>>>
>>>> Could we use only one function that takes struct v3d_dev *v3d,...
2017 Sep 13
0
Nouveau: kernel hang on Optimus+Intel+NVidia GeForce 1060m
...u/nvkm/falcon/msgqueue.c
> @@ -326,7 +326,7 @@ nvkm_msgqueue_post(struct nvkm_msgqueue *priv, enum
> msgqueue_msg_priority prio,
>         int ret;
>
>         if (wait_init && !wait_for_completion_timeout(&priv->init_done,
> -                                        msecs_to_jiffies(1000)))
> +                                        msecs_to_jiffies(5000)))
>                 return -ETIMEDOUT;
>
>         queue = priv->func->cmd_queue(priv, prio);
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/msgqueue_0137c63d.c
> b/drivers/gpu/drm/nouveau/n...
2014 Apr 02
1
[PATCH 06/12] drm/nouveau/ibus: add GK20A support
...ing paranoid, but this loop now depends on the frequency
>> of the various clocks involved and therefore might break at some point
>> if the frequencies get sufficiently high.
>>
>> So a slightly safer implementation would use a proper timeout using a
>> combination of msecs_to_jiffies(), time_before() and usleep_range(),
>> like so:
>>
>>         timeout = jiffies + msecs_to_jiffies(...);
>>
>>         while (time_before(jiffies, timeout)) {
>>                 command = nv_rd32(...) & 0x3f;
>>                 if (command == 0)
>...
2023 Jul 03
2
[PATCH V4] virtio-fs: Improved request latencies when Virtio queue is full
...88,8 +391,6 @@ static void virtio_fs_request_dispatch_work(struct work_struct *work)
 			if (ret == -ENOMEM || ret == -ENOSPC) {
 				spin_lock(&fsvq->lock);
 				list_add_tail(&req->list, &fsvq->queued_reqs);
-				schedule_delayed_work(&fsvq->dispatch_work,
-						      msecs_to_jiffies(1));
 				spin_unlock(&fsvq->lock);
 				return;
 			}
@@ -436,8 +437,6 @@ static int send_forget_request(struct virtio_fs_vq *fsvq,
 			pr_debug("virtio-fs: Could not queue FORGET: err=%d. Will try later\n",
 				 ret);
 			list_add_tail(&forget->list, &fsvq->queue...