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

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

Merge "msm: camera: core: Avoid concurrency between stop and pfdump" into camera-kernel.lnx.1.0

parents 0d14a4d0 0079fd9f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -268,6 +268,7 @@ int cam_context_dump_pf_info(struct cam_context *ctx, unsigned long iova,
		return -EINVAL;
	}

	mutex_lock(&ctx->ctx_mutex);
	if ((ctx->state > CAM_CTX_AVAILABLE) &&
		(ctx->state < CAM_CTX_STATE_MAX)) {
		if (ctx->state_machine[ctx->state].pagefault_ops) {
@@ -278,6 +279,7 @@ int cam_context_dump_pf_info(struct cam_context *ctx, unsigned long iova,
				ctx->dev_hdl, ctx->state);
		}
	}
	mutex_unlock(&ctx->ctx_mutex);

	return rc;
}
+8 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/debugfs.h>
@@ -296,6 +296,13 @@ int32_t cam_context_config_dev_to_hw(
		return rc;
	}

	if ((len < sizeof(struct cam_packet)) ||
		(cmd->offset >= (len - sizeof(struct cam_packet)))) {
		CAM_ERR(CAM_CTXT, "Not enough buf, len : %zu offset = %llu",
			len, cmd->offset);
		return -EINVAL;

	}
	packet = (struct cam_packet *) ((uint8_t *)packet_addr +
		(uint32_t)cmd->offset);