search for: wake_up_all

Displaying 20 results from an estimated 178 matches for "wake_up_all".

2014 Jul 23
2
[PATCH 09/17] drm/radeon: use common fence implementation for fences
...need to call fence_signal() at all? The interrupts at least on radeon are way to unreliable for such a thing. Can enable_signalling fail? What's the reason for fence_signaled() in the first place? > It doesn't need to be completely reliable, or finish immediately. > > And any time wake_up_all(&rdev->fence_queue) is called all the fences that were enabled will be rechecked. I raised this already somewhere else, but should we have some common infrastructure in the core fence code to recheck fences periodically? radeon doesn't seem to be the only hw where this isn't reliabl...
2014 Jul 23
1
[PATCH 09/17] drm/radeon: use common fence implementation for fences
...al() at all? The interrupts at least on radeon are way to unreliable for such a thing. Can enable_signalling fail? What's the reason for fence_signaled() in the first place? >>> It doesn't need to be completely reliable, or finish immediately. >>> >>> And any time wake_up_all(&rdev->fence_queue) is called all the fences that were enabled will be rechecked. >> I raised this already somewhere else, but should we have some common >> infrastructure in the core fence code to recheck fences periodically? >> radeon doesn't seem to be the only hw wh...
2019 Nov 23
1
[PATCH v3 02/14] mm/mmu_notifier: add an interval tree notifier
...line: > > The rtnl_unlock can move up a line too. My editor is failing me on > this. > >>> + /* >>> + * TODO: Since we already have a spinlock above, this would be faster >>> + * as wake_up_q >>> + */ >>> + if (need_wake) >>> + wake_up_all(&mmn_mm->wq); >> >> So why is this important enough for a TODO comment, but not important >> enough to do right away? > > Lets drop the comment, I'm noto sure wake_up_q is even a function this > layer should be calling. Actually, I think you can remove the &q...
2014 Jul 31
0
[PATCH 09/19] drm/radeon: handle lockup in delayed work, v2
...radeon_fence_driver *fence_drv; + struct radeon_device *rdev; + unsigned long iring; + + fence_drv = container_of(work, struct radeon_fence_driver, fence_check_work.work); + rdev = fence_drv->rdev; + iring = fence_drv - &rdev->fence_drv[0]; + + if (__radeon_fence_process(rdev, iring)) + wake_up_all(&rdev->fence_queue); + else if (radeon_ring_is_lockup(rdev, iring, &rdev->ring[iring])) { + /* good news we believe it's a lockup */ + dev_warn(rdev->dev, "GPU lockup (current fence id " + "0x%016llx last fence id 0x%016llx on ring %ld)\n", + (uint64...
2014 Oct 21
1
[PATCH 3/5] hw_random: fix unregister race.
...EUE_HEAD(rng_done); > static unsigned short current_quality; > static unsigned short default_quality; /* = 0; default to "off" */ > > @@ -98,6 +99,7 @@ static inline void cleanup_rng(struct kref *kref) > > if (rng->cleanup) > rng->cleanup(rng); > + wake_up_all(&rng_done); > } > > static void set_current_rng(struct hwrng *rng) > @@ -529,6 +531,9 @@ void hwrng_unregister(struct hwrng *rng) > } > > mutex_unlock(&rng_mutex); > + > + /* Just in case rng is reading right now, wait. */ > + wait_event(rng_done, ato...
2014 Oct 21
1
[PATCH 3/5] hw_random: fix unregister race.
...EUE_HEAD(rng_done); > static unsigned short current_quality; > static unsigned short default_quality; /* = 0; default to "off" */ > > @@ -98,6 +99,7 @@ static inline void cleanup_rng(struct kref *kref) > > if (rng->cleanup) > rng->cleanup(rng); > + wake_up_all(&rng_done); > } > > static void set_current_rng(struct hwrng *rng) > @@ -529,6 +531,9 @@ void hwrng_unregister(struct hwrng *rng) > } > > mutex_unlock(&rng_mutex); > + > + /* Just in case rng is reading right now, wait. */ > + wait_event(rng_done, ato...
2014 Aug 01
2
[PATCH 09/19] drm/radeon: handle lockup in delayed work, v2
...t radeon_device *rdev; > + unsigned long iring; > + > + fence_drv = container_of(work, struct radeon_fence_driver, fence_check_work.work); > + rdev = fence_drv->rdev; > + iring = fence_drv - &rdev->fence_drv[0]; > + > + if (__radeon_fence_process(rdev, iring)) > + wake_up_all(&rdev->fence_queue); > + else if (radeon_ring_is_lockup(rdev, iring, &rdev->ring[iring])) { > + /* good news we believe it's a lockup */ > + dev_warn(rdev->dev, "GPU lockup (current fence id " > + "0x%016llx last fence id 0x%016llx on ring %ld)\n...
2019 Nov 13
2
[PATCH v3 02/14] mm/mmu_notifier: add an interval tree notifier
...pens then * they are progressed. This arrangement for tree updates is used to * avoid using a blocking lock during invalidate_range_start. */ > + /* > + * TODO: Since we already have a spinlock above, this would be faster > + * as wake_up_q > + */ > + if (need_wake) > + wake_up_all(&mmn_mm->wq); So why is this important enough for a TODO comment, but not important enough to do right away? > + * release semantics on the initialization of the mmu_notifier_mm's > + * contents are provided for unlocked readers. acquire can only be > + * use...
2014 Nov 03
3
[PATCH v4 4/6] hw_random: fix unregister race.
...E_WAIT_QUEUE_HEAD(rng_done); static unsigned short current_quality; static unsigned short default_quality; /* = 0; default to "off" */ @@ -98,6 +99,8 @@ static inline void cleanup_rng(struct kref *kref) if (rng->cleanup) rng->cleanup(rng); + rng->cleanup_done = true; + wake_up_all(&rng_done); } static void set_current_rng(struct hwrng *rng) @@ -536,6 +539,11 @@ void hwrng_unregister(struct hwrng *rng) kthread_stop(hwrng_fill); } else mutex_unlock(&rng_mutex); + + /* Just in case rng is reading right now, wait. */ + wait_event(rng_done, rng->cleanup_do...
2014 Nov 03
3
[PATCH v4 4/6] hw_random: fix unregister race.
...E_WAIT_QUEUE_HEAD(rng_done); static unsigned short current_quality; static unsigned short default_quality; /* = 0; default to "off" */ @@ -98,6 +99,8 @@ static inline void cleanup_rng(struct kref *kref) if (rng->cleanup) rng->cleanup(rng); + rng->cleanup_done = true; + wake_up_all(&rng_done); } static void set_current_rng(struct hwrng *rng) @@ -536,6 +539,11 @@ void hwrng_unregister(struct hwrng *rng) kthread_stop(hwrng_fill); } else mutex_unlock(&rng_mutex); + + /* Just in case rng is reading right now, wait. */ + wait_event(rng_done, rng->cleanup_do...
2013 Aug 27
0
[PATCH 1/9] drm/nouveau: Add priv field for event handlers
...au_fence_priv *priv; -}; - static int -nouveau_fence_wait_uevent_handler(struct nouveau_eventh *event, int index) +nouveau_fence_wait_uevent_handler(struct nouveau_eventh *handler, int index) { - struct nouveau_fence_uevent *uevent = - container_of(event, struct nouveau_fence_uevent, handler); - wake_up_all(&uevent->priv->waiting); + struct nouveau_fence_priv *priv = handler->priv; + wake_up_all(&priv->waiting); return NVKM_EVENT_KEEP; } @@ -186,13 +180,13 @@ nouveau_fence_wait_uevent(struct nouveau_fence *fence, bool intr) struct nouveau_channel *chan = fence->channel;...
2014 May 15
2
[RFC PATCH v1 08/16] drm/radeon: use common fence implementation for fences
...om that the whole approach looks like a really bad idea to >> me. How for example is lockup detection supposed to happen with this? > It's not a race condition because fence_queue.lock is held when this > function is called. Ah, I see. That's also the reason why you moved the wake_up_all out of the processing function. > > Lockup's a bit of a weird problem, the changes wouldn't allow core ttm > code to handle the lockup any more, > but any driver specific wait code would still handle this. I did this > by design, because in future patches the wait > fu...
2020 Jun 24
0
[RFC v7 03/11] drm/vblank: Add vblank works
...drm_vblank_work_schedule() are blocked from attempting to schedule while we're in the middle of enabling/disabling vblanks. * Move drm_handle_vblank_works() call below drm_handle_vblank_events() * Simplify drm_vblank_work_cancel_sync() * Fix drm_vblank_work_cancel_sync() documentation * Move wake_up_all() calls out of spinlock where we can. The only one I left was the call to wake_up_all() in drm_vblank_handle_works() as this seemed like it made more sense just living in that function (which is all technically under lock) * Move drm_vblank_work related functions into their own source files *...
2014 Jul 09
2
[PATCH 09/17] drm/radeon: use common fence implementation for fences
...t;dev, "GPU reset failed\n"); > } > > - up_write(&rdev->exclusive_lock); > + /* > + * force all waiters to recheck, some may have been > + * added while the exclusive_lock was unavailable > + */ > + downgrade_write(&rdev->exclusive_lock); > + wake_up_all(&rdev->fence_queue); > + up_read(&rdev->exclusive_lock); > return r; > } > > diff --git a/drivers/gpu/drm/radeon/radeon_fence.c > b/drivers/gpu/drm/radeon/radeon_fence.c > index 6435719fd45b..81c98f6ff0ca 100644 > --- a/drivers/gpu/drm/radeon/radeon_fence.c...
2020 Mar 18
4
[PATCH 1/9] drm/vblank: Add vblank works
...; > static unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ > > @@ -440,6 +443,9 @@ void drm_vblank_cleanup(struct drm_device *dev) > drm_core_check_feature(dev, DRIVER_MODESET)); > > del_timer_sync(&vblank->disable_timer); > + > + wake_up_all(&vblank->vblank_work.work_wait); > + kthread_stop(vblank->vblank_work.thread); > } > > kfree(dev->vblank); > @@ -447,6 +453,108 @@ void drm_vblank_cleanup(struct drm_device *dev) > dev->num_crtcs = 0; > } > > +static int vblank_work_thread(void...
2019 Sep 03
0
[PATCH v2 13/27] drm/dp_mst: Refactor drm_dp_mst_handle_down_rep()
...mutex_lock(&mgr->qlock); - txmsg->state = DRM_DP_SIDEBAND_TX_RX; - mstb->tx_slots[slot] = NULL; - mutex_unlock(&mgr->qlock); + mutex_lock(&mgr->qlock); + txmsg->state = DRM_DP_SIDEBAND_TX_RX; + mstb->tx_slots[slot] = NULL; + mutex_unlock(&mgr->qlock); - wake_up_all(&mgr->tx_waitq); - } - return ret; + wake_up_all(&mgr->tx_waitq); + + return 0; + +no_msg: + drm_dp_mst_topology_put_mstb(mstb); +clear_down_rep_recv: + memset(&mgr->down_rep_recv, 0, sizeof(struct drm_dp_sideband_msg_rx)); + + return 0; } static int drm_dp_mst_handle_up_re...
2019 Sep 25
2
[PATCH v2 03/27] drm/dp_mst: Destroy MSTBs asynchronously
...(mstb->tx_slots[1]) { > - mstb->tx_slots[1]->state = DRM_DP_SIDEBAND_TX_TIMEOUT; > - mstb->tx_slots[1] = NULL; > - wake_tx = true; > - } > - mutex_unlock(&mstb->mgr->qlock); > + INIT_LIST_HEAD(&mstb->destroy_next); > > - if (wake_tx) > - wake_up_all(&mstb->mgr->tx_waitq); > - > - drm_dp_mst_put_mstb_malloc(mstb); > + /* > + * This can get called under mgr->mutex, so we need to perform the > + * actual destruction of the mstb in another worker > + */ > + mutex_lock(&mgr->delayed_destroy_lock); > +...
2020 Mar 18
0
[PATCH 1/9] drm/vblank: Add vblank works
...ruct drm_device *dev, unsigned int pipe); static unsigned int drm_timestamp_precision = 20; /* Default to 20 usecs. */ @@ -440,6 +443,9 @@ void drm_vblank_cleanup(struct drm_device *dev) drm_core_check_feature(dev, DRIVER_MODESET)); del_timer_sync(&vblank->disable_timer); + + wake_up_all(&vblank->vblank_work.work_wait); + kthread_stop(vblank->vblank_work.thread); } kfree(dev->vblank); @@ -447,6 +453,108 @@ void drm_vblank_cleanup(struct drm_device *dev) dev->num_crtcs = 0; } +static int vblank_work_thread(void *data) +{ + struct drm_vblank_crtc *vblank =...
2020 Jun 22
0
[RFC v5 02/10] drm/vblank: Add vblank works
...amp;vblank->pending_work, node) { + drm_vblank_put(vblank->dev, vblank->pipe); + list_del(&work->node); + + if (!--work->pending) { + write_seqcount_invalidate(&work->seqcount); + wake = true; + } + } + + spin_unlock_irq(&vblank->work_lock); + + if (wake) + wake_up_all(&vblank->work_wait_queue); + kthread_destroy_worker(worker); +} + static void drm_vblank_init_release(struct drm_device *dev, void *ptr) { struct drm_vblank_crtc *vblank = ptr; @@ -497,9 +530,66 @@ static void drm_vblank_init_release(struct drm_device *dev, void *ptr) drm_WARN_ON(dev,...
2014 Jul 09
0
[PATCH 09/17] drm/radeon: use common fence implementation for fences
...ell it to userspace ? */ dev_info(rdev->dev, "GPU reset failed\n"); } - up_write(&rdev->exclusive_lock); + /* + * force all waiters to recheck, some may have been + * added while the exclusive_lock was unavailable + */ + downgrade_write(&rdev->exclusive_lock); + wake_up_all(&rdev->fence_queue); + up_read(&rdev->exclusive_lock); return r; } diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 6435719fd45b..81c98f6ff0ca 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fe...