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

Commit 790d645f 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: isp: Avoid race between tasklet and deinit buf_mgr"

parents db6a5ac3 96417b5f
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@
#define CDBG(fmt, args...) pr_debug(fmt, ##args)

#define BUF_DEBUG_FULL 0
#define MAX_LIST_COUNT 100

struct msm_isp_bufq *msm_isp_get_bufq(
	struct msm_isp_buf_mgr *buf_mgr,
@@ -402,6 +403,7 @@ static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
{
	int rc = -1;
	unsigned long flags;
	unsigned int list_count = 0;
	struct msm_isp_buffer *temp_buf_info;
	struct msm_isp_bufq *bufq = NULL;
	struct vb2_buffer *vb2_buf = NULL;
@@ -422,6 +424,7 @@ static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
	*buf_cnt = 0;
	spin_lock_irqsave(&bufq->bufq_lock, flags);
	if (bufq->buf_type == ISP_SHARE_BUF) {
		list_count = 0;
		list_for_each_entry(temp_buf_info,
			&bufq->share_head, share_list) {
			if (!temp_buf_info->buf_used[id]) {
@@ -441,6 +444,19 @@ static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
				spin_unlock_irqrestore(
					&bufq->bufq_lock, flags);
				return rc;
			} else if (temp_buf_info->buf_used[id] &&
				temp_buf_info->buf_reuse_flag) {
				spin_unlock_irqrestore(
					&bufq->bufq_lock, flags);
				return rc;
			}
			list_count++;
			if (list_count > MAX_LIST_COUNT) {
				pr_err_ratelimited("%s: %d share_list corruption, list corrupt! count = %d\n",
					__func__, __LINE__,  list_count);
				spin_unlock_irqrestore(
					&bufq->bufq_lock, flags);
				return -EINVAL;
			}
		}
	}
@@ -481,7 +497,6 @@ static int msm_isp_get_buf(struct msm_isp_buf_mgr *buf_mgr, uint32_t id,
			bufq->session_id, bufq->stream_id);
		if (vb2_buf) {
			if (vb2_buf->v4l2_buf.index < bufq->num_bufs) {

				list_for_each_entry(buf_pending,
						&buf_mgr->buffer_q, list) {
					if (!buf_pending)
+1 −0
Original line number Diff line number Diff line
@@ -485,6 +485,7 @@ static int vfe_probe(struct platform_device *pdev)
		&vfe_dev->axi_data;
	vfe_dev->dual_vfe_res->stats_data[vfe_dev->pdev->id] =
		&vfe_dev->stats_data;
	vfe_dev->dual_vfe_res->vfe_dev[vfe_dev->pdev->id] = vfe_dev;

	rc = vfe_dev->hw_info->vfe_ops.core_ops.get_platform_data(vfe_dev);
	if (rc < 0) {
+2 −2
Original line number Diff line number Diff line
@@ -483,8 +483,7 @@ struct msm_vfe_tasklet_queue_cmd {
enum msm_vfe_overflow_state {
	NO_OVERFLOW,
	OVERFLOW_DETECTED,
	HALT_REQUESTED,
	RESTART_REQUESTED,
	HALT_ENFORCED,
};

struct msm_vfe_error_info {
@@ -576,6 +575,7 @@ struct msm_vfe_hw_init_parms {
};

struct dual_vfe_resource {
	struct vfe_device *vfe_dev[MAX_VFE];
	void __iomem *vfe_base[MAX_VFE];
	uint32_t reg_update_mask[MAX_VFE];
	struct msm_vfe_stats_shared_data *stats_data[MAX_VFE];
+3 −0
Original line number Diff line number Diff line
@@ -1680,6 +1680,9 @@ static int msm_vfe40_axi_halt(struct vfe_device *vfe_dev,
		msm_camera_io_w_mb(0x1, vfe_dev->vfe_base + 0x2C0);
		rc = wait_for_completion_interruptible_timeout(
			&vfe_dev->halt_complete, msecs_to_jiffies(500));
		if (rc <= 0)
			pr_err("%s:VFE%d halt timeout rc=%d\n", __func__,
				vfe_dev->pdev->id, rc);
	} else {
		/* Halt AXI Bus Bridge */
		msm_camera_io_w_mb(0x1, vfe_dev->vfe_base + 0x2C0);
+8 −0
Original line number Diff line number Diff line
@@ -1399,12 +1399,20 @@ static int msm_vfe44_axi_halt(struct vfe_device *vfe_dev,
	/*push clear cmd*/
	msm_camera_io_w(0x1, vfe_dev->vfe_base + 0x24);

	if (atomic_read(&vfe_dev->error_info.overflow_state)
		== OVERFLOW_DETECTED)
		pr_err_ratelimited("%s: VFE%d halt for recovery, blocking %d\n",
			__func__, vfe_dev->pdev->id, blocking);

	if (blocking) {
		init_completion(&vfe_dev->halt_complete);
		/* Halt AXI Bus Bridge */
		msm_camera_io_w_mb(0x1, vfe_dev->vfe_base + 0x2C0);
		rc = wait_for_completion_timeout(
			&vfe_dev->halt_complete, msecs_to_jiffies(500));
		if (rc <= 0)
			pr_err("%s:VFE%d halt timeout rc=%d\n", __func__,
				vfe_dev->pdev->id, rc);
	} else {
		/* Halt AXI Bus Bridge */
		msm_camera_io_w_mb(0x1, vfe_dev->vfe_base + 0x2C0);
Loading