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

Commit ab195f74 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mhi_dev: Update num_reqs for ADB channel"

parents 9009fb4d 36455696
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -2888,6 +2888,14 @@ int mhi_dev_read_channel(struct mhi_req *mreq)
	mutex_lock(&ch->ch_lock);

	do {
		if (ch->state == MHI_DEV_CH_STOPPED) {
			mhi_log(MHI_MSG_VERBOSE,
				"channel (%d) already stopped\n",
				mreq->chan);
			bytes_read = -1;
			goto exit;
		}

		el = &ring->ring_cache[ring->rd_offset];
		mhi_log(MHI_MSG_VERBOSE, "evtptr : 0x%llx\n",
						el->tre.data_buf_ptr);
@@ -2909,13 +2917,6 @@ int mhi_dev_read_channel(struct mhi_req *mreq)
				goto exit;
			}

			if (ch->state == MHI_DEV_CH_STOPPED) {
				mhi_log(MHI_MSG_VERBOSE,
					"channel (%d) already stopped\n",
					mreq->chan);
				bytes_read = -1;
				goto exit;
			}

			ch->tre_loc = el->tre.data_buf_ptr;
			ch->tre_size = el->tre.len;
+35 −6
Original line number Diff line number Diff line
@@ -279,9 +279,9 @@ static const struct chan_attr uci_chan_attr_table[] = {
		mhi_uci_generic_client_cb,
		NULL,
		NULL,
		NULL,
		false,
		true
		true,
		50
	},
	{
		MHI_CLIENT_ADB_IN,
@@ -291,9 +291,9 @@ static const struct chan_attr uci_chan_attr_table[] = {
		mhi_uci_generic_client_cb,
		"android_adb",
		NULL,
		NULL,
		false,
		false
		true,
		50
	},
};

@@ -935,8 +935,11 @@ static int open_client_mhi_channels(struct uci_client *uci_client)
{
	int rc = 0;

	if (!mhi_uci_are_channels_connected(uci_client))
	if (!mhi_uci_are_channels_connected(uci_client)) {
		uci_log(UCI_DBG_ERROR, "%s:Channels are not connected\n",
			__func__);
		return -ENODEV;
	}

	uci_log(UCI_DBG_DBG,
			"Starting channels %d %d.\n",
@@ -1067,12 +1070,20 @@ static int mhi_uci_client_release(struct inode *mhi_inode,
		struct file *file_handle)
{
	struct uci_client *uci_handle = file_handle->private_data;
	int count = 0;
	const struct chan_attr *in_chan_attr;
	int count = 0, i;
	struct mhi_req *ureq;

	if (!uci_handle)
		return -EINVAL;

	in_chan_attr = uci_handle->in_chan_attr;
	if (!in_chan_attr) {
		uci_log(UCI_DBG_ERROR, "Null channel attributes for chan %d\n",
				uci_handle->in_chan);
		return -EINVAL;
	}

	if (atomic_sub_return(1, &uci_handle->ref_count)) {
		uci_log(UCI_DBG_DBG, "Client close chan %d, ref count 0x%x\n",
			iminor(mhi_inode),
@@ -1131,6 +1142,12 @@ static int mhi_uci_client_release(struct inode *mhi_inode,
				iminor(mhi_inode), count);
	}

	for (i = 0; i < (in_chan_attr->nr_trbs); i++) {
		kfree(uci_handle->in_buf_list[i].addr);
		uci_handle->in_buf_list[i].addr = NULL;
		uci_handle->in_buf_list[i].buf_size = 0;
	}

	atomic_set(&uci_handle->read_data_ready, 0);
	atomic_set(&uci_handle->write_data_ready, 0);
	file_handle->private_data = NULL;
@@ -1247,6 +1264,12 @@ static int __mhi_uci_client_read(struct uci_client *uci_handle,
	int ret_val = 0;

	do {
		if (!mhi_uci_are_channels_connected(uci_handle)) {
			uci_log(UCI_DBG_ERROR,
				"%s:Channels are not connected\n", __func__);
			return -ENODEV;
		}

		if (!uci_handle->pkt_loc &&
			!atomic_read(&uci_ctxt.mhi_disabled)) {
			ret_val = uci_handle->read(uci_handle, bytes_avail);
@@ -1393,6 +1416,12 @@ static ssize_t mhi_uci_client_write(struct file *file,
		return -EIO;
	}

	if (!mhi_uci_are_channels_connected(uci_handle)) {
		uci_log(UCI_DBG_ERROR, "%s:Channels are not connected\n",
			__func__);
		return -ENODEV;
	}

	if (count > TRB_MAX_DATA_SIZE) {
		uci_log(UCI_DBG_ERROR,
			"Too big write size: %lu, max supported size is %d\n",