Skip to content

Commit

Permalink
Merge pull request #1 from CyanogenMod/cm-14.1
Browse files Browse the repository at this point in the history
up
  • Loading branch information
Rolando-D authored Dec 6, 2016
2 parents 373b1d5 + 3c331ce commit 1e85184
Show file tree
Hide file tree
Showing 78 changed files with 1,310 additions and 423 deletions.
2 changes: 1 addition & 1 deletion arch/arm/configs/surnia_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3158,7 +3158,7 @@ CONFIG_PRIMA_WLAN_11AC_HIGH_TP=y
CONFIG_WLAN_FEATURE_11W=y
CONFIG_QCOM_TDLS=y
CONFIG_QCOM_VOWIFI_11R=y
# CONFIG_ENABLE_LINUX_REG is not set
CONFIG_ENABLE_LINUX_REG=y

#
# Qualcomm MSM specific device drivers
Expand Down
16 changes: 16 additions & 0 deletions drivers/clk/qcom/clock-gcc-8936.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ static void __iomem *virt_dbgbase;
#define BIMC_GFX_CBCR 0x31024
#define BIMC_GPU_CBCR 0x31040
#define GCC_SPARE3_REG 0x7E004
#define SNOC_QOSGEN 0x2601C

#define APCS_CCI_PLL_MODE 0x00000
#define APCS_CCI_PLL_L_VAL 0x00004
Expand Down Expand Up @@ -2986,6 +2987,18 @@ static struct pll_config_regs gpll4_regs = {
.base = &virt_bases[GCC_BASE],
};

static struct gate_clk gcc_snoc_qosgen_clk = {
.en_mask = BIT(0),
.en_reg = SNOC_QOSGEN,
.base = &virt_bases[GCC_BASE],
.c = {
.dbg_name = "gcc_snoc_qosgen_clk",
.ops = &clk_ops_gate,
.flags = CLKFLAG_SKIP_HANDOFF,
CLK_INIT(gcc_snoc_qosgen_clk.c),
},
};

static struct mux_clk gcc_debug_mux;
static struct clk_ops clk_ops_debug_mux;

Expand Down Expand Up @@ -3324,6 +3337,9 @@ static struct clk_lookup msm_clocks_lookup[] = {
CLK_LIST(gcc_crypto_ahb_clk),
CLK_LIST(gcc_crypto_axi_clk),
CLK_LIST(crypto_clk_src),

/* QoS Reference clock */
CLK_LIST(gcc_snoc_qosgen_clk),
};

static struct clk_lookup msm_clocks_lookup_v1[] = {
Expand Down
10 changes: 7 additions & 3 deletions drivers/input/touchscreen/synaptics_fw_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/

#include <linux/ctype.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
Expand Down Expand Up @@ -693,7 +693,6 @@ static int fwu_wait_for_idle(int timeout_ms)
static enum flash_area fwu_go_nogo(void)
{
int retval = 0;
int index = 0;
int deviceFirmwareID;
int imageConfigID;
int deviceConfigID;
Expand Down Expand Up @@ -798,6 +797,8 @@ static enum flash_area fwu_go_nogo(void)
__func__);
imageFirmwareID = img->firmware_id;
} else {
size_t index, max_index;

if (!fwu->image_name) {
dev_info(&i2c_client->dev,
"%s: Unknown image file name\n",
Expand All @@ -814,8 +815,11 @@ static enum flash_area fwu_go_nogo(void)
goto exit;
}

max_index = min((ptrdiff_t)(MAX_FIRMWARE_ID_LEN - 1),
&fwu->image_name[NAME_BUFFER_SIZE] - strptr);
index = 0;
strptr += 2;
while (strptr[index] >= '0' && strptr[index] <= '9') {
while (index < max_index && isdigit(strptr[index])) {
imagePR[index] = strptr[index];
index++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ static void msm_actuator_parse_i2c_params(struct msm_actuator_ctrl_t *a_ctrl,
struct msm_camera_i2c_reg_array *i2c_tbl = a_ctrl->i2c_reg_tbl;
CDBG("Enter\n");
for (i = 0; i < size; i++) {
/* check that the index into i2c_tbl cannot grow larger that
the allocated size of i2c_tbl */
if ((a_ctrl->total_steps + 1) < (a_ctrl->i2c_tbl_index)) {
break;
}
if (write_arr[i].reg_write_type == MSM_ACTUATOR_WRITE_DAC) {
value = (next_lens_position <<
write_arr[i].data_shift) |
Expand All @@ -108,6 +103,11 @@ static void msm_actuator_parse_i2c_params(struct msm_actuator_ctrl_t *a_ctrl,
i2c_byte2 = value & 0xFF;
CDBG("byte1:0x%x, byte2:0x%x\n",
i2c_byte1, i2c_byte2);
if (a_ctrl->i2c_tbl_index >
a_ctrl->total_steps) {
pr_err("failed:i2c table index out of bound\n");
break;
}
i2c_tbl[a_ctrl->i2c_tbl_index].
reg_addr = i2c_byte1;
i2c_tbl[a_ctrl->i2c_tbl_index].
Expand All @@ -128,6 +128,10 @@ static void msm_actuator_parse_i2c_params(struct msm_actuator_ctrl_t *a_ctrl,
i2c_byte2 = (hw_dword & write_arr[i].hw_mask) >>
write_arr[i].hw_shift;
}
if (a_ctrl->i2c_tbl_index > a_ctrl->total_steps) {
pr_err("failed: i2c table index out of bound\n");
break;
}
CDBG("i2c_byte1:0x%x, i2c_byte2:0x%x\n", i2c_byte1, i2c_byte2);
i2c_tbl[a_ctrl->i2c_tbl_index].reg_addr = i2c_byte1;
i2c_tbl[a_ctrl->i2c_tbl_index].reg_data = i2c_byte2;
Expand Down
22 changes: 21 additions & 1 deletion drivers/misc/qcom/qdsp6v2/audio_utils_aio.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Copyright (C) 2008 Google, Inc.
* Copyright (C) 2008 HTC Corporation
* Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
* Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
Expand Down Expand Up @@ -570,6 +570,8 @@ int audio_aio_release(struct inode *inode, struct file *file)
struct q6audio_aio *audio = file->private_data;
pr_debug("%s[%p]\n", __func__, audio);
mutex_lock(&audio->lock);
mutex_lock(&audio->read_lock);
mutex_lock(&audio->write_lock);
audio->wflush = 1;
if (audio->enabled)
audio_aio_flush(audio);
Expand All @@ -584,6 +586,8 @@ int audio_aio_release(struct inode *inode, struct file *file)
wake_up(&audio->event_wait);
audio_aio_reset_event_queue(audio);
q6asm_audio_client_free(audio->ac);
mutex_unlock(&audio->write_lock);
mutex_unlock(&audio->read_lock);
mutex_unlock(&audio->lock);
mutex_destroy(&audio->lock);
mutex_destroy(&audio->read_lock);
Expand Down Expand Up @@ -1681,7 +1685,11 @@ static long audio_aio_ioctl(struct file *file, unsigned int cmd,
__func__);
rc = -EFAULT;
} else {
mutex_lock(&audio->read_lock);
mutex_lock(&audio->write_lock);
rc = audio_aio_ion_add(audio, &info);
mutex_unlock(&audio->write_lock);
mutex_unlock(&audio->read_lock);
}
mutex_unlock(&audio->lock);
break;
Expand All @@ -1696,7 +1704,11 @@ static long audio_aio_ioctl(struct file *file, unsigned int cmd,
__func__);
rc = -EFAULT;
} else {
mutex_lock(&audio->read_lock);
mutex_lock(&audio->write_lock);
rc = audio_aio_ion_remove(audio, &info);
mutex_unlock(&audio->write_lock);
mutex_unlock(&audio->read_lock);
}
mutex_unlock(&audio->lock);
break;
Expand Down Expand Up @@ -1998,7 +2010,11 @@ static long audio_aio_compat_ioctl(struct file *file, unsigned int cmd,
} else {
info.fd = info_32.fd;
info.vaddr = compat_ptr(info_32.vaddr);
mutex_lock(&audio->read_lock);
mutex_lock(&audio->write_lock);
rc = audio_aio_ion_add(audio, &info);
mutex_unlock(&audio->write_lock);
mutex_unlock(&audio->read_lock);
}
mutex_unlock(&audio->lock);
break;
Expand All @@ -2015,7 +2031,11 @@ static long audio_aio_compat_ioctl(struct file *file, unsigned int cmd,
} else {
info.fd = info_32.fd;
info.vaddr = compat_ptr(info_32.vaddr);
mutex_lock(&audio->read_lock);
mutex_lock(&audio->write_lock);
rc = audio_aio_ion_remove(audio, &info);
mutex_unlock(&audio->write_lock);
mutex_unlock(&audio->read_lock);
}
mutex_unlock(&audio->lock);
break;
Expand Down
36 changes: 18 additions & 18 deletions drivers/staging/android/binder.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ static void binder_insert_free_buffer(struct binder_proc *proc,
new_buffer_size = binder_buffer_size(proc, new_buffer);

binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: add free buffer, size %zd, at %p\n",
"%d: add free buffer, size %zd, at %pK\n",
proc->pid, new_buffer_size, new_buffer);

while (*p) {
Expand Down Expand Up @@ -612,7 +612,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate,
struct mm_struct *mm;

binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: %s pages %p-%p\n", proc->pid,
"%d: %s pages %pK-%pK\n", proc->pid,
allocate ? "allocate" : "free", start, end);

if (end <= start)
Expand Down Expand Up @@ -654,7 +654,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate,
BUG_ON(*page);
*page = alloc_page(GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO);
if (*page == NULL) {
pr_err("%d: binder_alloc_buf failed for page at %p\n",
pr_err("%d: binder_alloc_buf failed for page at %pK\n",
proc->pid, page_addr);
goto err_alloc_page_failed;
}
Expand All @@ -663,7 +663,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate,
page_array_ptr = page;
ret = map_vm_area(&tmp_area, PAGE_KERNEL, &page_array_ptr);
if (ret) {
pr_err("%d: binder_alloc_buf failed to map page at %p in kernel\n",
pr_err("%d: binder_alloc_buf failed to map page at %pK in kernel\n",
proc->pid, page_addr);
goto err_map_kernel_failed;
}
Expand Down Expand Up @@ -769,7 +769,7 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
}

binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: binder_alloc_buf size %zd got buffer %p size %zd\n",
"%d: binder_alloc_buf size %zd got buffer %pK size %zd\n",
proc->pid, size, buffer, buffer_size);

has_page_addr =
Expand Down Expand Up @@ -798,7 +798,7 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
binder_insert_free_buffer(proc, new_buffer);
}
binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: binder_alloc_buf size %zd got %p\n",
"%d: binder_alloc_buf size %zd got %pK\n",
proc->pid, size, buffer);
buffer->data_size = data_size;
buffer->offsets_size = offsets_size;
Expand Down Expand Up @@ -838,7 +838,7 @@ static void binder_delete_free_buffer(struct binder_proc *proc,
if (buffer_end_page(prev) == buffer_end_page(buffer))
free_page_end = 0;
binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: merge free, buffer %p share page with %p\n",
"%d: merge free, buffer %pK share page with %pK\n",
proc->pid, buffer, prev);
}

Expand All @@ -851,14 +851,14 @@ static void binder_delete_free_buffer(struct binder_proc *proc,
buffer_start_page(buffer))
free_page_start = 0;
binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: merge free, buffer %p share page with %p\n",
"%d: merge free, buffer %pK share page with %pK\n",
proc->pid, buffer, prev);
}
}
list_del(&buffer->entry);
if (free_page_start || free_page_end) {
binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: merge free, buffer %p do not share page%s%s with %p or %p\n",
"%d: merge free, buffer %pK do not share page%s%s with %pK or %pK\n",
proc->pid, buffer, free_page_start ? "" : " end",
free_page_end ? "" : " start", prev, next);
binder_update_page_range(proc, 0, free_page_start ?
Expand All @@ -879,7 +879,7 @@ static void binder_free_buf(struct binder_proc *proc,
ALIGN(buffer->offsets_size, sizeof(void *));

binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%d: binder_free_buf %p size %zd buffer_size %zd\n",
"%d: binder_free_buf %pK size %zd buffer_size %zd\n",
proc->pid, buffer, size, buffer_size);

BUG_ON(buffer->free);
Expand Down Expand Up @@ -1306,7 +1306,7 @@ static void binder_transaction_buffer_release(struct binder_proc *proc,
int debug_id = buffer->debug_id;

binder_debug(BINDER_DEBUG_TRANSACTION,
"%d buffer release %d, size %zd-%zd, failed at %p\n",
"%d buffer release %d, size %zd-%zd, failed at %pK\n",
proc->pid, buffer->debug_id,
buffer->data_size, buffer->offsets_size, failed_at);

Expand Down Expand Up @@ -2154,7 +2154,7 @@ static int binder_thread_write(struct binder_proc *proc,
}
}
binder_debug(BINDER_DEBUG_DEAD_BINDER,
"%d:%d BC_DEAD_BINDER_DONE %016llx found %p\n",
"%d:%d BC_DEAD_BINDER_DONE %016llx found %pK\n",
proc->pid, thread->pid, (u64)cookie, death);
if (death == NULL) {
binder_user_error("%d:%d BC_DEAD_BINDER_DONE %016llx not found\n",
Expand Down Expand Up @@ -2952,7 +2952,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
#ifdef CONFIG_CPU_CACHE_VIPT
if (cache_is_vipt_aliasing()) {
while (CACHE_COLOUR((vma->vm_start ^ (uint32_t)proc->buffer))) {
pr_info("binder_mmap: %d %lx-%lx maps %p bad alignment\n", proc->pid, vma->vm_start, vma->vm_end, proc->buffer);
pr_info("binder_mmap: %d %lx-%lx maps %pK bad alignment\n", proc->pid, vma->vm_start, vma->vm_end, proc->buffer);
vma->vm_start += PAGE_SIZE;
}
}
Expand Down Expand Up @@ -2988,7 +2988,7 @@ static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
proc->vma = vma;
proc->vma_vm_mm = vma->vm_mm;

/*pr_info("binder_mmap: %d %lx-%lx maps %p\n",
/*pr_info("binder_mmap: %d %lx-%lx maps %pK\n",
proc->pid, vma->vm_start, vma->vm_end, proc->buffer);*/
return 0;

Expand Down Expand Up @@ -3210,7 +3210,7 @@ static void binder_deferred_release(struct binder_proc *proc)

page_addr = proc->buffer + i * PAGE_SIZE;
binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
"%s: %d: page %d at %p not freed\n",
"%s: %d: page %d at %pK not freed\n",
__func__, proc->pid, i, page_addr);
unmap_kernel_range((unsigned long)page_addr, PAGE_SIZE);
__free_page(proc->pages[i]);
Expand Down Expand Up @@ -3294,7 +3294,7 @@ static void print_binder_transaction(struct seq_file *m, const char *prefix,
struct binder_transaction *t)
{
seq_printf(m,
"%s %d: %p from %d:%d to %d:%d code %x flags %x pri %ld r%d",
"%s %d: %pK from %d:%d to %d:%d code %x flags %x pri %ld r%d",
prefix, t->debug_id, t,
t->from ? t->from->proc->pid : 0,
t->from ? t->from->pid : 0,
Expand All @@ -3308,15 +3308,15 @@ static void print_binder_transaction(struct seq_file *m, const char *prefix,
if (t->buffer->target_node)
seq_printf(m, " node %d",
t->buffer->target_node->debug_id);
seq_printf(m, " size %zd:%zd data %p\n",
seq_printf(m, " size %zd:%zd data %pK\n",
t->buffer->data_size, t->buffer->offsets_size,
t->buffer->data);
}

static void print_binder_buffer(struct seq_file *m, const char *prefix,
struct binder_buffer *buffer)
{
seq_printf(m, "%s %d: %p size %zd:%zd %s\n",
seq_printf(m, "%s %d: %pK size %zd:%zd %s\n",
prefix, buffer->debug_id, buffer->data,
buffer->data_size, buffer->offsets_size,
buffer->transaction ? "active" : "delivered");
Expand Down
Loading

0 comments on commit 1e85184

Please sign in to comment.