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

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

Merge "msm: compr: Use irq{save/restore} version of spinlock"

parents 1458dfbb 28cab216
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -277,11 +277,12 @@ static void compr_event_handler(uint32_t opcode,
	uint32_t sample_rate = 0;
	int bytes_available, stream_id;
	uint32_t stream_index;
	unsigned long flags;

	pr_debug("%s opcode =%08x\n", __func__, opcode);
	switch (opcode) {
	case ASM_DATA_EVENT_WRITE_DONE_V2:
		spin_lock(&prtd->lock);
		spin_lock_irqsave(&prtd->lock, flags);

		if (payload[3]) {
			pr_err("WRITE FAILED w/ err 0x%x !, paddr 0x%x"
@@ -306,7 +307,7 @@ static void compr_event_handler(uint32_t opcode,
			/* Writes must be restarted from _copy() */
			pr_debug("write_done received while not started, treat as xrun");
			atomic_set(&prtd->xrun, 1);
			spin_unlock(&prtd->lock);
			spin_unlock_irqrestore(&prtd->lock, flags);
			break;
		}

@@ -331,10 +332,10 @@ static void compr_event_handler(uint32_t opcode,
		} else
			msm_compr_send_buffer(prtd);

		spin_unlock(&prtd->lock);
		spin_unlock_irqrestore(&prtd->lock, flags);
		break;
	case ASM_DATA_EVENT_RENDERED_EOS:
		spin_lock(&prtd->lock);
		spin_lock_irqsave(&prtd->lock, flags);
		pr_debug("%s: ASM_DATA_CMDRSP_EOS token 0x%x,stream id %d\n",
			  __func__, token, STREAM_ID_FROM_TOKEN(token));
		stream_id = STREAM_ID_FROM_TOKEN(token);
@@ -350,7 +351,7 @@ static void compr_event_handler(uint32_t opcode,
		    stream_index < 0) {
			pr_err("%s: Invalid stream index %d", __func__,
				stream_index);
			spin_unlock(&prtd->lock);
			spin_unlock_irqrestore(&prtd->lock, flags);
			break;
		}

@@ -365,7 +366,7 @@ static void compr_event_handler(uint32_t opcode,
		}
		if (prtd->gapless_state.gapless_transition)
			prtd->gapless_state.gapless_transition = 0;
		spin_unlock(&prtd->lock);
		spin_unlock_irqrestore(&prtd->lock, flags);
		break;
	case ASM_DATA_EVENT_SR_CM_CHANGE_NOTIFY:
	case ASM_DATA_EVENT_ENC_SR_CM_CHANGE_NOTIFY: {
@@ -385,7 +386,7 @@ static void compr_event_handler(uint32_t opcode,
			pr_debug("ASM_SESSION_CMD_RUN_V2\n");

			/* FIXME: A state is a better way, dealing with this*/
			spin_lock(&prtd->lock);
			spin_lock_irqsave(&prtd->lock, flags);
			if (!prtd->bytes_sent) {
				bytes_available = prtd->bytes_received - prtd->copied_total;
				if (bytes_available < cstream->runtime->fragment_size) {
@@ -394,7 +395,7 @@ static void compr_event_handler(uint32_t opcode,
				} else
					msm_compr_send_buffer(prtd);
			}
			spin_unlock(&prtd->lock);
			spin_unlock_irqrestore(&prtd->lock, flags);
			break;
		case ASM_STREAM_CMD_FLUSH:
			pr_debug("%s: ASM_STREAM_CMD_FLUSH:", __func__);
@@ -449,11 +450,11 @@ static void compr_event_handler(uint32_t opcode,
	case RESET_EVENTS:
		pr_err("%s: Received reset events CB, move to error state",
			__func__);
		spin_lock(&prtd->lock);
		spin_lock_irqsave(&prtd->lock, flags);
		snd_compr_fragment_elapsed(cstream);
		prtd->copied_total = prtd->bytes_received;
		atomic_set(&prtd->error, 1);
		spin_unlock(&prtd->lock);
		spin_unlock_irqrestore(&prtd->lock, flags);
		break;
	default:
		pr_debug("%s: Not Supported Event opcode[0x%x]\n",