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

Commit e5fc4689 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "qos: Register irq notify after adding the qos request"

parents 7d8f33f5 71cee18b
Loading
Loading
Loading
Loading
+18 −8
Original line number Diff line number Diff line
@@ -512,7 +512,6 @@ void pm_qos_add_request(struct pm_qos_request *req,
#ifdef CONFIG_SMP
	case PM_QOS_REQ_AFFINE_IRQ:
		if (irq_can_set_affinity(req->irq)) {
			int ret = 0;
			struct irq_desc *desc = irq_to_desc(req->irq);
			struct cpumask *mask = desc->irq_data.affinity;

@@ -522,13 +521,6 @@ void pm_qos_add_request(struct pm_qos_request *req,
			req->irq_notify.notify = pm_qos_irq_notify;
			req->irq_notify.release = pm_qos_irq_release;

			ret = irq_set_affinity_notifier(req->irq,
					&req->irq_notify);
			if (ret) {
				WARN(1, KERN_ERR "IRQ affinity notify set failed\n");
				req->type = PM_QOS_REQ_ALL_CORES;
				cpumask_setall(&req->cpus_affine);
			}
		} else {
			req->type = PM_QOS_REQ_ALL_CORES;
			cpumask_setall(&req->cpus_affine);
@@ -550,6 +542,24 @@ void pm_qos_add_request(struct pm_qos_request *req,
	trace_pm_qos_add_request(pm_qos_class, value);
	pm_qos_update_target(pm_qos_array[pm_qos_class]->constraints,
			     req, PM_QOS_ADD_REQ, value);

#ifdef CONFIG_SMP
	if (req->type == PM_QOS_REQ_AFFINE_IRQ &&
			irq_can_set_affinity(req->irq)) {
		int ret = 0;

		ret = irq_set_affinity_notifier(req->irq,
					&req->irq_notify);
		if (ret) {
			WARN(1, "IRQ affinity notify set failed\n");
			req->type = PM_QOS_REQ_ALL_CORES;
			cpumask_setall(&req->cpus_affine);
			pm_qos_update_target(
				pm_qos_array[pm_qos_class]->constraints,
				req, PM_QOS_UPDATE_REQ, value);
		}
	}
#endif
}
EXPORT_SYMBOL_GPL(pm_qos_add_request);