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

Commit 56a0f9b5 authored by Linux Build Service Account's avatar Linux Build Service Account
Browse files

Merge 0e53eed1 on remote branch

Change-Id: Iab72024cf4deca8861c57f8b12e8dbadab05e688
parents 2a003355 0e53eed1
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -297,6 +297,7 @@ struct fastrpc_mmap {
	int uncached;
	int secure;
	uintptr_t attr;
	bool is_filemap; /*flag to indicate map used in process init*/
};

struct fastrpc_perf {
@@ -556,9 +557,10 @@ static int fastrpc_mmap_remove(struct fastrpc_file *fl, uintptr_t va,

	spin_lock(&me->hlock);
	hlist_for_each_entry_safe(map, n, &me->maps, hn) {
		if (map->raddr == va &&
		if (map->refs == 1 && map->raddr == va &&
			map->raddr + map->len == va + len &&
			map->refs == 1) {
			/*Remove map if not used in process initialization*/
			!map->is_filemap) {
			match = map;
			hlist_del_init(&map->hn);
			break;
@@ -571,9 +573,10 @@ static int fastrpc_mmap_remove(struct fastrpc_file *fl, uintptr_t va,
	}
	spin_lock(&fl->hlock);
	hlist_for_each_entry_safe(map, n, &fl->maps, hn) {
		if (map->raddr == va &&
		if (map->refs == 1 && map->raddr == va &&
			map->raddr + map->len == va + len &&
			map->refs == 1) {
			/*Remove map if not used in process initialization*/
			!map->is_filemap) {
			match = map;
			hlist_del_init(&map->hn);
			break;
@@ -711,6 +714,7 @@ static int fastrpc_mmap_create(struct fastrpc_file *fl, int fd, unsigned attr,
	map->fl = fl;
	map->fd = fd;
	map->attr = attr;
	map->is_filemap = false;
	if (mflags == ADSP_MMAP_HEAP_ADDR ||
				mflags == ADSP_MMAP_REMOTE_HEAP_ADDR) {
		DEFINE_DMA_ATTRS(rh_attrs);
@@ -1900,6 +1904,8 @@ static int fastrpc_init_process(struct fastrpc_file *fl,
		if (init->filelen) {
			VERIFY(err, !fastrpc_mmap_create(fl, init->filefd, 0,
				init->file, init->filelen, mflags, &file));
			if (file)
				file->is_filemap = true;
			if (err)
				goto bail;
		}
+13 −2
Original line number Diff line number Diff line
/* Copyright (c) 2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017,2021, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -189,6 +189,7 @@ static int md_update_smem_table(const struct md_region *entry)
int msm_minidump_add_region(const struct md_region *entry)
{
	u32 entries;
	u32 toc_init;
	struct md_region *mdr;
	int ret = 0;

@@ -214,6 +215,16 @@ int msm_minidump_add_region(const struct md_region *entry)
		return -ENOMEM;
	}

	toc_init = 0;
	if (minidump_enabled) {
		toc_init = 1;
		if (region_idx >= MAX_NUM_ENTRIES) {
			spin_unlock(&mdt_lock);
			pr_err("Maximum regions in minidump table reached.\n");
			return -ENOMEM;
		}
	}

	mdr = &minidump_table.entry[entries];
	strlcpy(mdr->name, entry->name, sizeof(mdr->name));
	mdr->virt_addr = entry->virt_addr;
@@ -223,7 +234,7 @@ int msm_minidump_add_region(const struct md_region *entry)

	minidump_table.num_regions = entries + 1;

	if (minidump_enabled)
	if (toc_init)
		ret = md_update_smem_table(entry);
	else
		pendings++;
+1 −0
Original line number Diff line number Diff line
@@ -533,6 +533,7 @@ gen_headers_out_arm = [
    "linux/shm.h",
    "linux/signal.h",
    "linux/signalfd.h",
    "linux/slatecom_interface.h",
    "linux/smcinvoke.h",
    "linux/smiapp.h",
    "linux/snmp.h",
+1 −0
Original line number Diff line number Diff line
@@ -531,6 +531,7 @@ gen_headers_out_arm64 = [
    "linux/shm.h",
    "linux/signal.h",
    "linux/signalfd.h",
    "linux/slatecom_interface.h",
    "linux/smcinvoke.h",
    "linux/smiapp.h",
    "linux/snmp.h",
+93 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
/*
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 */
#ifndef LINUX_SLATECOM_INTERFACE_H
#define LINUX_SLATECOM_INTERFACE_H

#include <linux/types.h>

#define SLATECOM_REG_READ  0
#define SLATECOM_AHB_READ  1
#define SLATECOM_AHB_WRITE 2
#define SLATECOM_SET_SPI_FREE  3
#define SLATECOM_SET_SPI_BUSY  4
#define SLATECOM_REG_WRITE  5
#define SLATECOM_SOFT_RESET  6
#define SLATECOM_MODEM_DOWN2_SLATE  7
#define SLATECOM_TWM_EXIT  8
#define SLATECOM_SLATE_APP_RUNNING 9
#define SLATECOM_ADSP_DOWN2_SLATE  10
#define SLATECOM_SLATE_WEAR_LOAD 11
#define SLATECOM_SLATE_WEAR_UNLOAD 12
#define EXCHANGE_CODE  'V'

struct slate_ui_data {
	__u64  __user write;
	__u64  __user result;
	__u32  slate_address;
	__u32  cmd;
	__u32  num_of_words;
	__u8 __user *buffer;
};

enum slate_event_type {
	SLATE_BEFORE_POWER_DOWN = 1,
	SLATE_AFTER_POWER_DOWN,
	SLATE_BEFORE_POWER_UP,
	SLATE_AFTER_POWER_UP,
	MODEM_BEFORE_POWER_DOWN,
	MODEM_AFTER_POWER_UP,
	ADSP_BEFORE_POWER_DOWN,
	ADSP_AFTER_POWER_UP,
	TWM_SLATE_AFTER_POWER_UP,
	SLATE_DSP_ERROR,
	SLATE_DSP_READY,
	SLATE_BT_ERROR,
	SLATE_BT_READY,
};

#define SLATE_AFTER_POWER_UP	SLATE_AFTER_POWER_UP

#define REG_READ \
	_IOWR(EXCHANGE_CODE, SLATECOM_REG_READ, \
	struct slate_ui_data)
#define AHB_READ \
	_IOWR(EXCHANGE_CODE, SLATECOM_AHB_READ, \
	struct slate_ui_data)
#define AHB_WRITE \
	_IOW(EXCHANGE_CODE, SLATECOM_AHB_WRITE, \
	struct slate_ui_data)
#define SET_SPI_FREE \
	_IOR(EXCHANGE_CODE, SLATECOM_SET_SPI_FREE, \
	struct slate_ui_data)
#define SET_SPI_BUSY \
	_IOR(EXCHANGE_CODE, SLATECOM_SET_SPI_BUSY, \
	struct slate_ui_data)
#define REG_WRITE \
	_IOWR(EXCHANGE_CODE, SLATECOM_REG_WRITE, \
	struct slate_ui_data)
#define SLATE_SOFT_RESET \
	_IOWR(EXCHANGE_CODE, SLATECOM_SOFT_RESET, \
	struct slate_ui_data)
#define SLATE_TWM_EXIT \
	_IOWR(EXCHANGE_CODE, SLATECOM_TWM_EXIT, \
	struct slate_ui_data)
#define SLATE_APP_RUNNING \
	_IOWR(EXCHANGE_CODE, SLATECOM_SLATE_APP_RUNNING, \
	struct slate_ui_data)
#define SLATE_MODEM_DOWN2_SLATE_DONE \
	_IOWR(EXCHANGE_CODE, SLATECOM_MODEM_DOWN2_SLATE, \
	struct slate_ui_data)
#define SLATE_WEAR_LOAD \
	_IOWR(EXCHANGE_CODE, SLATECOM_SLATE_WEAR_LOAD, \
	struct slate_ui_data)
#define SLATE_WEAR_UNLOAD \
	_IOWR(EXCHANGE_CODE, SLATECOM_SLATE_WEAR_UNLOAD, \
	struct slate_ui_data)
#define SLATE_ADSP_DOWN2_SLATE_DONE \
	_IOWR(EXCHANGE_CODE, SLATECOM_ADSP_DOWN2_SLATE, \
	struct slate_ui_data)

#endif /* LINUX_SLATECOM_INTERFACE_H */