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

Commit 2897dda5 authored by Chris Lew's avatar Chris Lew
Browse files

soc: qcom: qmi: Add snapshot of QMI driver



This snapshot is taken as of msm-4.14 'commit <101274def507> ("Merge
"ARM: dts: msm: Change glink intent size for diag on sdmmagpie"")'.

This change brings the QMI driver up to data with fixes from msm-4.14.

Change-Id: I142ca3319b46525b1cd7993cb3048ff20c384af3
Signed-off-by: default avatarChris Lew <clew@codeaurora.org>
parent 8fd658e5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -100,8 +100,8 @@ config QCOM_PM
	  low power modes.

config QCOM_QMI_HELPERS
	tristate
	depends on ARCH_QCOM && NET
	bool "QTI QMI Helpers"
	depends on QRTR
	help
	  Helper library for handling QMI encoded messages.  QMI encoded
	  messages are used in communication between the majority of QRTR
+6 −6
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ int qmi_txn_init(struct qmi_handle *qmi, struct qmi_txn *txn,
	txn->dest = c_struct;

	mutex_lock(&qmi->txn_lock);
	ret = idr_alloc_cyclic(&qmi->txns, txn, 0, INT_MAX, GFP_KERNEL);
	ret = idr_alloc_cyclic(&qmi->txns, txn, 0, U16_MAX, GFP_KERNEL);
	if (ret < 0)
		pr_err("failed to allocate transaction id\n");

@@ -345,8 +345,7 @@ int qmi_txn_wait(struct qmi_txn *txn, unsigned long timeout)
	struct qmi_handle *qmi = txn->qmi;
	int ret;

	ret = wait_for_completion_interruptible_timeout(&txn->completion,
							timeout);
	ret = wait_for_completion_timeout(&txn->completion, timeout);

	mutex_lock(&qmi->txn_lock);
	mutex_lock(&txn->lock);
@@ -354,9 +353,7 @@ int qmi_txn_wait(struct qmi_txn *txn, unsigned long timeout)
	mutex_unlock(&txn->lock);
	mutex_unlock(&qmi->txn_lock);

	if (ret < 0)
		return ret;
	else if (ret == 0)
	if (ret == 0)
		return -ETIMEDOUT;
	else
		return txn->result;
@@ -480,6 +477,9 @@ static void qmi_handle_message(struct qmi_handle *qmi,
	struct qmi_txn *txn = NULL;
	int ret;

	if (!len)
		return;

	if (len < sizeof(*hdr)) {
		pr_err("ignoring short QMI packet\n");
		return;
+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2014, 2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2017, Linaro Ltd.
 */
#ifndef __QMI_HELPERS_H__
@@ -166,7 +166,7 @@ struct qmi_ops {
struct qmi_txn {
	struct qmi_handle *qmi;

	int id;
	u16 id;

	struct mutex lock;
	struct completion completion;