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

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

Merge "msm: mhi_dev: Update sequence when ipa_mhi_destroy is issued"

parents 6ee61fd3 a61854fa
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -1686,9 +1686,6 @@ static int mhi_dev_abort(struct mhi_dev *mhi)
	flush_workqueue(mhi->ring_init_wq);
	flush_workqueue(mhi->pending_ring_wq);

	/* Initiate MHI IPA reset */
	ipa_mhi_destroy();

	/* Clean up initialized channels */
	rc = mhi_deinit(mhi);
	if (rc) {
@@ -2282,6 +2279,7 @@ int mhi_dev_open_channel(uint32_t chan_id,
	ch->ereqs = NULL;
free_client:
	kfree(*handle_client);
	*handle_client = NULL;
exit:
	mutex_unlock(&ch->ch_lock);
	return rc;
@@ -2293,6 +2291,11 @@ int mhi_dev_channel_isempty(struct mhi_dev_client *handle)
	struct mhi_dev_channel *ch;
	int rc;

	if (!handle) {
		mhi_log(MHI_MSG_ERROR, "Invalid channel access\n");
		return -EINVAL;
	}

	ch = handle->channel;
	if (!ch)
		return -EINVAL;
@@ -2308,6 +2311,11 @@ int mhi_dev_close_channel(struct mhi_dev_client *handle)
	struct mhi_dev_channel *ch;
	int rc = 0;

	if (!handle) {
		mhi_log(MHI_MSG_ERROR, "Invalid channel access\n");
		return -EINVAL;
	}

	ch = handle->channel;

	mutex_lock(&ch->ch_lock);
+2 −0
Original line number Diff line number Diff line
@@ -968,6 +968,8 @@ int mhi_dev_sm_exit(struct mhi_dev *mhi_dev)
	mhi_sm_debugfs_destroy();
	flush_workqueue(mhi_sm_ctx->mhi_sm_wq);
	destroy_workqueue(mhi_sm_ctx->mhi_sm_wq);
	/* Initiate MHI IPA reset */
	ipa_mhi_destroy();
	ipa_dma_destroy();
	mutex_destroy(&mhi_sm_ctx->mhi_state_lock);
	devm_kfree(mhi_dev->dev, mhi_sm_ctx);
+22 −4
Original line number Diff line number Diff line
@@ -914,9 +914,14 @@ static int mhi_uci_client_open(struct inode *mhi_inode,
				"Opening channels client %d\n",
				iminor(mhi_inode));
			rc = open_client_mhi_channels(uci_handle);
			if (rc) {
			if (rc < 0) {
				uci_log(UCI_DBG_INFO,
					"Failed to open channels ret %d\n", rc);
				if (atomic_sub_return(1, &uci_handle->ref_count)
									== 0) {
					uci_log(UCI_DBG_INFO,
						"Closing failed channel\n");
				}
				return rc;
			}
		}
@@ -1148,7 +1153,16 @@ static ssize_t mhi_uci_client_read(struct file *file, char __user *ubuf,
	ssize_t bytes_copied = 0;
	u32 addr_offset = 0;

	if (!file || !ubuf || !file->private_data) {
		uci_log(UCI_DBG_DBG, "Invalid access to read\n");
		return -EINVAL;
	}

	uci_handle = file->private_data;
	if (!uci_handle->read || !uci_handle->in_handle) {
		uci_log(UCI_DBG_DBG, "Invalid inhandle or read\n");
		return -EINVAL;
	}
	mutex = &uci_handle->in_chan_lock;
	mutex_lock(mutex);

@@ -1216,12 +1230,16 @@ static ssize_t mhi_uci_client_write(struct file *file,
	unsigned long memcpy_result;
	int rc;

	if (file == NULL || buf == NULL ||
		!count || file->private_data == NULL)
	if (!file || !buf || !count || !file->private_data) {
		uci_log(UCI_DBG_DBG, "Invalid access to write\n");
		return -EINVAL;
	}

	uci_handle = file->private_data;

	if (!uci_handle->send || !uci_handle->out_handle) {
		uci_log(UCI_DBG_DBG, "Invalid handle or send\n");
		return -EINVAL;
	}
	if (atomic_read(&uci_ctxt.mhi_disabled)) {
		uci_log(UCI_DBG_ERROR,
			"Client %d attempted to write while MHI is disabled\n",