Merge 9e6c9ab4fc on remote branch
Change-Id: I83ad6a0f7ca9e13add764ec918cc6949bff4ff62
This commit is contained in:
commit
a56061b2c0
4 files changed
+49
-9
No files matched your search
+1
-1
@@ -623,7 +623,6 @@ CONFIG_MSM_PIL=y
|
|||||||
CONFIG_MSM_SYSMON_QMI_COMM=y
|
CONFIG_MSM_SYSMON_QMI_COMM=y
|
||||||
CONFIG_MSM_PIL_SSR_GENERIC=y
|
CONFIG_MSM_PIL_SSR_GENERIC=y
|
||||||
CONFIG_MSM_BOOT_STATS=y
|
CONFIG_MSM_BOOT_STATS=y
|
||||||
CONFIG_QCOM_DCC_V2=y
|
|
||||||
CONFIG_QCOM_EUD=y
|
CONFIG_QCOM_EUD=y
|
||||||
CONFIG_QCOM_MINIDUMP=y
|
CONFIG_QCOM_MINIDUMP=y
|
||||||
CONFIG_MSM_CORE_HANG_DETECT=y
|
CONFIG_MSM_CORE_HANG_DETECT=y
|
||||||
@@ -644,6 +643,7 @@ CONFIG_QCOM_SMCINVOKE=y
|
|||||||
CONFIG_MSM_EVENT_TIMER=y
|
CONFIG_MSM_EVENT_TIMER=y
|
||||||
CONFIG_MSM_PM=y
|
CONFIG_MSM_PM=y
|
||||||
CONFIG_QTI_L2_REUSE=y
|
CONFIG_QTI_L2_REUSE=y
|
||||||
|
CONFIG_QCOM_DCC=y
|
||||||
CONFIG_QTI_RPM_STATS_LOG=y
|
CONFIG_QTI_RPM_STATS_LOG=y
|
||||||
CONFIG_QTEE_SHM_BRIDGE=y
|
CONFIG_QTEE_SHM_BRIDGE=y
|
||||||
CONFIG_MEM_SHARE_QMI_SERVICE=y
|
CONFIG_MEM_SHARE_QMI_SERVICE=y
|
||||||
|
|||||||
@@ -472,6 +472,7 @@ struct fastrpc_file {
|
|||||||
struct mutex perf_mutex;
|
struct mutex perf_mutex;
|
||||||
struct pm_qos_request pm_qos_req;
|
struct pm_qos_request pm_qos_req;
|
||||||
int qos_request;
|
int qos_request;
|
||||||
|
struct mutex pm_qos_mutex;
|
||||||
struct mutex map_mutex;
|
struct mutex map_mutex;
|
||||||
struct mutex internal_map_mutex;
|
struct mutex internal_map_mutex;
|
||||||
/* Identifies the device (MINOR_NUM_DEV / MINOR_NUM_SECURE_DEV) */
|
/* Identifies the device (MINOR_NUM_DEV / MINOR_NUM_SECURE_DEV) */
|
||||||
@@ -3859,6 +3860,7 @@ static int fastrpc_file_free(struct fastrpc_file *fl)
|
|||||||
mutex_destroy(&fl->perf_mutex);
|
mutex_destroy(&fl->perf_mutex);
|
||||||
mutex_destroy(&fl->map_mutex);
|
mutex_destroy(&fl->map_mutex);
|
||||||
mutex_destroy(&fl->internal_map_mutex);
|
mutex_destroy(&fl->internal_map_mutex);
|
||||||
|
mutex_destroy(&fl->pm_qos_mutex);
|
||||||
kfree(fl);
|
kfree(fl);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -4232,6 +4234,7 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
|
|||||||
hlist_add_head(&fl->hn, &me->drivers);
|
hlist_add_head(&fl->hn, &me->drivers);
|
||||||
spin_unlock(&me->hlock);
|
spin_unlock(&me->hlock);
|
||||||
mutex_init(&fl->perf_mutex);
|
mutex_init(&fl->perf_mutex);
|
||||||
|
mutex_init(&fl->pm_qos_mutex);
|
||||||
init_completion(&fl->shutdown);
|
init_completion(&fl->shutdown);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -4359,12 +4362,14 @@ static int fastrpc_internal_control(struct fastrpc_file *fl,
|
|||||||
fl->pm_qos_req.type = PM_QOS_REQ_AFFINE_CORES;
|
fl->pm_qos_req.type = PM_QOS_REQ_AFFINE_CORES;
|
||||||
cpumask_copy(&fl->pm_qos_req.cpus_affine, &mask);
|
cpumask_copy(&fl->pm_qos_req.cpus_affine, &mask);
|
||||||
|
|
||||||
|
mutex_lock(&fl->pm_qos_mutex);
|
||||||
if (!fl->qos_request) {
|
if (!fl->qos_request) {
|
||||||
pm_qos_add_request(&fl->pm_qos_req,
|
pm_qos_add_request(&fl->pm_qos_req,
|
||||||
PM_QOS_CPU_DMA_LATENCY, latency);
|
PM_QOS_CPU_DMA_LATENCY, latency);
|
||||||
fl->qos_request = 1;
|
fl->qos_request = 1;
|
||||||
} else
|
} else
|
||||||
pm_qos_update_request(&fl->pm_qos_req, latency);
|
pm_qos_update_request(&fl->pm_qos_req, latency);
|
||||||
|
mutex_unlock(&fl->pm_qos_mutex);
|
||||||
|
|
||||||
/* Ensure CPU feature map updated to DSP for early WakeUp */
|
/* Ensure CPU feature map updated to DSP for early WakeUp */
|
||||||
fastrpc_send_cpuinfo_to_dsp(fl);
|
fastrpc_send_cpuinfo_to_dsp(fl);
|
||||||
|
|||||||
+33
-8
@@ -1,7 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2008-2021, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2008-2021, The Linux Foundation. All rights reserved.
|
||||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <uapi/linux/sched/types.h>
|
#include <uapi/linux/sched/types.h>
|
||||||
@@ -2677,6 +2677,15 @@ static int kgsl_setup_anon_useraddr(struct kgsl_pagetable *pagetable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_DMA_SHARED_BUFFER
|
#ifdef CONFIG_DMA_SHARED_BUFFER
|
||||||
|
static int match_file(const void *p, struct file *file, unsigned int fd)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* We must return fd + 1 because iterate_fd stops searching on
|
||||||
|
* non-zero return, but 0 is a valid fd.
|
||||||
|
*/
|
||||||
|
return (p == file) ? (fd + 1) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void _setup_cache_mode(struct kgsl_mem_entry *entry,
|
static void _setup_cache_mode(struct kgsl_mem_entry *entry,
|
||||||
struct vm_area_struct *vma)
|
struct vm_area_struct *vma)
|
||||||
{
|
{
|
||||||
@@ -2714,6 +2723,8 @@ static int kgsl_setup_dmabuf_useraddr(struct kgsl_device *device,
|
|||||||
vma = find_vma(current->mm, hostptr);
|
vma = find_vma(current->mm, hostptr);
|
||||||
|
|
||||||
if (vma && vma->vm_file) {
|
if (vma && vma->vm_file) {
|
||||||
|
int fd;
|
||||||
|
|
||||||
ret = check_vma_flags(vma, entry->memdesc.flags);
|
ret = check_vma_flags(vma, entry->memdesc.flags);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
up_read(¤t->mm->mmap_sem);
|
up_read(¤t->mm->mmap_sem);
|
||||||
@@ -2729,13 +2740,27 @@ static int kgsl_setup_dmabuf_useraddr(struct kgsl_device *device,
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Look for the fd that matches this vma file */
|
||||||
* Take a refcount because dma_buf_put() decrements the
|
fd = iterate_fd(current->files, 0, match_file, vma->vm_file);
|
||||||
* refcount
|
if (fd) {
|
||||||
*/
|
dmabuf = dma_buf_get(fd - 1);
|
||||||
get_file(vma->vm_file);
|
if (IS_ERR(dmabuf)) {
|
||||||
|
up_read(¤t->mm->mmap_sem);
|
||||||
dmabuf = vma->vm_file->private_data;
|
return PTR_ERR(dmabuf);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* It is possible that the fd obtained from iterate_fd
|
||||||
|
* was closed before passing the fd to dma_buf_get().
|
||||||
|
* Hence dmabuf returned by dma_buf_get() could be
|
||||||
|
* different from vma->vm_file->private_data. Return
|
||||||
|
* failure if this happens.
|
||||||
|
*/
|
||||||
|
if (dmabuf != vma->vm_file->private_data) {
|
||||||
|
dma_buf_put(dmabuf);
|
||||||
|
up_read(¤t->mm->mmap_sem);
|
||||||
|
return -EBADF;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ERR_OR_NULL(dmabuf)) {
|
if (IS_ERR_OR_NULL(dmabuf)) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-2.0-only
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||||
|
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <asm/cacheflush.h>
|
#include <asm/cacheflush.h>
|
||||||
@@ -61,6 +62,15 @@ _kgsl_get_pool_from_order(unsigned int order)
|
|||||||
static void
|
static void
|
||||||
_kgsl_pool_add_page(struct kgsl_page_pool *pool, struct page *p)
|
_kgsl_pool_add_page(struct kgsl_page_pool *pool, struct page *p)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Sanity check to make sure we don't re-pool a page that
|
||||||
|
* somebody else has a reference to.
|
||||||
|
*/
|
||||||
|
if (WARN_ON_ONCE(unlikely(page_count(p) > 1))) {
|
||||||
|
__free_pages(p, pool->pool_order);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
kgsl_zero_page(p, pool->pool_order);
|
kgsl_zero_page(p, pool->pool_order);
|
||||||
|
|
||||||
spin_lock(&pool->list_lock);
|
spin_lock(&pool->list_lock);
|
||||||
|
|||||||
Reference in new issue
Block a user