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

Commit f4ae227b authored by Ravikishore Pampana's avatar Ravikishore Pampana Committed by Gerrit - the friendly Code Review server
Browse files

msm: camera: core: Avoid concurrency between stop and pfdump



Camera context layer checks the state of the driver context and
allow the events to proceed. Two events should not execute
concurrently on context. Currently Dumping platform data
executing concurrently with flush or stop. This changes avoid
the concurrent execute of dump pf data and other events.

Change-Id: Iee674eb877c54cec3566abafeaf91c4e9a0cadcd
Signed-off-by: default avatarRavikishore Pampana <rpampana@codeaurora.org>
parent 19724c31
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -244,6 +244,7 @@ int cam_context_dump_pf_info(struct cam_context *ctx, unsigned long iova,
		return -EINVAL;
	}

	mutex_lock(&ctx->ctx_mutex);
	if (ctx->state_machine[ctx->state].pagefault_ops) {
		rc = ctx->state_machine[ctx->state].pagefault_ops(ctx, iova,
			buf_info);
@@ -251,6 +252,7 @@ int cam_context_dump_pf_info(struct cam_context *ctx, unsigned long iova,
		CAM_WARN(CAM_CORE, "No dump ctx in dev %d, state %d",
			ctx->dev_hdl, ctx->state);
	}
	mutex_unlock(&ctx->ctx_mutex);

	return rc;
}