This commit is contained in:
9
Makefile
9
Makefile
@@ -800,12 +800,6 @@ ifdef CONFIG_MINIMAL_TRACING_FOR_IORAP
|
||||
KBUILD_CFLAGS += -DNOTRACE
|
||||
endif
|
||||
|
||||
ifdef CONFIG_INLINE_OPTIMIZATION
|
||||
KBUILD_CFLAGS += -mllvm -inline-threshold=2000
|
||||
KBUILD_CFLAGS += -mllvm -inlinehint-threshold=3000
|
||||
KBUILD_CFLAGS += -mllvm -unroll-threshold=1200
|
||||
endif
|
||||
|
||||
# Tell gcc to never replace conditional load with a non-conditional one
|
||||
KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
|
||||
@@ -977,7 +971,8 @@ endif
|
||||
|
||||
ifdef CONFIG_LTO_CLANG
|
||||
ifdef CONFIG_THINLTO
|
||||
lto-clang-flags := -flto=thin
|
||||
lto-clang-flags := -funified-lto
|
||||
lto-clang-flags += -flto=thin
|
||||
LDFLAGS += --thinlto-cache-dir=.thinlto-cache
|
||||
else
|
||||
lto-clang-flags := -flto
|
||||
|
||||
@@ -7,10 +7,6 @@
|
||||
# it under the terms of the GNU General Public License version 2 as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
ccflags-y += -O3
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
|
||||
obj-$(CONFIG_CRYPTO_SHA1_ARM64_CE) += sha1-ce.o
|
||||
sha1-ce-y := sha1-ce-glue.o sha1-ce-core.o
|
||||
|
||||
@@ -11,12 +11,7 @@ CFLAGS_REMOVE_ftrace.o = -pg
|
||||
CFLAGS_REMOVE_insn.o = -pg
|
||||
CFLAGS_REMOVE_return_address.o = -pg
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
CFLAGS_setup.o = -DUTS_MACHINE='"$(UTS_MACHINE)"'
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
# Object file lists.
|
||||
arm64-obj-y := debug-monitors.o entry.o irq.o fpsimd.o \
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
ccflags-y += -O3
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
lib-y := checksum.o clear_user.o delay.o copy_from_user.o \
|
||||
copy_to_user.o copy_in_user.o copy_page.o \
|
||||
clear_page.o memchr.o memcpy.o memset.o \
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
obj-y := dma-mapping.o extable.o fault.o init.o \
|
||||
cache.o copypage.o flush.o \
|
||||
ioremap.o mmap.o pgd.o mmu.o \
|
||||
|
||||
@@ -11,9 +11,6 @@ obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-tag.o blk-sysfs.o \
|
||||
genhd.o partition-generic.o ioprio.o \
|
||||
badblocks.o partitions/
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-$(CONFIG_BOUNCE) += bounce.o
|
||||
obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o
|
||||
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
|
||||
@@ -40,4 +37,4 @@ obj-$(CONFIG_BLK_DEBUG_FS) += blk-mq-debugfs.o
|
||||
obj-$(CONFIG_BLK_SED_OPAL) += sed-opal.o
|
||||
obj-$(CONFIG_BLK_INLINE_ENCRYPTION) += keyslot-manager.o bio-crypt-ctx.o \
|
||||
blk-crypto.o
|
||||
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
|
||||
obj-$(CONFIG_BLK_INLINE_ENCRYPTION_FALLBACK) += blk-crypto-fallback.o
|
||||
@@ -3,9 +3,6 @@
|
||||
# Cryptographic API
|
||||
#
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-$(CONFIG_CRYPTO) += crypto.o
|
||||
crypto-y := api.o cipher.o compress.o memneq.o
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
ccflags-y += -I$(src) # needed for trace events
|
||||
|
||||
obj-$(CONFIG_ANDROID_BINDERFS) += binderfs.o
|
||||
|
||||
@@ -2193,8 +2193,9 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
|
||||
* Convert the address to an offset relative to
|
||||
* the base of the transaction buffer.
|
||||
*/
|
||||
fda_offset = parent->buffer - buffer->user_data +
|
||||
fda->parent_offset;
|
||||
fda_offset =
|
||||
(parent->buffer - (uintptr_t)buffer->user_data) +
|
||||
fda->parent_offset;
|
||||
for (fd_index = 0; fd_index < fda->num_fds;
|
||||
fd_index++) {
|
||||
u32 fd;
|
||||
@@ -2449,7 +2450,7 @@ static int binder_translate_fd_array(struct binder_fd_array_object *fda,
|
||||
* Convert the address to an offset relative to
|
||||
* the base of the transaction buffer.
|
||||
*/
|
||||
fda_offset = parent->buffer - t->buffer->user_data +
|
||||
fda_offset = (parent->buffer - (uintptr_t)t->buffer->user_data) +
|
||||
fda->parent_offset;
|
||||
if (!IS_ALIGNED((unsigned long)fda_offset, sizeof(u32))) {
|
||||
binder_user_error("%d:%d parent offset not aligned correctly.\n",
|
||||
@@ -2517,9 +2518,14 @@ static int binder_fixup_parent(struct binder_transaction *t,
|
||||
proc->pid, thread->pid);
|
||||
return -EINVAL;
|
||||
}
|
||||
buffer_offset = bp->parent_offset + parent->buffer - b->user_data;
|
||||
binder_alloc_copy_to_buffer(&target_proc->alloc, b, buffer_offset,
|
||||
&bp->buffer, sizeof(bp->buffer));
|
||||
buffer_offset = bp->parent_offset +
|
||||
(uintptr_t)parent->buffer - (uintptr_t)b->user_data;
|
||||
if (binder_alloc_copy_to_buffer(&target_proc->alloc, b, buffer_offset,
|
||||
&bp->buffer, sizeof(bp->buffer))) {
|
||||
binder_user_error("%d:%d got transaction with invalid parent offset\n",
|
||||
proc->pid, thread->pid);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -3055,7 +3061,7 @@ static void binder_transaction(struct binder_proc *proc,
|
||||
|
||||
t->buffer = binder_alloc_new_buf(&target_proc->alloc, tr->data_size,
|
||||
tr->offsets_size, extra_buffers_size,
|
||||
!reply && (t->flags & TF_ONE_WAY));
|
||||
!reply && (t->flags & TF_ONE_WAY), current->tgid);
|
||||
if (IS_ERR(t->buffer)) {
|
||||
/*
|
||||
* -ESRCH indicates VMA cleared. The target is dying.
|
||||
@@ -3068,16 +3074,20 @@ static void binder_transaction(struct binder_proc *proc,
|
||||
goto err_binder_alloc_buf_failed;
|
||||
}
|
||||
if (secctx) {
|
||||
int err;
|
||||
__maybe_unused int err;
|
||||
size_t buf_offset = ALIGN(tr->data_size, sizeof(void *)) +
|
||||
ALIGN(tr->offsets_size, sizeof(void *)) +
|
||||
ALIGN(extra_buffers_size, sizeof(void *)) -
|
||||
ALIGN(secctx_sz, sizeof(u64));
|
||||
|
||||
t->security_ctx = t->buffer->user_data + buf_offset;
|
||||
binder_alloc_copy_to_buffer(&target_proc->alloc,
|
||||
t->buffer, buf_offset,
|
||||
secctx, secctx_sz);
|
||||
t->security_ctx = (uintptr_t)t->buffer->user_data + buf_offset;
|
||||
err = binder_alloc_copy_to_buffer(&target_proc->alloc,
|
||||
t->buffer, buf_offset,
|
||||
secctx, secctx_sz);
|
||||
if (err) {
|
||||
t->security_ctx = 0;
|
||||
WARN_ON(1);
|
||||
}
|
||||
security_release_secctx(secctx, secctx_sz);
|
||||
secctx = NULL;
|
||||
}
|
||||
@@ -3302,7 +3312,8 @@ static void binder_transaction(struct binder_proc *proc,
|
||||
goto err_copy_data_failed;
|
||||
}
|
||||
/* Fixup buffer pointer to target proc address space */
|
||||
bp->buffer = t->buffer->user_data + sg_buf_offset;
|
||||
bp->buffer = (uintptr_t)
|
||||
t->buffer->user_data + sg_buf_offset;
|
||||
sg_buf_offset += ALIGN(bp->length, sizeof(u64));
|
||||
|
||||
num_valid = (buffer_offset - off_start_offset) /
|
||||
@@ -4440,7 +4451,7 @@ retry:
|
||||
}
|
||||
trd->data_size = t->buffer->data_size;
|
||||
trd->offsets_size = t->buffer->offsets_size;
|
||||
trd->data.ptr.buffer = t->buffer->user_data;
|
||||
trd->data.ptr.buffer = (uintptr_t)t->buffer->user_data;
|
||||
trd->data.ptr.offsets = trd->data.ptr.buffer +
|
||||
ALIGN(t->buffer->data_size,
|
||||
sizeof(void *));
|
||||
@@ -4776,7 +4787,7 @@ static unsigned int binder_poll(struct file *filp,
|
||||
|
||||
thread = binder_get_thread(proc);
|
||||
if (!thread)
|
||||
return EPOLLERR;
|
||||
return POLLERR;
|
||||
|
||||
binder_inner_proc_lock(thread->proc);
|
||||
thread->looper |= BINDER_LOOPER_STATE_POLL;
|
||||
@@ -5732,7 +5743,7 @@ static void print_binder_transaction_ilocked(struct seq_file *m,
|
||||
}
|
||||
if (buffer->target_node)
|
||||
seq_printf(m, " node %d", buffer->target_node->debug_id);
|
||||
seq_printf(m, " size %zd:%zd data %lx\n",
|
||||
seq_printf(m, " size %zd:%zd data %pK\n",
|
||||
buffer->data_size, buffer->offsets_size,
|
||||
buffer->user_data);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,13 +9,13 @@
|
||||
#include <linux/rbtree.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/rtmutex.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/list_lru.h>
|
||||
#include <uapi/linux/android/binder.h>
|
||||
|
||||
extern struct list_lru binder_freelist;
|
||||
extern struct list_lru binder_alloc_lru;
|
||||
struct binder_transaction;
|
||||
|
||||
/**
|
||||
@@ -49,19 +49,21 @@ struct binder_buffer {
|
||||
unsigned async_transaction:1;
|
||||
unsigned oneway_spam_suspect:1;
|
||||
unsigned debug_id:27;
|
||||
|
||||
struct binder_transaction *transaction;
|
||||
|
||||
struct binder_node *target_node;
|
||||
size_t data_size;
|
||||
size_t offsets_size;
|
||||
size_t extra_buffers_size;
|
||||
unsigned long user_data;
|
||||
int pid;
|
||||
void __user *user_data;
|
||||
int pid;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct binder_lru_page - page object used for binder shrinker
|
||||
* @page_ptr: pointer to physical page in mmap'd space
|
||||
* @lru: entry in binder_freelist
|
||||
* @lru: entry in binder_alloc_lru
|
||||
* @alloc: binder_alloc for a proc
|
||||
*/
|
||||
struct binder_lru_page {
|
||||
@@ -72,7 +74,6 @@ struct binder_lru_page {
|
||||
|
||||
/**
|
||||
* struct binder_alloc - per-binder proc state for binder allocator
|
||||
* @lock: protects binder_alloc fields
|
||||
* @vma: vm_area_struct passed to mmap_handler
|
||||
* (invarient after mmap)
|
||||
* @tsk: tid for task that called init for this proc
|
||||
@@ -98,10 +99,10 @@ struct binder_lru_page {
|
||||
* struct binder_buffer objects used to track the user buffers
|
||||
*/
|
||||
struct binder_alloc {
|
||||
spinlock_t lock;
|
||||
struct mutex mutex;
|
||||
struct vm_area_struct *vma;
|
||||
struct mm_struct *vma_vm_mm;
|
||||
unsigned long buffer;
|
||||
void __user *buffer;
|
||||
struct list_head buffers;
|
||||
struct rb_root free_buffers;
|
||||
struct rb_root allocated_buffers;
|
||||
@@ -122,26 +123,27 @@ static inline void binder_selftest_alloc(struct binder_alloc *alloc) {}
|
||||
enum lru_status binder_alloc_free_page(struct list_head *item,
|
||||
struct list_lru_one *lru,
|
||||
spinlock_t *lock, void *cb_arg);
|
||||
struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
|
||||
size_t data_size,
|
||||
size_t offsets_size,
|
||||
size_t extra_buffers_size,
|
||||
int is_async);
|
||||
void binder_alloc_init(struct binder_alloc *alloc);
|
||||
int binder_alloc_shrinker_init(void);
|
||||
void binder_alloc_shrinker_exit(void);
|
||||
void binder_alloc_vma_close(struct binder_alloc *alloc);
|
||||
struct binder_buffer *
|
||||
extern struct binder_buffer *binder_alloc_new_buf(struct binder_alloc *alloc,
|
||||
size_t data_size,
|
||||
size_t offsets_size,
|
||||
size_t extra_buffers_size,
|
||||
int is_async,
|
||||
int pid);
|
||||
extern void binder_alloc_init(struct binder_alloc *alloc);
|
||||
extern int binder_alloc_shrinker_init(void);
|
||||
extern void binder_alloc_shrinker_exit(void);
|
||||
extern void binder_alloc_vma_close(struct binder_alloc *alloc);
|
||||
extern struct binder_buffer *
|
||||
binder_alloc_prepare_to_free(struct binder_alloc *alloc,
|
||||
unsigned long user_ptr);
|
||||
void binder_alloc_free_buf(struct binder_alloc *alloc,
|
||||
struct binder_buffer *buffer);
|
||||
int binder_alloc_mmap_handler(struct binder_alloc *alloc,
|
||||
struct vm_area_struct *vma);
|
||||
void binder_alloc_deferred_release(struct binder_alloc *alloc);
|
||||
int binder_alloc_get_allocated_count(struct binder_alloc *alloc);
|
||||
void binder_alloc_print_allocated(struct seq_file *m,
|
||||
struct binder_alloc *alloc);
|
||||
uintptr_t user_ptr);
|
||||
extern void binder_alloc_free_buf(struct binder_alloc *alloc,
|
||||
struct binder_buffer *buffer);
|
||||
extern int binder_alloc_mmap_handler(struct binder_alloc *alloc,
|
||||
struct vm_area_struct *vma);
|
||||
extern void binder_alloc_deferred_release(struct binder_alloc *alloc);
|
||||
extern int binder_alloc_get_allocated_count(struct binder_alloc *alloc);
|
||||
extern void binder_alloc_print_allocated(struct seq_file *m,
|
||||
struct binder_alloc *alloc);
|
||||
void binder_alloc_print_pages(struct seq_file *m,
|
||||
struct binder_alloc *alloc);
|
||||
|
||||
@@ -156,9 +158,9 @@ binder_alloc_get_free_async_space(struct binder_alloc *alloc)
|
||||
{
|
||||
size_t free_async_space;
|
||||
|
||||
spin_lock(&alloc->lock);
|
||||
mutex_lock(&alloc->mutex);
|
||||
free_async_space = alloc->free_async_space;
|
||||
spin_unlock(&alloc->lock);
|
||||
mutex_unlock(&alloc->mutex);
|
||||
return free_async_space;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* binder_alloc_selftest.c
|
||||
*
|
||||
* Android IPC Subsystem
|
||||
*
|
||||
* Copyright (C) 2017 Google, Inc.
|
||||
*
|
||||
* This software is licensed under the terms of the GNU General Public
|
||||
* License version 2, as published by the Free Software Foundation, and
|
||||
* may be copied, distributed, and modified under those terms.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
@@ -102,11 +93,11 @@ static bool check_buffer_pages_allocated(struct binder_alloc *alloc,
|
||||
struct binder_buffer *buffer,
|
||||
size_t size)
|
||||
{
|
||||
unsigned long page_addr;
|
||||
unsigned long end;
|
||||
void __user *page_addr;
|
||||
void __user *end;
|
||||
int page_index;
|
||||
|
||||
end = PAGE_ALIGN(buffer->user_data + size);
|
||||
end = (void __user *)PAGE_ALIGN((uintptr_t)buffer->user_data + size);
|
||||
page_addr = buffer->user_data;
|
||||
for (; page_addr < end; page_addr += PAGE_SIZE) {
|
||||
page_index = (page_addr - alloc->buffer) / PAGE_SIZE;
|
||||
@@ -128,7 +119,7 @@ static void binder_selftest_alloc_buf(struct binder_alloc *alloc,
|
||||
int i;
|
||||
|
||||
for (i = 0; i < BUFFER_NUM; i++) {
|
||||
buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0);
|
||||
buffers[i] = binder_alloc_new_buf(alloc, sizes[i], 0, 0, 0, 0);
|
||||
if (IS_ERR(buffers[i]) ||
|
||||
!check_buffer_pages_allocated(alloc, buffers[i],
|
||||
sizes[i])) {
|
||||
|
||||
@@ -312,7 +312,7 @@ DEFINE_EVENT(binder_buffer_class, binder_transaction_update_buffer_release,
|
||||
|
||||
TRACE_EVENT(binder_update_page_range,
|
||||
TP_PROTO(struct binder_alloc *alloc, bool allocate,
|
||||
unsigned long start, unsigned long end),
|
||||
void __user *start, void __user *end),
|
||||
TP_ARGS(alloc, allocate, start, end),
|
||||
TP_STRUCT__entry(
|
||||
__field(int, proc)
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
# Rewritten to use lists instead of if-statements.
|
||||
#
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-$(CONFIG_MAC_FLOPPY) += swim3.o
|
||||
obj-$(CONFIG_BLK_DEV_SWIM) += swim_mod.o
|
||||
obj-$(CONFIG_BLK_DEV_FD) += floppy.o
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
ccflags-y += -O3
|
||||
|
||||
zram-y := zcomp.o zram_drv.o
|
||||
zram-$(CONFIG_ZRAM_DEDUP) += zram_dedup.o
|
||||
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
#
|
||||
# Makefile for the kernel character device drivers.
|
||||
#
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-y += mem.o random.o
|
||||
obj-$(CONFIG_TTY_PRINTK) += ttyprintk.o
|
||||
obj-y += misc.o
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
ccflags-y += -O3
|
||||
|
||||
# CPUfreq core
|
||||
obj-$(CONFIG_CPU_FREQ) += cpufreq.o freq_table.o
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
obj-$(CONFIG_PM_DEVFREQ) += devfreq.o
|
||||
obj-$(CONFIG_PM_DEVFREQ_EVENT) += devfreq-event.o
|
||||
obj-$(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) += governor_simpleondemand.o
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
# Makefile for the drm device driver. This driver provides support for the
|
||||
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
drm-y := drm_auth.o drm_bufs.o drm_cache.o \
|
||||
drm_context.o drm_dma.o \
|
||||
drm_file.o drm_gem.o drm_ioctl.o drm_irq.o \
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
ccflags-y := -Iinclude/linux
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
msm_kgsl_core-y = \
|
||||
kgsl.o \
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
ccflags-y += -O3
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-$(CONFIG_FINGERPRINT_GOODIX_TA) += gf_spi.o
|
||||
|
||||
@@ -100,40 +100,44 @@ static inline int gf_power_switch(struct gf_dev *gf_dev, int status)
|
||||
}
|
||||
|
||||
static inline void gf_setup(struct gf_dev *gf_dev) {
|
||||
gf_dev->pwr_gpio = of_get_named_gpio(gf_dev->spi->dev.of_node,
|
||||
"fp-gpio-pwr", 0);
|
||||
gpio_request(gf_dev->pwr_gpio, "goodix_pwr");
|
||||
//gpio_direction_output(gf_dev->pwr_gpio, 1); // will be turned on through ioctl
|
||||
gf_dev->rst_gpio = of_get_named_gpio(gf_dev->spi->dev.of_node,
|
||||
"goodix,gpio-reset", 0);
|
||||
gpio_request(gf_dev->rst_gpio, "gpio-reset");
|
||||
gpio_direction_output(gf_dev->rst_gpio, 1);
|
||||
gf_dev->irq_gpio = of_get_named_gpio(gf_dev->spi->dev.of_node,
|
||||
"goodix,gpio-irq", 0);
|
||||
gpio_request(gf_dev->irq_gpio, "gpio-irq");
|
||||
gpio_direction_input(gf_dev->irq_gpio);
|
||||
gf_dev->irq = gpio_to_irq(gf_dev->irq_gpio);
|
||||
if (!request_threaded_irq(gf_dev->irq, NULL, gf_irq,
|
||||
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
|
||||
"gf", gf_dev))
|
||||
enable_irq_wake(gf_dev->irq);
|
||||
gf_dev->irq_enabled = 1;
|
||||
irq_switch(gf_dev, 0);
|
||||
return;
|
||||
gf_dev->pwr_gpio = of_get_named_gpio(gf_dev->spi->dev.of_node,
|
||||
"fp-gpio-pwr", 0);
|
||||
gpio_request(gf_dev->pwr_gpio, "goodix_pwr");
|
||||
//gpio_direction_output(gf_dev->pwr_gpio, 1); // will be turned on through ioctl
|
||||
gf_dev->rst_gpio = of_get_named_gpio(gf_dev->spi->dev.of_node,
|
||||
"goodix,gpio-reset", 0);
|
||||
gpio_request(gf_dev->rst_gpio, "gpio-reset");
|
||||
gpio_direction_output(gf_dev->rst_gpio, 1);
|
||||
gf_dev->irq_gpio = of_get_named_gpio(gf_dev->spi->dev.of_node,
|
||||
"goodix,gpio-irq", 0);
|
||||
gpio_request(gf_dev->irq_gpio, "gpio-irq");
|
||||
gpio_direction_input(gf_dev->irq_gpio);
|
||||
gf_dev->irq = gpio_to_irq(gf_dev->irq_gpio);
|
||||
if (!request_threaded_irq(gf_dev->irq, gf_irq, NULL,
|
||||
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
|
||||
"gf", gf_dev)) {
|
||||
enable_irq_wake(gf_dev->irq);
|
||||
gf_dev->irq_enabled = 1;
|
||||
irq_switch(gf_dev, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void gf_cleanup(struct gf_dev *gf_dev) {
|
||||
if (gf_dev->irq_enabled) {
|
||||
irq_switch(gf_dev, 0);
|
||||
free_irq(gf_dev->irq, gf_dev);
|
||||
}
|
||||
if (gpio_is_valid(gf_dev->irq_gpio))
|
||||
gpio_free(gf_dev->irq_gpio);
|
||||
if (gpio_is_valid(gf_dev->rst_gpio))
|
||||
gpio_free(gf_dev->rst_gpio);
|
||||
if (gpio_is_valid(gf_dev->pwr_gpio))
|
||||
gf_power_switch(gf_dev, 0);
|
||||
gpio_free(gf_dev->pwr_gpio);
|
||||
if (gf_dev->irq_enabled) {
|
||||
irq_switch(gf_dev, 0);
|
||||
free_irq(gf_dev->irq, gf_dev);
|
||||
}
|
||||
if (gpio_is_valid(gf_dev->irq_gpio)) {
|
||||
gpio_free(gf_dev->irq_gpio);
|
||||
}
|
||||
if (gpio_is_valid(gf_dev->rst_gpio)) {
|
||||
gpio_free(gf_dev->rst_gpio);
|
||||
}
|
||||
if (gpio_is_valid(gf_dev->pwr_gpio)) {
|
||||
gf_power_switch(gf_dev, 0);
|
||||
gpio_free(gf_dev->pwr_gpio);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void gpio_reset(struct gf_dev *gf_dev) {
|
||||
|
||||
@@ -288,51 +288,51 @@ static int qti_haptics_read(struct qti_hap_chip *chip,
|
||||
}
|
||||
|
||||
static int qti_haptics_write(struct qti_hap_chip *chip,
|
||||
u8 addr, u8 *val, int len)
|
||||
u8 addr, u8 *val, int len)
|
||||
{
|
||||
int rc = 0, i;
|
||||
unsigned long flags;
|
||||
int rc = 0, i;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&chip->bus_lock, flags);
|
||||
if (is_secure(addr)) {
|
||||
for (i = 0; i < len; i++) {
|
||||
rc = regmap_write(chip->regmap,
|
||||
chip->reg_base + REG_HAP_SEC_ACCESS,
|
||||
0xA5);
|
||||
if (rc < 0) {
|
||||
dev_err(chip->dev, "write SEC_ACCESS failed, rc=%d\n",
|
||||
rc);
|
||||
goto unlock;
|
||||
}
|
||||
spin_lock_irqsave(&chip->bus_lock, flags);
|
||||
if (is_secure(addr)) {
|
||||
for (i = 0; i < len; i++) {
|
||||
rc = regmap_write(chip->regmap,
|
||||
chip->reg_base + REG_HAP_SEC_ACCESS,
|
||||
0xA5);
|
||||
if (rc < 0) {
|
||||
dev_err(chip->dev, "write SEC_ACCESS failed, rc=%d\n",
|
||||
rc);
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
rc = regmap_write(chip->regmap,
|
||||
chip->reg_base + addr + i, val[i]);
|
||||
if (rc < 0) {
|
||||
dev_err(chip->dev, "write val 0x%x to addr 0x%x failed, rc=%d\n",
|
||||
val[i], addr + i, rc);
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (len > 1)
|
||||
rc = regmap_bulk_write(chip->regmap,
|
||||
chip->reg_base + addr, val, len);
|
||||
else
|
||||
rc = regmap_write(chip->regmap,
|
||||
chip->reg_base + addr, *val);
|
||||
rc = regmap_write(chip->regmap,
|
||||
chip->reg_base + addr + i, val[i]);
|
||||
if (rc < 0) {
|
||||
dev_err(chip->dev, "write val 0x%x to addr 0x%x failed, rc=%d\n",
|
||||
val[i], addr + i, rc);
|
||||
goto unlock;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (len > 1)
|
||||
rc = regmap_bulk_write(chip->regmap,
|
||||
chip->reg_base + addr, val, len);
|
||||
else
|
||||
rc = regmap_write(chip->regmap,
|
||||
chip->reg_base + addr, *val);
|
||||
|
||||
if (rc < 0)
|
||||
dev_err(chip->dev, "write addr 0x%x failed, rc=%d\n",
|
||||
addr, rc);
|
||||
}
|
||||
if (rc < 0)
|
||||
dev_err(chip->dev, "write addr 0x%x failed, rc=%d\n",
|
||||
addr, rc);
|
||||
}
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
dev_dbg(chip->dev, "Update addr 0x%x to val 0x%x\n",
|
||||
addr + i, val[i]);
|
||||
for (i = 0; i < len; i++)
|
||||
dev_dbg(chip->dev, "Update addr 0x%x to val 0x%x\n",
|
||||
addr + i, val[i]);
|
||||
|
||||
unlock:
|
||||
spin_unlock_irqrestore(&chip->bus_lock, flags);
|
||||
return rc;
|
||||
spin_unlock_irqrestore(&chip->bus_lock, flags);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int qti_haptics_masked_write(struct qti_hap_chip *chip, u8 addr,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
obj-$(CONFIG_TOUCHSCREEN_GOODIX_GTX8) += goodix_ts_i2c.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_GOODIX_GTX8) += goodix_ts_core.o
|
||||
obj-$(CONFIG_TOUCHSCREEN_GOODIX_GTX8) += goodix_cfg_bin.o
|
||||
|
||||
@@ -395,113 +395,109 @@ rel_cmd_buf:
|
||||
}
|
||||
|
||||
int32_t cam_packet_validate_plane_size(
|
||||
struct cam_buf_io_cfg *io_cfg,
|
||||
int plane_index,
|
||||
size_t size)
|
||||
struct cam_buf_io_cfg *io_cfg,
|
||||
int plane_index,
|
||||
size_t size)
|
||||
{
|
||||
int rc = 0;
|
||||
uint32_t kmd_plane_size = 0;
|
||||
uint32_t plane_stride = 0;
|
||||
uint32_t slice_height = 0;
|
||||
uint32_t metadata_size = 0;
|
||||
uint32_t format = io_cfg->format;
|
||||
uint32_t plane_pixel_size = 0;
|
||||
int rc = 0;
|
||||
uint32_t kmd_plane_size = 0;
|
||||
uint32_t plane_stride = 0;
|
||||
uint32_t slice_height = 0;
|
||||
uint32_t metadata_size = 0;
|
||||
uint32_t format = io_cfg->format;
|
||||
uint32_t plane_pixel_size = 0;
|
||||
|
||||
if (plane_index < CAM_PACKET_MAX_PLANES) {
|
||||
plane_stride = io_cfg->planes[plane_index].plane_stride;
|
||||
slice_height = io_cfg->planes[plane_index].slice_height;
|
||||
}
|
||||
if (plane_index < CAM_PACKET_MAX_PLANES) {
|
||||
plane_stride = io_cfg->planes[plane_index].plane_stride;
|
||||
slice_height = io_cfg->planes[plane_index].slice_height;
|
||||
}
|
||||
|
||||
if (!(plane_stride && slice_height)) {
|
||||
CAM_ERR(CAM_ISP,
|
||||
"Invalid values from UMD stride %d, slice height %d",
|
||||
plane_stride,
|
||||
slice_height);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (!(plane_stride && slice_height)) {
|
||||
CAM_ERR(CAM_ISP,
|
||||
"Invalid values from UMD stride %d, slice height %d",
|
||||
plane_stride,
|
||||
slice_height);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
switch (format) {
|
||||
case CAM_FORMAT_MIPI_RAW_6:
|
||||
case CAM_FORMAT_MIPI_RAW_8:
|
||||
kmd_plane_size = ((plane_stride * slice_height) + 16 - 1)
|
||||
/ 16 * 16;
|
||||
break;
|
||||
case CAM_FORMAT_MIPI_RAW_10:
|
||||
if (plane_stride % 4 == 0)
|
||||
kmd_plane_size = ((plane_stride * slice_height)
|
||||
+ 16 - 1) / 16 * 16;
|
||||
break;
|
||||
case CAM_FORMAT_MIPI_RAW_12:
|
||||
if (plane_stride % 2 == 0)
|
||||
kmd_plane_size = ((plane_stride * slice_height)
|
||||
+ 16 - 1) / 16 * 16;
|
||||
break;
|
||||
case CAM_FORMAT_MIPI_RAW_14:
|
||||
if (plane_stride % 4 == 0)
|
||||
kmd_plane_size = plane_stride * slice_height * 7 / 4;
|
||||
break;
|
||||
case CAM_FORMAT_PLAIN16_8:
|
||||
case CAM_FORMAT_PLAIN16_10:
|
||||
case CAM_FORMAT_PLAIN16_12:
|
||||
case CAM_FORMAT_PLAIN16_14:
|
||||
case CAM_FORMAT_PLAIN16_16:
|
||||
case CAM_FORMAT_PLAIN64:
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
case CAM_FORMAT_NV21:
|
||||
case CAM_FORMAT_NV12:
|
||||
if (plane_index < CAM_PACKET_MAX_PLANES)
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
case CAM_FORMAT_PD10:
|
||||
if (plane_index < CAM_PACKET_MAX_PLANES)
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
case CAM_FORMAT_UBWC_NV12:
|
||||
case CAM_FORMAT_UBWC_NV12_4R:
|
||||
case CAM_FORMAT_UBWC_TP10:
|
||||
metadata_size = io_cfg->planes[plane_index].meta_size;
|
||||
plane_pixel_size = ((plane_stride * slice_height) +
|
||||
(4096 - 1)) & ~((uint32_t) 4096 - 1);
|
||||
kmd_plane_size = metadata_size + plane_pixel_size;
|
||||
break;
|
||||
case CAM_FORMAT_UBWC_P010:
|
||||
case CAM_FORMAT_PLAIN32_20:
|
||||
case CAM_FORMAT_TP10:
|
||||
case CAM_FORMAT_YUV422:
|
||||
case CAM_FORMAT_PD8:
|
||||
case CAM_FORMAT_PLAIN128:
|
||||
case CAM_FORMAT_ARGB:
|
||||
case CAM_FORMAT_ARGB_10:
|
||||
case CAM_FORMAT_ARGB_12:
|
||||
case CAM_FORMAT_ARGB_14:
|
||||
case CAM_FORMAT_MIPI_RAW_16:
|
||||
case CAM_FORMAT_MIPI_RAW_20:
|
||||
case CAM_FORMAT_QTI_RAW_8:
|
||||
case CAM_FORMAT_QTI_RAW_10:
|
||||
case CAM_FORMAT_QTI_RAW_12:
|
||||
case CAM_FORMAT_QTI_RAW_14:
|
||||
case CAM_FORMAT_PLAIN8:
|
||||
case CAM_FORMAT_PLAIN8_SWAP:
|
||||
case CAM_FORMAT_PLAIN8_10:
|
||||
case CAM_FORMAT_PLAIN8_10_SWAP:
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
default:
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
}
|
||||
if (!kmd_plane_size ||
|
||||
kmd_plane_size > (size - io_cfg->offsets[plane_index])) {
|
||||
CAM_ERR(CAM_ISP,
|
||||
"kmd size: %d umd size: %d width: %d height: %d stride: %d sliceheight: %d ",
|
||||
kmd_plane_size,
|
||||
size,
|
||||
io_cfg->planes[plane_index].width,
|
||||
io_cfg->planes[plane_index].height,
|
||||
plane_stride,
|
||||
slice_height);
|
||||
return -EINVAL;
|
||||
}
|
||||
return rc;
|
||||
switch (format) {
|
||||
case CAM_FORMAT_MIPI_RAW_6:
|
||||
case CAM_FORMAT_MIPI_RAW_8:
|
||||
kmd_plane_size = ((plane_stride * slice_height) + 16 - 1) / 16 * 16;
|
||||
break;
|
||||
case CAM_FORMAT_MIPI_RAW_10:
|
||||
if (plane_stride % 4 == 0)
|
||||
kmd_plane_size = ((plane_stride * slice_height) + 16 - 1) / 16 * 16;
|
||||
break;
|
||||
case CAM_FORMAT_MIPI_RAW_12:
|
||||
if (plane_stride % 2 == 0)
|
||||
kmd_plane_size = ((plane_stride * slice_height) + 16 - 1) / 16 * 16;
|
||||
break;
|
||||
case CAM_FORMAT_MIPI_RAW_14:
|
||||
if (plane_stride % 4 == 0)
|
||||
kmd_plane_size = plane_stride * slice_height * 7 / 4;
|
||||
break;
|
||||
case CAM_FORMAT_PLAIN16_8:
|
||||
case CAM_FORMAT_PLAIN16_10:
|
||||
case CAM_FORMAT_PLAIN16_12:
|
||||
case CAM_FORMAT_PLAIN16_14:
|
||||
case CAM_FORMAT_PLAIN16_16:
|
||||
case CAM_FORMAT_PLAIN64:
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
case CAM_FORMAT_NV21:
|
||||
case CAM_FORMAT_NV12:
|
||||
if (plane_index < CAM_PACKET_MAX_PLANES)
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
case CAM_FORMAT_PD10:
|
||||
if (plane_index < CAM_PACKET_MAX_PLANES)
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
case CAM_FORMAT_UBWC_NV12:
|
||||
case CAM_FORMAT_UBWC_NV12_4R:
|
||||
case CAM_FORMAT_UBWC_TP10:
|
||||
metadata_size = io_cfg->planes[plane_index].meta_size;
|
||||
plane_pixel_size = ((plane_stride * slice_height) + (4096 - 1)) & ~((uint32_t)4096 - 1);
|
||||
kmd_plane_size = metadata_size + plane_pixel_size;
|
||||
break;
|
||||
case CAM_FORMAT_UBWC_P010:
|
||||
case CAM_FORMAT_PLAIN32_20:
|
||||
case CAM_FORMAT_TP10:
|
||||
case CAM_FORMAT_YUV422:
|
||||
case CAM_FORMAT_PD8:
|
||||
case CAM_FORMAT_PLAIN128:
|
||||
case CAM_FORMAT_ARGB:
|
||||
case CAM_FORMAT_ARGB_10:
|
||||
case CAM_FORMAT_ARGB_12:
|
||||
case CAM_FORMAT_ARGB_14:
|
||||
case CAM_FORMAT_MIPI_RAW_16:
|
||||
case CAM_FORMAT_MIPI_RAW_20:
|
||||
case CAM_FORMAT_QTI_RAW_8:
|
||||
case CAM_FORMAT_QTI_RAW_10:
|
||||
case CAM_FORMAT_QTI_RAW_12:
|
||||
case CAM_FORMAT_QTI_RAW_14:
|
||||
case CAM_FORMAT_PLAIN8:
|
||||
case CAM_FORMAT_PLAIN8_SWAP:
|
||||
case CAM_FORMAT_PLAIN8_10:
|
||||
case CAM_FORMAT_PLAIN8_10_SWAP:
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
default:
|
||||
kmd_plane_size = plane_stride * slice_height;
|
||||
break;
|
||||
}
|
||||
if (!kmd_plane_size ||
|
||||
kmd_plane_size > (size - io_cfg->offsets[plane_index])) {
|
||||
CAM_ERR(CAM_ISP,
|
||||
"kmd size: %d umd size: %d width: %d height: %d stride: %d sliceheight: %d ",
|
||||
kmd_plane_size,
|
||||
size,
|
||||
io_cfg->planes[plane_index].width,
|
||||
io_cfg->planes[plane_index].height,
|
||||
plane_stride,
|
||||
slice_height);
|
||||
return -EINVAL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -199,135 +199,136 @@ static void ipa_eth_gsi_chan_err_cb(struct gsi_chan_err_notify *notify)
|
||||
|
||||
|
||||
static int ipa_eth_setup_rtk_gsi_channel(
|
||||
struct ipa_eth_client_pipe_info *pipe,
|
||||
struct ipa3_ep_context *ep)
|
||||
struct ipa_eth_client_pipe_info *pipe,
|
||||
struct ipa3_ep_context *ep)
|
||||
{
|
||||
struct gsi_evt_ring_props gsi_evt_ring_props;
|
||||
struct gsi_chan_props gsi_channel_props;
|
||||
union __packed gsi_channel_scratch ch_scratch;
|
||||
union __packed gsi_evt_scratch evt_scratch;
|
||||
const struct ipa_gsi_ep_config *gsi_ep_info;
|
||||
int result, len;
|
||||
int queue_number;
|
||||
u64 bar_addr;
|
||||
struct gsi_evt_ring_props gsi_evt_ring_props;
|
||||
struct gsi_chan_props gsi_channel_props;
|
||||
union __packed gsi_channel_scratch ch_scratch;
|
||||
union __packed gsi_evt_scratch evt_scratch;
|
||||
const struct ipa_gsi_ep_config *gsi_ep_info;
|
||||
int result, len;
|
||||
int queue_number;
|
||||
u64 bar_addr;
|
||||
|
||||
if (unlikely(!pipe->info.is_transfer_ring_valid)) {
|
||||
IPAERR("RTK transfer ring invalid\n");
|
||||
ipa_assert();
|
||||
return -EFAULT;
|
||||
}
|
||||
if (unlikely(!pipe->info.is_transfer_ring_valid)) {
|
||||
IPAERR("RTK transfer ring invalid\n");
|
||||
ipa_assert();
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
/* setup event ring */
|
||||
bar_addr =
|
||||
IPA_ETH_PCIE_SET(pipe->info.client_info.rtk.bar_addr);
|
||||
memset(&gsi_evt_ring_props, 0, sizeof(gsi_evt_ring_props));
|
||||
gsi_evt_ring_props.intf = GSI_EVT_CHTYPE_RTK_EV;
|
||||
gsi_evt_ring_props.intr = GSI_INTR_MSI;
|
||||
gsi_evt_ring_props.re_size = GSI_EVT_RING_RE_SIZE_16B;
|
||||
if (pipe->dir == IPA_ETH_PIPE_DIR_TX) {
|
||||
gsi_evt_ring_props.int_modt = IPA_ETH_RTK_MODT;
|
||||
gsi_evt_ring_props.int_modc = IPA_ETH_RTK_MODC;
|
||||
}
|
||||
gsi_evt_ring_props.exclusive = true;
|
||||
gsi_evt_ring_props.err_cb = ipa_eth_gsi_evt_ring_err_cb;
|
||||
gsi_evt_ring_props.user_data = NULL;
|
||||
gsi_evt_ring_props.msi_addr =
|
||||
bar_addr +
|
||||
pipe->info.client_info.rtk.dest_tail_ptr_offs;
|
||||
len = pipe->info.transfer_ring_size;
|
||||
gsi_evt_ring_props.ring_len = len;
|
||||
gsi_evt_ring_props.ring_base_addr =
|
||||
(u64)pipe->info.transfer_ring_base;
|
||||
result = gsi_alloc_evt_ring(&gsi_evt_ring_props,
|
||||
ipa3_ctx->gsi_dev_hdl,
|
||||
&ep->gsi_evt_ring_hdl);
|
||||
if (result != GSI_STATUS_SUCCESS) {
|
||||
IPAERR("fail to alloc RX event ring\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
ep->gsi_mem_info.evt_ring_len =
|
||||
gsi_evt_ring_props.ring_len;
|
||||
ep->gsi_mem_info.evt_ring_base_addr =
|
||||
gsi_evt_ring_props.ring_base_addr;
|
||||
/* setup event ring */
|
||||
bar_addr =
|
||||
IPA_ETH_PCIE_SET(pipe->info.client_info.rtk.bar_addr);
|
||||
memset(&gsi_evt_ring_props, 0, sizeof(gsi_evt_ring_props));
|
||||
gsi_evt_ring_props.intf = GSI_EVT_CHTYPE_RTK_EV;
|
||||
gsi_evt_ring_props.intr = GSI_INTR_MSI;
|
||||
gsi_evt_ring_props.re_size = GSI_EVT_RING_RE_SIZE_16B;
|
||||
if (pipe->dir == IPA_ETH_PIPE_DIR_TX) {
|
||||
gsi_evt_ring_props.int_modt = IPA_ETH_RTK_MODT;
|
||||
gsi_evt_ring_props.int_modc = IPA_ETH_RTK_MODC;
|
||||
}
|
||||
gsi_evt_ring_props.exclusive = true;
|
||||
gsi_evt_ring_props.err_cb = ipa_eth_gsi_evt_ring_err_cb;
|
||||
gsi_evt_ring_props.user_data = NULL;
|
||||
gsi_evt_ring_props.msi_addr =
|
||||
bar_addr +
|
||||
pipe->info.client_info.rtk.dest_tail_ptr_offs;
|
||||
len = pipe->info.transfer_ring_size;
|
||||
gsi_evt_ring_props.ring_len = len;
|
||||
gsi_evt_ring_props.ring_base_addr =
|
||||
(u64)pipe->info.transfer_ring_base;
|
||||
result = gsi_alloc_evt_ring(&gsi_evt_ring_props,
|
||||
ipa3_ctx->gsi_dev_hdl,
|
||||
&ep->gsi_evt_ring_hdl);
|
||||
if (result != GSI_STATUS_SUCCESS) {
|
||||
IPAERR("fail to alloc RX event ring\n");
|
||||
return -EFAULT;
|
||||
}
|
||||
ep->gsi_mem_info.evt_ring_len =
|
||||
gsi_evt_ring_props.ring_len;
|
||||
ep->gsi_mem_info.evt_ring_base_addr =
|
||||
gsi_evt_ring_props.ring_base_addr;
|
||||
|
||||
/* setup channel ring */
|
||||
memset(&gsi_channel_props, 0, sizeof(gsi_channel_props));
|
||||
gsi_channel_props.prot = GSI_CHAN_PROT_RTK;
|
||||
if (pipe->dir == IPA_ETH_PIPE_DIR_TX)
|
||||
gsi_channel_props.dir = GSI_CHAN_DIR_FROM_GSI;
|
||||
else
|
||||
gsi_channel_props.dir = GSI_CHAN_DIR_TO_GSI;
|
||||
gsi_ep_info = ipa3_get_gsi_ep_info(ep->client);
|
||||
if (!gsi_ep_info) {
|
||||
IPAERR("Failed getting GSI EP info for client=%d\n",
|
||||
ep->client);
|
||||
result = -EINVAL;
|
||||
goto fail_get_gsi_ep_info;
|
||||
} else
|
||||
gsi_channel_props.ch_id = gsi_ep_info->ipa_gsi_chan_num;
|
||||
gsi_channel_props.evt_ring_hdl = ep->gsi_evt_ring_hdl;
|
||||
gsi_channel_props.re_size = GSI_CHAN_RE_SIZE_16B;
|
||||
gsi_channel_props.use_db_eng = GSI_CHAN_DB_MODE;
|
||||
gsi_channel_props.max_prefetch = GSI_ONE_PREFETCH_SEG;
|
||||
gsi_channel_props.prefetch_mode =
|
||||
gsi_ep_info->prefetch_mode;
|
||||
gsi_channel_props.empty_lvl_threshold =
|
||||
gsi_ep_info->prefetch_threshold;
|
||||
gsi_channel_props.low_weight = 1;
|
||||
gsi_channel_props.err_cb = ipa_eth_gsi_chan_err_cb;
|
||||
gsi_channel_props.ring_len = len;
|
||||
gsi_channel_props.ring_base_addr =
|
||||
(u64)pipe->info.transfer_ring_base;
|
||||
result = gsi_alloc_channel(&gsi_channel_props, ipa3_ctx->gsi_dev_hdl,
|
||||
&ep->gsi_chan_hdl);
|
||||
if (result != GSI_STATUS_SUCCESS)
|
||||
goto fail_get_gsi_ep_info;
|
||||
ep->gsi_mem_info.chan_ring_len = gsi_channel_props.ring_len;
|
||||
ep->gsi_mem_info.chan_ring_base_addr =
|
||||
gsi_channel_props.ring_base_addr;
|
||||
/* setup channel ring */
|
||||
memset(&gsi_channel_props, 0, sizeof(gsi_channel_props));
|
||||
gsi_channel_props.prot = GSI_CHAN_PROT_RTK;
|
||||
if (pipe->dir == IPA_ETH_PIPE_DIR_TX)
|
||||
gsi_channel_props.dir = GSI_CHAN_DIR_FROM_GSI;
|
||||
else
|
||||
gsi_channel_props.dir = GSI_CHAN_DIR_TO_GSI;
|
||||
gsi_ep_info = ipa3_get_gsi_ep_info(ep->client);
|
||||
if (!gsi_ep_info) {
|
||||
IPAERR("Failed getting GSI EP info for client=%d\n",
|
||||
ep->client);
|
||||
result = -EINVAL;
|
||||
goto fail_get_gsi_ep_info;
|
||||
} else
|
||||
gsi_channel_props.ch_id = gsi_ep_info->ipa_gsi_chan_num;
|
||||
gsi_channel_props.evt_ring_hdl = ep->gsi_evt_ring_hdl;
|
||||
gsi_channel_props.re_size = GSI_CHAN_RE_SIZE_16B;
|
||||
gsi_channel_props.use_db_eng = GSI_CHAN_DB_MODE;
|
||||
gsi_channel_props.max_prefetch = GSI_ONE_PREFETCH_SEG;
|
||||
gsi_channel_props.prefetch_mode =
|
||||
gsi_ep_info->prefetch_mode;
|
||||
gsi_channel_props.empty_lvl_threshold =
|
||||
gsi_ep_info->prefetch_threshold;
|
||||
gsi_channel_props.low_weight = 1;
|
||||
gsi_channel_props.err_cb = ipa_eth_gsi_chan_err_cb;
|
||||
gsi_channel_props.ring_len = len;
|
||||
gsi_channel_props.ring_base_addr =
|
||||
(u64)pipe->info.transfer_ring_base;
|
||||
result = gsi_alloc_channel(&gsi_channel_props, ipa3_ctx->gsi_dev_hdl,
|
||||
&ep->gsi_chan_hdl);
|
||||
if (result != GSI_STATUS_SUCCESS)
|
||||
goto fail_get_gsi_ep_info;
|
||||
ep->gsi_mem_info.chan_ring_len = gsi_channel_props.ring_len;
|
||||
ep->gsi_mem_info.chan_ring_base_addr =
|
||||
gsi_channel_props.ring_base_addr;
|
||||
|
||||
/* write event scratch */
|
||||
memset(&evt_scratch, 0, sizeof(evt_scratch));
|
||||
/* nothing is needed for RTK event scratch */
|
||||
/* write event scratch */
|
||||
memset(&evt_scratch, 0, sizeof(evt_scratch));
|
||||
/* nothing is needed for RTK event scratch */
|
||||
|
||||
/* write ch scratch */
|
||||
queue_number = pipe->info.client_info.rtk.queue_number;
|
||||
memset(&ch_scratch, 0, sizeof(ch_scratch));
|
||||
ch_scratch.rtk.rtk_bar_low =
|
||||
(u32)bar_addr;
|
||||
ch_scratch.rtk.rtk_bar_high =
|
||||
(u32)((u64)(bar_addr) >> 32);
|
||||
/*
|
||||
* RX: Queue Number will be as is received from RTK
|
||||
* (Range 0 - 15).
|
||||
* TX: Queue Number will be configured to be
|
||||
* either 16 or 18.
|
||||
* (For TX Queue 0: Configure 16)
|
||||
* (For TX Queue 1: Configure 18)
|
||||
*/
|
||||
ch_scratch.rtk.queue_number =
|
||||
(pipe->dir == IPA_ETH_PIPE_DIR_RX) ?
|
||||
pipe->info.client_info.rtk.queue_number :
|
||||
(queue_number == 0) ? 16 : 18;
|
||||
ch_scratch.rtk.fix_buff_size =
|
||||
ilog2(pipe->info.fix_buffer_size);
|
||||
ch_scratch.rtk.rtk_buff_addr_low =
|
||||
(u32)pipe->info.data_buff_list[0].iova;
|
||||
ch_scratch.rtk.rtk_buff_addr_high =
|
||||
(u32)((u64)(pipe->info.data_buff_list[0].iova) >> 32);
|
||||
result = gsi_write_channel_scratch(ep->gsi_chan_hdl, ch_scratch);
|
||||
if (result != GSI_STATUS_SUCCESS) {
|
||||
IPAERR("failed to write evt ring scratch\n");
|
||||
goto fail_write_scratch;
|
||||
}
|
||||
return 0;
|
||||
|
||||
/* write ch scratch */
|
||||
queue_number = pipe->info.client_info.rtk.queue_number;
|
||||
memset(&ch_scratch, 0, sizeof(ch_scratch));
|
||||
ch_scratch.rtk.rtk_bar_low =
|
||||
(u32)bar_addr;
|
||||
ch_scratch.rtk.rtk_bar_high =
|
||||
(u32)((u64)(bar_addr) >> 32);
|
||||
/*
|
||||
* RX: Queue Number will be as is received from RTK
|
||||
* (Range 0 - 15).
|
||||
* TX: Queue Number will be configured to be
|
||||
* either 16 or 18.
|
||||
* (For TX Queue 0: Configure 16)
|
||||
* (For TX Queue 1: Configure 18)
|
||||
*/
|
||||
ch_scratch.rtk.queue_number =
|
||||
(pipe->dir == IPA_ETH_PIPE_DIR_RX) ?
|
||||
pipe->info.client_info.rtk.queue_number :
|
||||
(queue_number == 0) ? 16 : 18;
|
||||
ch_scratch.rtk.fix_buff_size =
|
||||
ilog2(pipe->info.fix_buffer_size);
|
||||
ch_scratch.rtk.rtk_buff_addr_low =
|
||||
(u32)pipe->info.data_buff_list[0].iova;
|
||||
ch_scratch.rtk.rtk_buff_addr_high =
|
||||
(u32)((u64)(pipe->info.data_buff_list[0].iova) >> 32);
|
||||
result = gsi_write_channel_scratch(ep->gsi_chan_hdl, ch_scratch);
|
||||
if (result != GSI_STATUS_SUCCESS) {
|
||||
IPAERR("failed to write evt ring scratch\n");
|
||||
goto fail_write_scratch;
|
||||
}
|
||||
return 0;
|
||||
fail_write_scratch:
|
||||
gsi_dealloc_channel(ep->gsi_chan_hdl);
|
||||
ep->gsi_chan_hdl = ~0;
|
||||
gsi_dealloc_channel(ep->gsi_chan_hdl);
|
||||
ep->gsi_chan_hdl = ~0;
|
||||
fail_get_gsi_ep_info:
|
||||
gsi_dealloc_evt_ring(ep->gsi_evt_ring_hdl);
|
||||
ep->gsi_evt_ring_hdl = ~0;
|
||||
return result;
|
||||
gsi_dealloc_evt_ring(ep->gsi_evt_ring_hdl);
|
||||
ep->gsi_evt_ring_hdl = ~0;
|
||||
return result;
|
||||
}
|
||||
|
||||
static int ipa3_smmu_map_rtk_pipes(struct ipa_eth_client_pipe_info *pipe,
|
||||
|
||||
@@ -1146,54 +1146,54 @@ static bool usb_bam_resume_core(enum usb_ctrl bam_type,
|
||||
* Return: 0 in case of success, errno otherwise.
|
||||
*/
|
||||
static int usb_bam_disconnect_ipa_prod(
|
||||
struct usb_bam_connect_ipa_params *ipa_params,
|
||||
enum usb_ctrl cur_bam)
|
||||
struct usb_bam_connect_ipa_params *ipa_params,
|
||||
enum usb_ctrl cur_bam)
|
||||
{
|
||||
int ret;
|
||||
u8 idx = 0;
|
||||
struct usb_bam_pipe_connect *pipe_connect;
|
||||
struct usb_bam_ctx_type *ctx = &msm_usb_bam[cur_bam];
|
||||
int ret;
|
||||
u8 idx = 0;
|
||||
struct usb_bam_pipe_connect *pipe_connect;
|
||||
struct usb_bam_ctx_type *ctx = &msm_usb_bam[cur_bam];
|
||||
|
||||
idx = ipa_params->dst_idx;
|
||||
pipe_connect = &ctx->usb_bam_connections[idx];
|
||||
pipe_connect->activity_notify = NULL;
|
||||
pipe_connect->inactivity_notify = NULL;
|
||||
pipe_connect->priv = NULL;
|
||||
idx = ipa_params->dst_idx;
|
||||
pipe_connect = &ctx->usb_bam_connections[idx];
|
||||
pipe_connect->activity_notify = NULL;
|
||||
pipe_connect->inactivity_notify = NULL;
|
||||
pipe_connect->priv = NULL;
|
||||
|
||||
/* close IPA -> USB pipe */
|
||||
if (pipe_connect->pipe_type == USB_BAM_PIPE_BAM2BAM) {
|
||||
ret = ipa_disconnect(ipa_params->prod_clnt_hdl);
|
||||
if (ret) {
|
||||
log_event_err("%s: dst pipe disconnection failure\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
/* close IPA -> USB pipe */
|
||||
if (pipe_connect->pipe_type == USB_BAM_PIPE_BAM2BAM) {
|
||||
ret = ipa_disconnect(ipa_params->prod_clnt_hdl);
|
||||
if (ret) {
|
||||
log_event_err("%s: dst pipe disconnection failure\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = usb_bam_disconnect_pipe(cur_bam, idx);
|
||||
if (ret) {
|
||||
log_event_err("%s: failure to disconnect pipe %d\n",
|
||||
__func__, idx);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
ret = ipa_teardown_sys_pipe(ipa_params->prod_clnt_hdl);
|
||||
if (ret) {
|
||||
log_event_err("%s: dst pipe disconnection failure\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
ret = usb_bam_disconnect_pipe(cur_bam, idx);
|
||||
if (ret) {
|
||||
log_event_err("%s: failure to disconnect pipe %d\n",
|
||||
__func__, idx);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
ret = ipa_teardown_sys_pipe(ipa_params->prod_clnt_hdl);
|
||||
if (ret) {
|
||||
log_event_err("%s: dst pipe disconnection failure\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pipe_connect->enabled = false;
|
||||
spin_lock(&ctx->usb_bam_lock);
|
||||
if (ctx->pipes_enabled_per_bam == 0)
|
||||
log_event_err("%s: wrong pipes enabled counter for bam=%d\n",
|
||||
__func__, pipe_connect->bam_type);
|
||||
else
|
||||
ctx->pipes_enabled_per_bam -= 1;
|
||||
spin_unlock(&ctx->usb_bam_lock);
|
||||
}
|
||||
pipe_connect->enabled = false;
|
||||
spin_lock(&ctx->usb_bam_lock);
|
||||
if (ctx->pipes_enabled_per_bam == 0)
|
||||
log_event_err("%s: wrong pipes enabled counter for bam=%d\n",
|
||||
__func__, pipe_connect->bam_type);
|
||||
else
|
||||
ctx->pipes_enabled_per_bam -= 1;
|
||||
spin_unlock(&ctx->usb_bam_lock);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1208,117 +1208,117 @@ static int usb_bam_disconnect_ipa_prod(
|
||||
* Return: 0 in case of success, errno otherwise.
|
||||
*/
|
||||
static int usb_bam_disconnect_ipa_cons(
|
||||
struct usb_bam_connect_ipa_params *ipa_params,
|
||||
enum usb_ctrl cur_bam)
|
||||
struct usb_bam_connect_ipa_params *ipa_params,
|
||||
enum usb_ctrl cur_bam)
|
||||
{
|
||||
int ret;
|
||||
u8 idx = 0;
|
||||
struct usb_bam_ctx_type *ctx = &msm_usb_bam[cur_bam];
|
||||
struct usb_bam_pipe_connect *pipe_connect;
|
||||
struct sps_pipe *pipe;
|
||||
u32 timeout = 10, pipe_empty;
|
||||
struct usb_bam_sps_type usb_bam_sps = ctx->usb_bam_sps;
|
||||
struct sps_connect *sps_connection;
|
||||
bool inject_zlt = true;
|
||||
int ret;
|
||||
u8 idx = 0;
|
||||
struct usb_bam_ctx_type *ctx = &msm_usb_bam[cur_bam];
|
||||
struct usb_bam_pipe_connect *pipe_connect;
|
||||
struct sps_pipe *pipe;
|
||||
u32 timeout = 10, pipe_empty;
|
||||
struct usb_bam_sps_type usb_bam_sps = ctx->usb_bam_sps;
|
||||
struct sps_connect *sps_connection;
|
||||
bool inject_zlt = true;
|
||||
|
||||
idx = ipa_params->src_idx;
|
||||
pipe = ctx->usb_bam_sps.sps_pipes[idx];
|
||||
pipe_connect = &ctx->usb_bam_connections[idx];
|
||||
sps_connection = &usb_bam_sps.sps_connections[idx];
|
||||
idx = ipa_params->src_idx;
|
||||
pipe = ctx->usb_bam_sps.sps_pipes[idx];
|
||||
pipe_connect = &ctx->usb_bam_connections[idx];
|
||||
sps_connection = &usb_bam_sps.sps_connections[idx];
|
||||
|
||||
pipe_connect->activity_notify = NULL;
|
||||
pipe_connect->inactivity_notify = NULL;
|
||||
pipe_connect->priv = NULL;
|
||||
pipe_connect->activity_notify = NULL;
|
||||
pipe_connect->inactivity_notify = NULL;
|
||||
pipe_connect->priv = NULL;
|
||||
|
||||
/*
|
||||
* On some platforms, there is a chance that flow control
|
||||
* is disabled from IPA side, due to this IPA core may not
|
||||
* consume data from USB. Hence notify IPA to enable flow
|
||||
* control and then check sps pipe is empty or not before
|
||||
* processing USB->IPA pipes disconnect.
|
||||
*/
|
||||
ipa_clear_endpoint_delay(ipa_params->cons_clnt_hdl);
|
||||
/*
|
||||
* On some platforms, there is a chance that flow control
|
||||
* is disabled from IPA side, due to this IPA core may not
|
||||
* consume data from USB. Hence notify IPA to enable flow
|
||||
* control and then check sps pipe is empty or not before
|
||||
* processing USB->IPA pipes disconnect.
|
||||
*/
|
||||
ipa_clear_endpoint_delay(ipa_params->cons_clnt_hdl);
|
||||
retry:
|
||||
/* Make sure pipe is empty before disconnecting it */
|
||||
while (1) {
|
||||
ret = sps_is_pipe_empty(pipe, &pipe_empty);
|
||||
if (ret) {
|
||||
log_event_err("%s: sps_is_pipe_empty failed with %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
if (pipe_empty || !--timeout)
|
||||
break;
|
||||
/* Make sure pipe is empty before disconnecting it */
|
||||
while (1) {
|
||||
ret = sps_is_pipe_empty(pipe, &pipe_empty);
|
||||
if (ret) {
|
||||
log_event_err("%s: sps_is_pipe_empty failed with %d\n",
|
||||
__func__, ret);
|
||||
return ret;
|
||||
}
|
||||
if (pipe_empty || !--timeout)
|
||||
break;
|
||||
|
||||
/* Check again */
|
||||
usleep_range(1000, 2000);
|
||||
}
|
||||
/* Check again */
|
||||
usleep_range(1000, 2000);
|
||||
}
|
||||
|
||||
if (!pipe_empty) {
|
||||
if (inject_zlt) {
|
||||
pr_debug("%s: Inject ZLT\n", __func__);
|
||||
log_event_dbg("%s: Inject ZLT\n", __func__);
|
||||
inject_zlt = false;
|
||||
sps_pipe_inject_zlt(sps_connection->destination,
|
||||
sps_connection->dest_pipe_index);
|
||||
timeout = 10;
|
||||
goto retry;
|
||||
}
|
||||
log_event_err("%s: src pipe(USB) not empty, wait timed out!\n",
|
||||
__func__);
|
||||
sps_get_bam_debug_info(ctx->h_bam, 93,
|
||||
(SPS_BAM_PIPE(0) | SPS_BAM_PIPE(1)), 0, 2);
|
||||
ipa_bam_reg_dump();
|
||||
panic("%s:SPS pipe not empty for USB->IPA\n", __func__);
|
||||
}
|
||||
if (!pipe_empty) {
|
||||
if (inject_zlt) {
|
||||
pr_debug("%s: Inject ZLT\n", __func__);
|
||||
log_event_dbg("%s: Inject ZLT\n", __func__);
|
||||
inject_zlt = false;
|
||||
sps_pipe_inject_zlt(sps_connection->destination,
|
||||
sps_connection->dest_pipe_index);
|
||||
timeout = 10;
|
||||
goto retry;
|
||||
}
|
||||
log_event_err("%s: src pipe(USB) not empty, wait timed out!\n",
|
||||
__func__);
|
||||
sps_get_bam_debug_info(ctx->h_bam, 93,
|
||||
(SPS_BAM_PIPE(0) | SPS_BAM_PIPE(1)), 0, 2);
|
||||
ipa_bam_reg_dump();
|
||||
panic("%s:SPS pipe not empty for USB->IPA\n", __func__);
|
||||
}
|
||||
|
||||
/* Do the release handshake with the IPA via RM */
|
||||
spin_lock(&usb_bam_ipa_handshake_info_lock);
|
||||
info[cur_bam].connect_complete = 0;
|
||||
info[cur_bam].disconnected = 1;
|
||||
spin_unlock(&usb_bam_ipa_handshake_info_lock);
|
||||
/* Do the release handshake with the IPA via RM */
|
||||
spin_lock(&usb_bam_ipa_handshake_info_lock);
|
||||
info[cur_bam].connect_complete = 0;
|
||||
info[cur_bam].disconnected = 1;
|
||||
spin_unlock(&usb_bam_ipa_handshake_info_lock);
|
||||
|
||||
/* Start release handshake on the last USB BAM producer pipe */
|
||||
if (info[cur_bam].prod_pipes_enabled_per_bam == 1)
|
||||
wait_for_prod_release(cur_bam);
|
||||
/* Start release handshake on the last USB BAM producer pipe */
|
||||
if (info[cur_bam].prod_pipes_enabled_per_bam == 1)
|
||||
wait_for_prod_release(cur_bam);
|
||||
|
||||
/* close USB -> IPA pipe */
|
||||
if (pipe_connect->pipe_type == USB_BAM_PIPE_BAM2BAM) {
|
||||
ret = ipa_disconnect(ipa_params->cons_clnt_hdl);
|
||||
if (ret) {
|
||||
log_event_err("%s: src pipe disconnection failure\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
/* close USB -> IPA pipe */
|
||||
if (pipe_connect->pipe_type == USB_BAM_PIPE_BAM2BAM) {
|
||||
ret = ipa_disconnect(ipa_params->cons_clnt_hdl);
|
||||
if (ret) {
|
||||
log_event_err("%s: src pipe disconnection failure\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = usb_bam_disconnect_pipe(cur_bam, idx);
|
||||
if (ret) {
|
||||
log_event_err("%s: failure to disconnect pipe %d\n",
|
||||
__func__, idx);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
ret = ipa_teardown_sys_pipe(ipa_params->cons_clnt_hdl);
|
||||
if (ret) {
|
||||
log_event_err("%s: src pipe disconnection failure\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
ret = usb_bam_disconnect_pipe(cur_bam, idx);
|
||||
if (ret) {
|
||||
log_event_err("%s: failure to disconnect pipe %d\n",
|
||||
__func__, idx);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
ret = ipa_teardown_sys_pipe(ipa_params->cons_clnt_hdl);
|
||||
if (ret) {
|
||||
log_event_err("%s: src pipe disconnection failure\n",
|
||||
__func__);
|
||||
return ret;
|
||||
}
|
||||
|
||||
pipe_connect->enabled = false;
|
||||
spin_lock(&ctx->usb_bam_lock);
|
||||
if (ctx->pipes_enabled_per_bam == 0)
|
||||
log_event_err("%s: wrong pipes enabled counter for bam=%d\n",
|
||||
__func__, pipe_connect->bam_type);
|
||||
else
|
||||
ctx->pipes_enabled_per_bam -= 1;
|
||||
spin_unlock(&ctx->usb_bam_lock);
|
||||
}
|
||||
pipe_connect->enabled = false;
|
||||
spin_lock(&ctx->usb_bam_lock);
|
||||
if (ctx->pipes_enabled_per_bam == 0)
|
||||
log_event_err("%s: wrong pipes enabled counter for bam=%d\n",
|
||||
__func__, pipe_connect->bam_type);
|
||||
else
|
||||
ctx->pipes_enabled_per_bam -= 1;
|
||||
spin_unlock(&ctx->usb_bam_lock);
|
||||
}
|
||||
|
||||
pipe_connect->ipa_clnt_hdl = -1;
|
||||
info[cur_bam].prod_pipes_enabled_per_bam -= 1;
|
||||
pipe_connect->ipa_clnt_hdl = -1;
|
||||
info[cur_bam].prod_pipes_enabled_per_bam -= 1;
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void _msm_bam_wait_for_host_prod_granted(enum usb_ctrl bam_type)
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
ccflags-y += -O3
|
||||
|
||||
ccflags-y += -I$(src) # needed for trace events
|
||||
|
||||
obj-y += ion/
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
obj-$(CONFIG_ION) += ion.o ion_heap.o \
|
||||
ion_page_pool.o ion_system_heap.o \
|
||||
ion_carveout_heap.o ion_chunk_heap.o \
|
||||
|
||||
@@ -2301,6 +2301,7 @@ OBJS += $(TXRX3.0_OBJS)
|
||||
endif
|
||||
|
||||
ccflags-y += $(INCS)
|
||||
ldflags-y += -Wl --lto-O0
|
||||
|
||||
# LTO does way too much here
|
||||
ccflags-y += $(DISABLE_LTO)
|
||||
|
||||
@@ -628,14 +628,15 @@ EXPORT_SYMBOL(fscrypt_has_permitted_context);
|
||||
|
||||
static int fscrypt_update_context(union fscrypt_context *ctx)
|
||||
{
|
||||
char *boot = "ufs";
|
||||
char *boot = "ufs";
|
||||
|
||||
if (!fscrypt_find_storage_type(&boot)) {
|
||||
if (!strcmp(boot, SDHCI))
|
||||
ctx->v1.flags |= FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32;
|
||||
return 0;
|
||||
}
|
||||
return -EINVAL;
|
||||
if (!fscrypt_find_storage_type(&boot)) {
|
||||
if (!strcmp(boot, SDHCI)) {
|
||||
ctx->v1.flags |= FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-$(CONFIG_EROFS_FS) += erofs.o
|
||||
erofs-objs := super.o inode.o data.o namei.o dir.o utils.o pcpubuf.o
|
||||
erofs-$(CONFIG_EROFS_FS_XATTR) += xattr.o
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-$(CONFIG_F2FS_FS) += f2fs.o
|
||||
|
||||
f2fs-y := dir.o file.o inode.o namei.o hash.o super.o inline.o
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
# Makefile for the FUSE filesystem.
|
||||
#
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-$(CONFIG_FUSE_FS) += fuse.o
|
||||
obj-$(CONFIG_CUSE) += cuse.o
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
#
|
||||
|
||||
ccflags-y := -fno-function-sections -fno-data-sections
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-y := main.o version.o mounts.o
|
||||
obj-y += noinitramfs.o
|
||||
|
||||
@@ -34,15 +34,10 @@ CFLAGS_kcov.o := $(call cc-option, -fno-conserve-stack -fno-stack-protector)
|
||||
|
||||
# cond_syscall is currently not LTO compatible
|
||||
CFLAGS_sys_ni.o = $(DISABLE_LTO)
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
# Don't instrument error handlers
|
||||
CFLAGS_cfi.o = $(DISABLE_CFI_CLANG)
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-y += sched/
|
||||
obj-y += locking/
|
||||
obj-y += power/
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
obj-y := cgroup.o namespace.o cgroup-v1.o freezer.o
|
||||
|
||||
obj-$(CONFIG_CGROUP_FREEZER) += legacy_freezer.o
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-y := irqdesc.o handle.o manage.o spurious.o resend.o chip.o dummychip.o devres.o
|
||||
obj-$(CONFIG_IRQ_TIMINGS) += timings.o
|
||||
obj-$(CONFIG_GENERIC_IRQ_CHIP) += generic-chip.o
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
# and is generally not a function of system call inputs.
|
||||
KCOV_INSTRUMENT := n
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-y += update.o sync.o
|
||||
obj-$(CONFIG_TREE_SRCU) += srcutree.o
|
||||
obj-$(CONFIG_TINY_SRCU) += srcutiny.o
|
||||
|
||||
@@ -16,9 +16,6 @@ ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
|
||||
CFLAGS_core.o := $(PROFILING) -fno-omit-frame-pointer
|
||||
endif
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-y += core.o loadavg.o clock.o cputime.o
|
||||
obj-y += idle_task.o fair.o rt.o deadline.o
|
||||
obj-y += wait.o wait_bit.o swait.o completion.o idle.o
|
||||
|
||||
@@ -33,9 +33,6 @@ endif
|
||||
CFLAGS_string.o += $(call cc-option, -fno-stack-protector)
|
||||
endif
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
lib-y := ctype.o string.o vsprintf.o cmdline.o \
|
||||
rbtree.o radix-tree.o dump_stack.o timerqueue.o\
|
||||
idr.o int_sqrt.o extable.o \
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
ccflags-y += -O3
|
||||
|
||||
obj-$(CONFIG_LZ4_COMPRESS) += lz4_compress.o
|
||||
obj-$(CONFIG_LZ4HC_COMPRESS) += lz4hc_compress.o
|
||||
|
||||
@@ -21,9 +21,6 @@ KCOV_INSTRUMENT_memcontrol.o := n
|
||||
KCOV_INSTRUMENT_mmzone.o := n
|
||||
KCOV_INSTRUMENT_vmstat.o := n
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
mmu-y := nommu.o
|
||||
mmu-$(CONFIG_MMU) := gup.o memory.o mincore.o \
|
||||
mlock.o mmap.o mprotect.o mremap.o msync.o mmu_gather.o \
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
# Rewritten to use lists instead of if-statements.
|
||||
#
|
||||
|
||||
ccflags-y += -mllvm -inline-threshold=15000
|
||||
ccflags-y += -mllvm -inlinehint-threshold=10000
|
||||
|
||||
obj-$(CONFIG_NET) := socket.o core/
|
||||
|
||||
tmp-$(CONFIG_COMPAT) := compat.o
|
||||
|
||||
Reference in New Issue
Block a user