Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32c87fca authored by Tejun Heo's avatar Tejun Heo Committed by Dave Airlie
Browse files

drm/radeon: use system_wq instead of dev_priv->wq



With cmwq, there's no reason for radeon to use a dedicated workqueue.
Drop dev_priv->wq and use system_wq instead.

Because radeon_driver_irq_uninstall_kms() may be called from
unsleepable context, the work items can't be flushed from there.
Instead, init and flush from radeon_irq_kms_init/fini().

While at it, simplify canceling/flushing of rdev->pm.dynpm_idle_work.
Always initialize and sync cancel instead of being unnecessarily smart
about it.

Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Acked-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent af5dd83b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2756,7 +2756,7 @@ int evergreen_irq_process(struct radeon_device *rdev)
	if (wptr != rdev->ih.wptr)
		goto restart_ih;
	if (queue_hotplug)
		queue_work(rdev->wq, &rdev->hotplug_work);
		schedule_work(&rdev->hotplug_work);
	rdev->ih.rptr = rptr;
	WREG32(IH_RB_RPTR, rdev->ih.rptr);
	spin_unlock_irqrestore(&rdev->ih.lock, flags);
+1 −1
Original line number Diff line number Diff line
@@ -682,7 +682,7 @@ int r100_irq_process(struct radeon_device *rdev)
	/* reset gui idle ack.  the status bit is broken */
	rdev->irq.gui_idle_acked = false;
	if (queue_hotplug)
		queue_work(rdev->wq, &rdev->hotplug_work);
		schedule_work(&rdev->hotplug_work);
	if (rdev->msi_enabled) {
		switch (rdev->family) {
		case CHIP_RS400:
+1 −1
Original line number Diff line number Diff line
@@ -3442,7 +3442,7 @@ int r600_irq_process(struct radeon_device *rdev)
	if (wptr != rdev->ih.wptr)
		goto restart_ih;
	if (queue_hotplug)
		queue_work(rdev->wq, &rdev->hotplug_work);
		schedule_work(&rdev->hotplug_work);
	rdev->ih.rptr = rptr;
	WREG32(IH_RB_RPTR, rdev->ih.rptr);
	spin_unlock_irqrestore(&rdev->ih.lock, flags);
+0 −1
Original line number Diff line number Diff line
@@ -1152,7 +1152,6 @@ struct radeon_device {
	struct r700_vram_scratch vram_scratch;
	int msi_enabled; /* msi enabled */
	struct r600_ih ih; /* r6/700 interrupt ring */
	struct workqueue_struct *wq;
	struct work_struct hotplug_work;
	int num_crtc; /* number of crtcs */
	struct mutex dc_hw_i2c_mutex; /* display controller hw i2c mutex */
+0 −6
Original line number Diff line number Diff line
@@ -710,11 +710,6 @@ int radeon_device_init(struct radeon_device *rdev,
	init_waitqueue_head(&rdev->irq.vblank_queue);
	init_waitqueue_head(&rdev->irq.idle_queue);

	/* setup workqueue */
	rdev->wq = create_workqueue("radeon");
	if (rdev->wq == NULL)
		return -ENOMEM;

	/* Set asic functions */
	r = radeon_asic_init(rdev);
	if (r)
@@ -813,7 +808,6 @@ void radeon_device_fini(struct radeon_device *rdev)
	/* evict vram memory */
	radeon_bo_evict_vram(rdev);
	radeon_fini(rdev);
	destroy_workqueue(rdev->wq);
	vga_switcheroo_unregister_client(rdev->pdev);
	vga_client_register(rdev->pdev, NULL, NULL, NULL);
	if (rdev->rio_mem)
Loading