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

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

Merge "msm: kgsl: Remove a race condition in the event processing code"

parents cf0b9758 3d920d87
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -3055,8 +3055,6 @@ static int adreno_readtimestamp(struct kgsl_device *device,
		break;
	}

	rmb();

	return status;
}

+6 −3
Original line number Diff line number Diff line
@@ -70,9 +70,10 @@ static void retire_events(struct kgsl_device *device,

	_kgsl_context_get(context);

	spin_lock(&group->lock);

	kgsl_readtimestamp(device, context, KGSL_TIMESTAMP_RETIRED, &timestamp);

	spin_lock(&group->lock);
	/*
	 * If no timestamps have been retired since the last time we were here
	 * then we can avoid going through this loop
@@ -207,6 +208,8 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group,

	trace_kgsl_register_event(KGSL_CONTEXT_ID(context), timestamp, func);

	spin_lock(&group->lock);

	/*
	 * Check to see if the requested timestamp has already retired.  If so,
	 * schedule the callback right away
@@ -216,13 +219,13 @@ int kgsl_add_event(struct kgsl_device *device, struct kgsl_event_group *group,
	if (timestamp_cmp(retired, timestamp) >= 0) {
		event->result = KGSL_EVENT_RETIRED;
		queue_work(device->events_wq, &event->work);

		spin_unlock(&group->lock);
		return 0;
	}

	/* Add the event to the group list */
	spin_lock(&group->lock);
	list_add_tail(&event->node, &group->events);

	spin_unlock(&group->lock);

	return 0;
+5 −0
Original line number Diff line number Diff line
@@ -861,6 +861,8 @@ kgsl_sharedmem_readl(const struct kgsl_memdesc *memdesc,
	WARN_ON(offsetbytes + sizeof(uint32_t) > memdesc->size);
	if (offsetbytes + sizeof(uint32_t) > memdesc->size)
		return -ERANGE;

	rmb();
	src = (uint32_t *)(memdesc->hostptr + offsetbytes);
	*dst = *src;
	return 0;
@@ -887,6 +889,9 @@ kgsl_sharedmem_writel(struct kgsl_device *device,
		src, sizeof(uint32_t));
	dst = (uint32_t *)(memdesc->hostptr + offsetbytes);
	*dst = src;

	wmb();

	return 0;
}
EXPORT_SYMBOL(kgsl_sharedmem_writel);