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

Commit c5a5fe5e authored by Camera Software Integration's avatar Camera Software Integration Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: ope: Protect ope hw reset with mutex" into camera-kernel.lnx.3.1

parents 521e6aa6 aa8b8721
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 */

#include <linux/of.h>
@@ -44,7 +44,8 @@ static int cam_ope_top_reset(struct ope_hw *ope_hw_info,
	top_reg = ope_hw_info->top_reg;
	top_reg_val = ope_hw_info->top_reg_val;

	init_completion(&ope_top_info.reset_complete);
	mutex_lock(&ope_top_info.ope_hw_mutex);
	reinit_completion(&ope_top_info.reset_complete);

	/* enable interrupt mask */
	cam_io_w_mb(top_reg_val->irq_mask,
@@ -70,6 +71,7 @@ static int cam_ope_top_reset(struct ope_hw *ope_hw_info,
	cam_io_w_mb(top_reg_val->irq_mask,
		ope_hw_info->top_reg->base + top_reg->irq_mask);

	mutex_unlock(&ope_top_info.ope_hw_mutex);
	return rc;
}

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

#ifndef OPE_TOP_H
@@ -32,10 +32,12 @@ struct ope_top_ctx {
 * @ope_hw_info:    OPE hardware info
 * @top_ctx:        OPE top context
 * @reset_complete: Reset complete flag
 * @ope_mutex:      OPE hardware mutex
 */
struct ope_top {
	struct ope_hw *ope_hw_info;
	struct ope_top_ctx top_ctx[OPE_CTX_MAX];
	struct completion reset_complete;
	struct mutex      ope_hw_mutex;
};
#endif /* OPE_TOP_H */