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

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

Merge "slim_ngd: Increase Rx throughput"

parents 9749bc7b e2915560
Loading
Loading
Loading
Loading
+29 −15
Original line number Diff line number Diff line
@@ -1057,6 +1057,7 @@ static int ngd_slim_power_up(struct msm_slim_ctrl *dev, bool mdm_restart)
	int timeout, ret = 0;
	enum msm_ctrl_state cur_state = dev->state;
	u32 laddr;
	u32 rx_msgq;
	u32 ngd_int = (NGD_INT_TX_NACKED_2 |
			NGD_INT_MSG_BUF_CONTE | NGD_INT_MSG_TX_INVAL |
			NGD_INT_IE_VE_CHG | NGD_INT_DEV_ERR |
@@ -1129,6 +1130,15 @@ static int ngd_slim_power_up(struct msm_slim_ctrl *dev, bool mdm_restart)
	 */
	writel_relaxed(ngd_int, dev->base + NGD_INT_EN +
				NGD_BASE(dev->ctrl.nr, dev->ver));

	rx_msgq = readl_relaxed(ngd + NGD_RX_MSGQ_CFG);
	/* Program with minimum value so that signal get
	 * triggered immediately after receiving the message */
	writel_relaxed(rx_msgq|SLIM_RX_MSGQ_TIMEOUT_VAL,
					ngd + NGD_RX_MSGQ_CFG);
	/* make sure register got updated */
	mb();

	/*
	 * Enable NGD. Configure NGD in register acc. mode until master
	 * announcement is received
@@ -1211,23 +1221,27 @@ static int ngd_slim_rx_msgq_thread(void *data)
			ngd_slim_rx(dev, (u8 *)buffer);
			continue;
		}
		do {
			ret = msm_slim_rx_msgq_get(dev, buffer, index);
			if (ret) {
			SLIM_ERR(dev, "rx_msgq_get() failed 0x%x\n", ret);
			continue;
				SLIM_ERR(dev, "rx_msgq_get() failed 0x%x\n",
									ret);
				break;
			}

		/* Wait for complete message */
			/* Traverse first byte of message for message length */
			if (index++ == 0) {
				msg_len = *buffer & 0x1F;
				mt = (buffer[0] >> 5) & 0x7;
				mc = (buffer[0] >> 8) & 0xff;
				dev_dbg(dev->dev, "MC: %x, MT: %x\n", mc, mt);
			}
		if ((index * 4) >= msg_len) {
			msg_len = (msg_len < 4) ? 0 : (msg_len - 4);
		} while (msg_len);
		if (!msg_len) {
			index = 0;
			ngd_slim_rx(dev, (u8 *)buffer);
		} else
		}
		continue;
	}
	return 0;
+3 −4
Original line number Diff line number Diff line
@@ -609,7 +609,6 @@ static void msm_slim_rx_msgq_cb(struct sps_event_notify *notify)
static int msm_slim_post_rx_msgq(struct msm_slim_ctrl *dev, int ix)
{
	int ret;
	u32 flags = SPS_IOVEC_FLAG_INT;
	struct msm_slim_endp *endpoint = &dev->rx_msgq;
	struct sps_mem_buffer *mem = &endpoint->buf;
	struct sps_pipe *pipe = endpoint->sps;
@@ -620,7 +619,7 @@ static int msm_slim_post_rx_msgq(struct msm_slim_ctrl *dev, int ix)

	pr_debug("index:%d, virt:0x%p\n", ix, virt_addr);

	ret = sps_transfer_one(pipe, phys_addr, 4, virt_addr, flags);
	ret = sps_transfer_one(pipe, phys_addr, 4, virt_addr, 0);
	if (ret)
		dev_err(dev->dev, "transfer_one() failed 0x%x, %d\n", ret, ix);

@@ -679,7 +678,7 @@ int msm_slim_connect_endp(struct msm_slim_ctrl *dev,

	if (notify) {
		sps_descr_event.mode = SPS_TRIGGER_CALLBACK;
		sps_descr_event.options = SPS_O_DESC_DONE;
		sps_descr_event.options = SPS_O_EOT;
		sps_descr_event.user = (void *)dev;
		sps_descr_event.xfer_done = notify;

@@ -767,7 +766,7 @@ static int msm_slim_init_rx_msgq(struct msm_slim_ctrl *dev, u32 pipe_reg)
	config->source = dev->bam.hdl;
	config->destination = SPS_DEV_HANDLE_MEM;
	config->src_pipe_index = pipe_offset;
	config->options = SPS_O_DESC_DONE | SPS_O_ERROR |
	config->options = SPS_O_EOT | SPS_O_ERROR |
				SPS_O_ACK_TRANSFERS | SPS_O_AUTO_ENABLE;

	/* Allocate memory for the FIFO descriptors */
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@

#define MSM_SLIM_AUTOSUSPEND		MSEC_PER_SEC

#define SLIM_RX_MSGQ_TIMEOUT_VAL	0x10000
/*
 * Messages that can be received simultaneously:
 * Client reads, LPASS master responses, announcement messages