Unverified Commit 36ed3648 authored by Marco Crivellari's avatar Marco Crivellari Committed by Rodrigo Vivi
Browse files

drm/i915: replace use of system_unbound_wq with system_dfl_wq



Currently if a user enqueue a work item using schedule_delayed_work() the
used wq is "system_wq" (per-cpu wq) while queue_delayed_work() use
WORK_CPU_UNBOUND (used when a cpu is not specified). The same applies to
schedule_work() that is using system_wq and queue_work(), that makes use
again of WORK_CPU_UNBOUND.

This lack of consistency cannot be addressed without refactoring the API.

system_unbound_wq should be the default workqueue so as not to enforce
locality constraints for random work whenever it's not required.

This patch continues the effort to refactor worqueue APIs, which has
begun with the change introducing new workqueues:

commit 128ea9f6 ("workqueue: Add system_percpu_wq and system_dfl_wq")

The old system_unbound_wq will be kept for a few release cycles.

Suggested-by: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarMarco Crivellari <marco.crivellari@suse.com>
Reviewed-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Link: https://patch.msgid.link/20251104100032.61525-2-marco.crivellari@suse.com


Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 93f3a267
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -645,7 +645,7 @@ queue_async_put_domains_work(struct i915_power_domains *power_domains,
						     power.domains);
	drm_WARN_ON(display->drm, power_domains->async_put_wakeref);
	power_domains->async_put_wakeref = wakeref;
	drm_WARN_ON(display->drm, !queue_delayed_work(system_unbound_wq,
	drm_WARN_ON(display->drm, !queue_delayed_work(system_dfl_wq,
						      &power_domains->async_put_work,
						      msecs_to_jiffies(delay_ms)));
}
+2 −2
Original line number Diff line number Diff line
@@ -1844,7 +1844,7 @@ bool intel_tc_port_link_reset(struct intel_digital_port *dig_port)
	if (!intel_tc_port_link_needs_reset(dig_port))
		return false;

	queue_delayed_work(system_unbound_wq,
	queue_delayed_work(system_dfl_wq,
			   &to_tc_port(dig_port)->link_reset_work,
			   msecs_to_jiffies(2000));

@@ -1925,7 +1925,7 @@ void intel_tc_port_unlock(struct intel_digital_port *dig_port)
	struct intel_tc_port *tc = to_tc_port(dig_port);

	if (!tc->link_refcount && tc->mode != TC_PORT_DISCONNECTED)
		queue_delayed_work(system_unbound_wq, &tc->disconnect_phy_work,
		queue_delayed_work(system_dfl_wq, &tc->disconnect_phy_work,
				   msecs_to_jiffies(1000));

	mutex_unlock(&tc->lock);
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ static void __memcpy_cb(struct dma_fence *fence, struct dma_fence_cb *cb)

	if (unlikely(fence->error || I915_SELFTEST_ONLY(fail_gpu_migration))) {
		INIT_WORK(&copy_work->work, __memcpy_work);
		queue_work(system_unbound_wq, &copy_work->work);
		queue_work(system_dfl_wq, &copy_work->work);
	} else {
		init_irq_work(&copy_work->irq_work, __memcpy_irq_work);
		irq_work_queue(&copy_work->irq_work);
+2 −2
Original line number Diff line number Diff line
@@ -624,7 +624,7 @@ int intel_guc_crash_process_msg(struct intel_guc *guc, u32 action)
	else
		guc_err(guc, "Unknown crash notification: 0x%04X\n", action);

	queue_work(system_unbound_wq, &guc->dead_guc_worker);
	queue_work(system_dfl_wq, &guc->dead_guc_worker);

	return 0;
}
@@ -646,7 +646,7 @@ int intel_guc_to_host_process_recv_msg(struct intel_guc *guc,
		guc_err(guc, "Received early exception notification!\n");

	if (msg & (INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED | INTEL_GUC_RECV_MSG_EXCEPTION))
		queue_work(system_unbound_wq, &guc->dead_guc_worker);
		queue_work(system_dfl_wq, &guc->dead_guc_worker);

	return 0;
}
+2 −2
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ static void ct_dead_ct_worker_func(struct work_struct *w);
	do { \
		if (!(ct)->dead_ct_reported) { \
			(ct)->dead_ct_reason |= 1 << CT_DEAD_##reason; \
			queue_work(system_unbound_wq, &(ct)->dead_ct_worker); \
			queue_work(system_dfl_wq, &(ct)->dead_ct_worker); \
		} \
	} while (0)
#else
@@ -1238,7 +1238,7 @@ static int ct_handle_event(struct intel_guc_ct *ct, struct ct_incoming_msg *requ
	list_add_tail(&request->link, &ct->requests.incoming);
	spin_unlock_irqrestore(&ct->requests.lock, flags);

	queue_work(system_unbound_wq, &ct->requests.worker);
	queue_work(system_dfl_wq, &ct->requests.worker);
	return 0;
}

Loading