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

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

Merge "soc: qcom: qmi: Add snapshot of QMI driver"

parents 1a675f8d 2897dda5
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;