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

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

Merge "soc: qcom: hab: Add HAB fixes, and workarounds, for GHS"

parents ea045f52 4f02b73d
Loading
Loading
Loading
Loading
+19 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */
#include "hab.h"
#include "hab_ghs.h"
@@ -34,7 +34,15 @@ int physical_channel_send(struct physical_channel *pchan,
	struct ghs_vdev *dev  = (struct ghs_vdev *)pchan->hyp_data;
	GIPC_Result result;
	uint8_t *msg;
	int irqs_disabled = irqs_disabled();
	int irqs_disabled;

	if (!dev) {
		pr_err("no send pchan %s has been de-alloced msg for %zd bytes\n",
			pchan->name);
		return -ENODEV;
	}

	irqs_disabled = irqs_disabled();

	hab_spin_lock(&dev->io_lock, irqs_disabled);

@@ -94,7 +102,15 @@ void physical_channel_rx_dispatch_common(unsigned long physical_channel)
		(struct physical_channel *)physical_channel;
	struct ghs_vdev *dev = (struct ghs_vdev *)pchan->hyp_data;
	GIPC_Result result;
	int irqs_disabled = irqs_disabled();
	int irqs_disabled;

	if (!dev) {
		pr_err("no recv pchan %s has been de-alloced msg for %zd bytes\n",
			pchan->name);
		return;
	}

	irqs_disabled = irqs_disabled();

	hab_spin_lock(&pchan->rxbuf_lock, irqs_disabled);
	while (1) {
+4 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */
#include "hab.h"
#include "hab_ghs.h"
@@ -164,6 +164,9 @@ int habhyp_commdev_dealloc(void *commdev)
	kfree(dev->os_data);
	kfree(dev);

	pchan->closed = 1;
	pchan->hyp_data = NULL;

	if (get_refcnt(pchan->refcount) > 1) {
		pr_warn("potential leak pchan %s vchans %d refcnt %d\n",
			pchan->name, pchan->vcnt, get_refcnt(pchan->refcount));
+3 −0
Original line number Diff line number Diff line
@@ -150,3 +150,6 @@ int hab_hypervisor_register_os(void)

	return 0;
}

void dump_hab_wq(void *hyp_data) {};
void hab_pipe_read_dump(struct physical_channel *pchan) {};
+1 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
 */
#include "hab.h"

@@ -59,7 +59,6 @@ static void hab_pchan_free(struct kref *ref)
	}
	read_unlock(&pchan->vchans_lock);

	kfree(pchan->hyp_data);
	kfree(pchan);
}

+1 −1
Original line number Diff line number Diff line
@@ -3,10 +3,10 @@
 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
 */
#include "hab.h"
#include <linux/rtc.h>
#if !defined CONFIG_GHS_VMM && defined(CONFIG_QTI_QUIN_GVM)
#include <asm/cacheflush.h>
#include <linux/list.h>
#include <linux/rtc.h>
#include "hab_pipe.h"
#include "hab_qvm.h"
#include "khab_test.h"