Merge tag 'LA.BR.1.3.6-04010-8976.0' of https://source.codeaurora.org/quic/la/kernel/msm-3.10 into HEAD
"LA.BR.1.3.6-04010-8976.0" Change-Id: If446d01e5305f2e7b268b761d214305e35e2ce18
This commit is contained in:
commit
62829e8978
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2008-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2008-2017, 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
|
||||
|
@ -251,7 +251,7 @@ static void diag_send_msg_mask_update(uint8_t peripheral, int first, int last)
|
|||
uint8_t *buf = msg_mask.update_buf;
|
||||
uint8_t *temp = NULL;
|
||||
uint32_t mask_size = 0;
|
||||
struct diag_msg_mask_t *mask = (struct diag_msg_mask_t *)msg_mask.ptr;
|
||||
struct diag_msg_mask_t *mask;
|
||||
struct diag_ctrl_msg_mask header;
|
||||
|
||||
if (peripheral >= NUM_PERIPHERALS)
|
||||
|
@ -263,7 +263,8 @@ static void diag_send_msg_mask_update(uint8_t peripheral, int first, int last)
|
|||
__func__, peripheral);
|
||||
return;
|
||||
}
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
mask = (struct diag_msg_mask_t *)msg_mask.ptr;
|
||||
mutex_lock(&msg_mask.lock);
|
||||
switch (msg_mask.status) {
|
||||
case DIAG_CTRL_MASK_ALL_DISABLED:
|
||||
|
@ -335,6 +336,7 @@ proceed:
|
|||
}
|
||||
err:
|
||||
mutex_unlock(&msg_mask.lock);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
}
|
||||
|
||||
static void diag_send_time_sync_update(uint8_t peripheral)
|
||||
|
@ -441,7 +443,7 @@ static int diag_cmd_get_ssid_range(unsigned char *src_buf, int src_len,
|
|||
|
||||
if (!diag_apps_responds())
|
||||
return 0;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
rsp.cmd_code = DIAG_CMD_MSG_CONFIG;
|
||||
rsp.sub_cmd = DIAG_CMD_OP_GET_SSID_RANGE;
|
||||
rsp.status = MSG_STATUS_SUCCESS;
|
||||
|
@ -462,6 +464,7 @@ static int diag_cmd_get_ssid_range(unsigned char *src_buf, int src_len,
|
|||
memcpy(dest_buf + write_len, &ssid_range, sizeof(ssid_range));
|
||||
write_len += sizeof(ssid_range);
|
||||
}
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
return write_len;
|
||||
}
|
||||
|
@ -486,6 +489,7 @@ static int diag_cmd_get_build_mask(unsigned char *src_buf, int src_len,
|
|||
if (!diag_apps_responds())
|
||||
return 0;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
req = (struct diag_build_mask_req_t *)src_buf;
|
||||
rsp.cmd_code = DIAG_CMD_MSG_CONFIG;
|
||||
rsp.sub_cmd = DIAG_CMD_OP_GET_BUILD_MASK;
|
||||
|
@ -516,6 +520,7 @@ static int diag_cmd_get_build_mask(unsigned char *src_buf, int src_len,
|
|||
}
|
||||
memcpy(dest_buf, &rsp, sizeof(rsp));
|
||||
write_len += sizeof(rsp);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
return write_len;
|
||||
}
|
||||
|
@ -538,7 +543,7 @@ static int diag_cmd_get_msg_mask(unsigned char *src_buf, int src_len,
|
|||
|
||||
if (!diag_apps_responds())
|
||||
return 0;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
req = (struct diag_build_mask_req_t *)src_buf;
|
||||
rsp.cmd_code = DIAG_CMD_MSG_CONFIG;
|
||||
rsp.sub_cmd = DIAG_CMD_OP_GET_MSG_MASK;
|
||||
|
@ -564,6 +569,7 @@ static int diag_cmd_get_msg_mask(unsigned char *src_buf, int src_len,
|
|||
}
|
||||
memcpy(dest_buf, &rsp, sizeof(rsp));
|
||||
write_len += sizeof(rsp);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
return write_len;
|
||||
}
|
||||
|
@ -589,7 +595,7 @@ static int diag_cmd_set_msg_mask(unsigned char *src_buf, int src_len,
|
|||
}
|
||||
|
||||
req = (struct diag_msg_build_mask_t *)src_buf;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
mutex_lock(&msg_mask.lock);
|
||||
mask = (struct diag_msg_mask_t *)msg_mask.ptr;
|
||||
for (i = 0; i < driver->msg_mask_tbl_count; i++, mask++) {
|
||||
|
@ -620,6 +626,9 @@ static int diag_cmd_set_msg_mask(unsigned char *src_buf, int src_len,
|
|||
pr_err_ratelimited("diag: In %s, unable to allocate memory for msg mask ptr, mask_size: %d\n",
|
||||
__func__, mask_size);
|
||||
mutex_unlock(&mask->lock);
|
||||
mutex_unlock(&msg_mask.lock);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
mask->ptr = temp;
|
||||
|
@ -640,6 +649,7 @@ static int diag_cmd_set_msg_mask(unsigned char *src_buf, int src_len,
|
|||
break;
|
||||
}
|
||||
mutex_unlock(&msg_mask.lock);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
diag_update_userspace_clients(MSG_MASKS_TYPE);
|
||||
|
||||
|
@ -684,7 +694,7 @@ static int diag_cmd_set_all_msg_mask(unsigned char *src_buf, int src_len,
|
|||
}
|
||||
|
||||
req = (struct diag_msg_config_rsp_t *)src_buf;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
mutex_lock(&msg_mask.lock);
|
||||
msg_mask.status = (req->rt_mask) ? DIAG_CTRL_MASK_ALL_ENABLED :
|
||||
DIAG_CTRL_MASK_ALL_DISABLED;
|
||||
|
@ -695,6 +705,7 @@ static int diag_cmd_set_all_msg_mask(unsigned char *src_buf, int src_len,
|
|||
mutex_unlock(&mask->lock);
|
||||
}
|
||||
mutex_unlock(&msg_mask.lock);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
diag_update_userspace_clients(MSG_MASKS_TYPE);
|
||||
|
||||
|
@ -1110,6 +1121,7 @@ static int diag_create_msg_mask_table(void)
|
|||
struct diag_msg_mask_t *mask = (struct diag_msg_mask_t *)msg_mask.ptr;
|
||||
struct diag_ssid_range_t range;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
mutex_lock(&msg_mask.lock);
|
||||
driver->msg_mask_tbl_count = MSG_MASK_TBL_CNT;
|
||||
for (i = 0; i < driver->msg_mask_tbl_count; i++, mask++) {
|
||||
|
@ -1120,6 +1132,8 @@ static int diag_create_msg_mask_table(void)
|
|||
break;
|
||||
}
|
||||
mutex_unlock(&msg_mask.lock);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -1132,6 +1146,7 @@ static int diag_create_build_time_mask(void)
|
|||
struct diag_msg_mask_t *build_mask = NULL;
|
||||
struct diag_ssid_range_t range;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
mutex_lock(&msg_bt_mask.lock);
|
||||
build_mask = (struct diag_msg_mask_t *)msg_bt_mask.ptr;
|
||||
for (i = 0; i < driver->msg_mask_tbl_count; i++, build_mask++) {
|
||||
|
@ -1245,6 +1260,7 @@ static int diag_create_build_time_mask(void)
|
|||
memcpy(build_mask->ptr, tbl, tbl_size);
|
||||
}
|
||||
mutex_unlock(&msg_bt_mask.lock);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -1316,10 +1332,12 @@ static int diag_msg_mask_init(void)
|
|||
pr_err("diag: Unable to create msg masks, err: %d\n", err);
|
||||
return err;
|
||||
}
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
driver->msg_mask = &msg_mask;
|
||||
|
||||
for (i = 0; i < NUM_PERIPHERALS; i++)
|
||||
driver->max_ssid_count[i] = 0;
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1329,14 +1347,17 @@ static void diag_msg_mask_exit(void)
|
|||
int i;
|
||||
struct diag_msg_mask_t *mask = NULL;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
mask = (struct diag_msg_mask_t *)(msg_mask.ptr);
|
||||
if (mask) {
|
||||
for (i = 0; i < driver->msg_mask_tbl_count; i++, mask++)
|
||||
kfree(mask->ptr);
|
||||
kfree(msg_mask.ptr);
|
||||
msg_mask.ptr = NULL;
|
||||
}
|
||||
|
||||
kfree(msg_mask.update_buf);
|
||||
msg_mask.update_buf = NULL;
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
}
|
||||
|
||||
static int diag_build_time_mask_init(void)
|
||||
|
@ -1361,13 +1382,15 @@ static void diag_build_time_mask_exit(void)
|
|||
{
|
||||
int i;
|
||||
struct diag_msg_mask_t *mask = NULL;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
mask = (struct diag_msg_mask_t *)(msg_bt_mask.ptr);
|
||||
if (mask) {
|
||||
for (i = 0; i < driver->msg_mask_tbl_count; i++, mask++)
|
||||
for (i = 0; i < driver->bt_msg_mask_tbl_count; i++, mask++)
|
||||
kfree(mask->ptr);
|
||||
kfree(msg_mask.ptr);
|
||||
kfree(msg_bt_mask.ptr);
|
||||
msg_bt_mask.ptr = NULL;
|
||||
}
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
}
|
||||
|
||||
static int diag_log_mask_init(void)
|
||||
|
@ -1441,7 +1464,7 @@ int diag_copy_to_user_msg_mask(char __user *buf, size_t count)
|
|||
|
||||
if (!buf || count == 0)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
mutex_lock(&msg_mask.lock);
|
||||
mask = (struct diag_msg_mask_t *)(msg_mask.ptr);
|
||||
for (i = 0; i < driver->msg_mask_tbl_count; i++, mask++) {
|
||||
|
@ -1480,6 +1503,7 @@ int diag_copy_to_user_msg_mask(char __user *buf, size_t count)
|
|||
total_len += len;
|
||||
}
|
||||
mutex_unlock(&msg_mask.lock);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
|
||||
return err ? err : total_len;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2008-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2008-2017, 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
|
||||
|
@ -546,8 +546,10 @@ struct diagchar_dev {
|
|||
struct diag_mask_info *event_mask;
|
||||
struct diag_mask_info *build_time_mask;
|
||||
uint8_t msg_mask_tbl_count;
|
||||
uint8_t bt_msg_mask_tbl_count;
|
||||
uint16_t event_mask_size;
|
||||
uint16_t last_event_id;
|
||||
struct mutex msg_mask_lock;
|
||||
/* Variables for Mask Centralization */
|
||||
uint16_t num_event_id[NUM_PERIPHERALS];
|
||||
uint32_t num_equip_id[NUM_PERIPHERALS];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2008-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2008-2017, 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
|
||||
|
@ -3039,6 +3039,7 @@ static int __init diagchar_init(void)
|
|||
mutex_init(&driver->diag_file_mutex);
|
||||
mutex_init(&driver->delayed_rsp_mutex);
|
||||
mutex_init(&apps_data_mutex);
|
||||
mutex_init(&driver->msg_mask_lock);
|
||||
mutex_init(&driver->diagfwd_channel_mutex);
|
||||
init_waitqueue_head(&driver->wait_q);
|
||||
INIT_WORK(&(driver->diag_drain_work), diag_drain_work_fn);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011-2017, 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
|
||||
|
@ -512,7 +512,7 @@ static void process_ssid_range_report(uint8_t *buf, uint32_t len,
|
|||
ptr += header_len;
|
||||
/* Don't account for pkt_id and length */
|
||||
read_len += header_len - (2 * sizeof(uint32_t));
|
||||
DIAG_LOG(DIAG_DEBUG_PERIPHERALS,"received ssid range ctrl packet of len %d read_len %d",len,read_len);
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
driver->max_ssid_count[peripheral] = header->count;
|
||||
for (i = 0; i < header->count && read_len < len; i++) {
|
||||
ssid_range = (struct diag_ssid_range_t *)ptr;
|
||||
|
@ -556,7 +556,7 @@ static void process_ssid_range_report(uint8_t *buf, uint32_t len,
|
|||
}
|
||||
driver->msg_mask_tbl_count += 1;
|
||||
}
|
||||
DIAG_LOG(DIAG_DEBUG_PERIPHERALS,"completed processing ssid range ctrl packet of len %d read_len %d",len,read_len);
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
}
|
||||
|
||||
static void diag_build_time_mask_update(uint8_t *buf,
|
||||
|
@ -581,11 +581,11 @@ static void diag_build_time_mask_update(uint8_t *buf,
|
|||
__func__, range->ssid_first, range->ssid_last);
|
||||
return;
|
||||
}
|
||||
|
||||
mutex_lock(&driver->msg_mask_lock);
|
||||
build_mask = (struct diag_msg_mask_t *)(driver->build_time_mask->ptr);
|
||||
num_items = range->ssid_last - range->ssid_first + 1;
|
||||
|
||||
for (i = 0; i < driver->msg_mask_tbl_count; i++, build_mask++) {
|
||||
for (i = 0; i < driver->bt_msg_mask_tbl_count; i++, build_mask++) {
|
||||
if (build_mask->ssid_first != range->ssid_first)
|
||||
continue;
|
||||
found = 1;
|
||||
|
@ -604,7 +604,7 @@ static void diag_build_time_mask_update(uint8_t *buf,
|
|||
|
||||
if (found)
|
||||
goto end;
|
||||
new_size = (driver->msg_mask_tbl_count + 1) *
|
||||
new_size = (driver->bt_msg_mask_tbl_count + 1) *
|
||||
sizeof(struct diag_msg_mask_t);
|
||||
temp = krealloc(driver->build_time_mask->ptr, new_size, GFP_KERNEL);
|
||||
if (!temp) {
|
||||
|
@ -619,8 +619,9 @@ static void diag_build_time_mask_update(uint8_t *buf,
|
|||
__func__, err);
|
||||
goto end;
|
||||
}
|
||||
driver->msg_mask_tbl_count += 1;
|
||||
driver->bt_msg_mask_tbl_count += 1;
|
||||
end:
|
||||
mutex_unlock(&driver->msg_mask_lock);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -355,18 +355,25 @@ static ssize_t rmidev_read(struct file *filp, char __user *buf,
|
|||
return -EBADF;
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
return 0;
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
if (count > (REG_ADDR_LIMIT - *f_pos))
|
||||
count = REG_ADDR_LIMIT - *f_pos;
|
||||
|
||||
if (count == 0) {
|
||||
retval = 0;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (*f_pos > REG_ADDR_LIMIT) {
|
||||
retval = -EFAULT;
|
||||
goto unlock;
|
||||
}
|
||||
tmpbuf = kzalloc(count + 1, GFP_KERNEL);
|
||||
if (!tmpbuf)
|
||||
return -ENOMEM;
|
||||
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
if (!tmpbuf) {
|
||||
retval = -ENOMEM;
|
||||
goto unlock;
|
||||
}
|
||||
retval = synaptics_rmi4_reg_read(rmidev->rmi4_data,
|
||||
*f_pos,
|
||||
tmpbuf,
|
||||
|
@ -380,8 +387,9 @@ static ssize_t rmidev_read(struct file *filp, char __user *buf,
|
|||
*f_pos += retval;
|
||||
|
||||
clean_up:
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
kfree(tmpbuf);
|
||||
unlock:
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -405,21 +413,31 @@ static ssize_t rmidev_write(struct file *filp, const char __user *buf,
|
|||
return -EBADF;
|
||||
}
|
||||
|
||||
if (count == 0)
|
||||
return 0;
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
if (*f_pos > REG_ADDR_LIMIT) {
|
||||
retval = -EFAULT;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (count > (REG_ADDR_LIMIT - *f_pos))
|
||||
count = REG_ADDR_LIMIT - *f_pos;
|
||||
|
||||
if (count == 0) {
|
||||
retval = 0;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
tmpbuf = kzalloc(count + 1, GFP_KERNEL);
|
||||
if (!tmpbuf)
|
||||
return -ENOMEM;
|
||||
if (!tmpbuf) {
|
||||
retval = -ENOMEM;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (copy_from_user(tmpbuf, buf, count)) {
|
||||
kfree(tmpbuf);
|
||||
return -EFAULT;
|
||||
retval = -EFAULT;
|
||||
goto clean_up;
|
||||
}
|
||||
mutex_lock(&(dev_data->file_mutex));
|
||||
|
||||
retval = synaptics_rmi4_reg_write(rmidev->rmi4_data,
|
||||
*f_pos,
|
||||
|
@ -428,8 +446,10 @@ static ssize_t rmidev_write(struct file *filp, const char __user *buf,
|
|||
if (retval >= 0)
|
||||
*f_pos += retval;
|
||||
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
clean_up:
|
||||
kfree(tmpbuf);
|
||||
unlock:
|
||||
mutex_unlock(&(dev_data->file_mutex));
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -213,8 +213,8 @@ static int msm_isp_prepare_isp_buf(struct msm_isp_buf_mgr *buf_mgr,
|
|||
}
|
||||
mapped_info->paddr += accu_length;
|
||||
accu_length += qbuf_buf->planes[i].length;
|
||||
CDBG("%s: plane: %d addr:%lu\n",
|
||||
__func__, i, (unsigned long)mapped_info->paddr);
|
||||
CDBG("%s: plane: %d addr:%pK\n",
|
||||
__func__, i, (void *)mapped_info->paddr);
|
||||
|
||||
}
|
||||
buf_info->num_planes = qbuf_buf->num_planes;
|
||||
|
@ -280,8 +280,8 @@ static int msm_isp_map_buf(struct msm_isp_buf_mgr *buf_mgr,
|
|||
pr_err_ratelimited("%s: cannot map address", __func__);
|
||||
goto smmu_map_error;
|
||||
}
|
||||
CDBG("%s: addr:%lu\n",
|
||||
__func__, (unsigned long)mapped_info->paddr);
|
||||
CDBG("%s: addr:%pK\n",
|
||||
__func__, (void *)mapped_info->paddr);
|
||||
|
||||
return rc;
|
||||
smmu_map_error:
|
||||
|
@ -1408,7 +1408,8 @@ static int msm_isp_buf_mgr_debug(struct msm_isp_buf_mgr *buf_mgr)
|
|||
struct msm_isp_buffer *bufs = NULL;
|
||||
uint32_t i = 0, j = 0, k = 0, rc = 0;
|
||||
char *print_buf = NULL, temp_buf[100];
|
||||
uint32_t start_addr = 0, end_addr = 0, print_buf_size = 2000;
|
||||
uint32_t print_buf_size = 2000;
|
||||
unsigned long start_addr = 0, end_addr = 0;
|
||||
if (!buf_mgr) {
|
||||
pr_err_ratelimited("%s: %d] NULL buf_mgr\n",
|
||||
__func__, __LINE__);
|
||||
|
@ -1443,8 +1444,8 @@ static int msm_isp_buf_mgr_debug(struct msm_isp_buf_mgr *buf_mgr)
|
|||
end_addr = bufs->mapped_info[k].paddr +
|
||||
bufs->mapped_info[k].len;
|
||||
snprintf(temp_buf, sizeof(temp_buf),
|
||||
" buf %d plane %d start_addr %x end_addr %x\n",
|
||||
j, k, start_addr, end_addr);
|
||||
" buf %d plane %d start_addr %pK end_addr %pK\n",
|
||||
j, k, (void *)start_addr, (void *)end_addr);
|
||||
strlcat(print_buf, temp_buf,
|
||||
print_buf_size);
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ static void msm_ispif_io_dump_reg(struct ispif_device *ispif)
|
|||
|
||||
|
||||
static inline int msm_ispif_is_intf_valid(uint32_t csid_version,
|
||||
uint8_t intf_type)
|
||||
enum msm_ispif_vfe_intf intf_type)
|
||||
{
|
||||
return ((csid_version <= CSID_VERSION_V22 && intf_type != VFE0) ||
|
||||
(intf_type >= VFE_MAX)) ? false : true;
|
||||
|
@ -459,7 +459,7 @@ static int msm_ispif_subdev_g_chip_ident(struct v4l2_subdev *sd,
|
|||
}
|
||||
|
||||
static void msm_ispif_sel_csid_core(struct ispif_device *ispif,
|
||||
uint8_t intftype, uint8_t csid, uint8_t vfe_intf)
|
||||
uint8_t intftype, uint8_t csid, enum msm_ispif_vfe_intf vfe_intf)
|
||||
{
|
||||
uint32_t data;
|
||||
|
||||
|
@ -499,7 +499,7 @@ static void msm_ispif_sel_csid_core(struct ispif_device *ispif,
|
|||
}
|
||||
|
||||
static void msm_ispif_enable_crop(struct ispif_device *ispif,
|
||||
uint8_t intftype, uint8_t vfe_intf, uint16_t start_pixel,
|
||||
uint8_t intftype, enum msm_ispif_vfe_intf vfe_intf, uint16_t start_pixel,
|
||||
uint16_t end_pixel)
|
||||
{
|
||||
uint32_t data;
|
||||
|
@ -531,7 +531,7 @@ static void msm_ispif_enable_crop(struct ispif_device *ispif,
|
|||
}
|
||||
|
||||
static void msm_ispif_enable_intf_cids(struct ispif_device *ispif,
|
||||
uint8_t intftype, uint16_t cid_mask, uint8_t vfe_intf, uint8_t enable)
|
||||
uint8_t intftype, uint16_t cid_mask, enum msm_ispif_vfe_intf vfe_intf, uint8_t enable)
|
||||
{
|
||||
uint32_t intf_addr, data;
|
||||
|
||||
|
@ -573,7 +573,7 @@ static void msm_ispif_enable_intf_cids(struct ispif_device *ispif,
|
|||
}
|
||||
|
||||
static int msm_ispif_validate_intf_status(struct ispif_device *ispif,
|
||||
uint8_t intftype, uint8_t vfe_intf)
|
||||
uint8_t intftype, enum msm_ispif_vfe_intf vfe_intf)
|
||||
{
|
||||
int rc = 0;
|
||||
uint32_t data = 0;
|
||||
|
@ -613,7 +613,7 @@ static int msm_ispif_validate_intf_status(struct ispif_device *ispif,
|
|||
}
|
||||
|
||||
static void msm_ispif_select_clk_mux(struct ispif_device *ispif,
|
||||
uint8_t intftype, uint8_t csid, uint8_t vfe_intf)
|
||||
uint8_t intftype, uint8_t csid, enum msm_ispif_vfe_intf vfe_intf)
|
||||
{
|
||||
uint32_t data = 0;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2012-2015, 2017 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
|
||||
|
@ -896,11 +896,9 @@ static int msm_open(struct file *filep)
|
|||
BUG_ON(!pvdev);
|
||||
|
||||
/* !!! only ONE open is allowed !!! */
|
||||
if (atomic_read(&pvdev->opened))
|
||||
if (atomic_cmpxchg(&pvdev->opened, 0, 1))
|
||||
return -EBUSY;
|
||||
|
||||
atomic_set(&pvdev->opened, 1);
|
||||
|
||||
spin_lock_irqsave(&msm_pid_lock, flags);
|
||||
msm_pid = get_pid(task_pid(current));
|
||||
spin_unlock_irqrestore(&msm_pid_lock, flags);
|
||||
|
|
|
@ -2364,9 +2364,29 @@ static int msm_cpp_cfg_frame(struct cpp_device *cpp_dev,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (stripe_base == UINT_MAX || new_frame->num_strips >
|
||||
(UINT_MAX - 1 - stripe_base) / stripe_size) {
|
||||
pr_err("Invalid frame message,num_strips %d is large\n",
|
||||
/* Stripe index starts at zero */
|
||||
if ((!new_frame->num_strips) ||
|
||||
(new_frame->first_stripe_index >= new_frame->num_strips) ||
|
||||
(new_frame->last_stripe_index >= new_frame->num_strips) ||
|
||||
(new_frame->first_stripe_index >
|
||||
new_frame->last_stripe_index)) {
|
||||
pr_err("Invalid frame message, #stripes=%d, stripe indices=[%d,%d]\n",
|
||||
new_frame->num_strips,
|
||||
new_frame->first_stripe_index,
|
||||
new_frame->last_stripe_index);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!stripe_size) {
|
||||
pr_err("Invalid frame message, invalid stripe_size (%d)!\n",
|
||||
stripe_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((stripe_base == UINT_MAX) ||
|
||||
(new_frame->num_strips >
|
||||
(UINT_MAX - 1 - stripe_base) / stripe_size)) {
|
||||
pr_err("Invalid frame message, num_strips %d is large\n",
|
||||
new_frame->num_strips);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -2564,13 +2584,14 @@ static int msm_cpp_cfg(struct cpp_device *cpp_dev,
|
|||
struct msm_cpp_frame_info_t *frame = NULL;
|
||||
struct msm_cpp_frame_info_t k_frame_info;
|
||||
int32_t rc = 0;
|
||||
int32_t i = 0;
|
||||
int32_t num_buff = sizeof(k_frame_info.output_buffer_info)/
|
||||
uint32_t i = 0;
|
||||
uint32_t num_buff = sizeof(k_frame_info.output_buffer_info) /
|
||||
sizeof(struct msm_cpp_buffer_info_t);
|
||||
|
||||
if (copy_from_user(&k_frame_info,
|
||||
(void __user *)ioctl_ptr->ioctl_ptr,
|
||||
sizeof(k_frame_info)))
|
||||
return -EFAULT;
|
||||
return -EFAULT;
|
||||
|
||||
frame = msm_cpp_get_frame(ioctl_ptr);
|
||||
if (!frame) {
|
||||
|
@ -2666,11 +2687,14 @@ static int msm_cpp_copy_from_ioctl_ptr(void *dst_ptr,
|
|||
#endif
|
||||
|
||||
|
||||
static int msm_cpp_validate_input(unsigned int cmd, void *arg,
|
||||
static int msm_cpp_validate_ioctl_input(unsigned int cmd, void *arg,
|
||||
struct msm_camera_v4l2_ioctl_t **ioctl_ptr)
|
||||
{
|
||||
switch (cmd) {
|
||||
case MSM_SD_SHUTDOWN:
|
||||
case MSM_SD_NOTIFY_FREEZE:
|
||||
case VIDIOC_MSM_CPP_IOMMU_ATTACH:
|
||||
case VIDIOC_MSM_CPP_IOMMU_DETACH:
|
||||
break;
|
||||
default:
|
||||
if (ioctl_ptr == NULL) {
|
||||
|
@ -2679,8 +2703,9 @@ static int msm_cpp_validate_input(unsigned int cmd, void *arg,
|
|||
}
|
||||
|
||||
*ioctl_ptr = arg;
|
||||
if ((*ioctl_ptr == NULL) ||
|
||||
(*ioctl_ptr)->ioctl_ptr == NULL) {
|
||||
if (((*ioctl_ptr) == NULL) ||
|
||||
((*ioctl_ptr)->ioctl_ptr == NULL) ||
|
||||
((*ioctl_ptr)->len == 0)) {
|
||||
pr_err("Error invalid ioctl argument cmd %u\n", cmd);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -2725,7 +2750,7 @@ long msm_cpp_subdev_ioctl(struct v4l2_subdev *sd,
|
|||
pr_err("Invalid ioctl/subdev cmd %u", cmd);
|
||||
return -EINVAL;
|
||||
}
|
||||
rc = msm_cpp_validate_input(cmd, arg, &ioctl_ptr);
|
||||
rc = msm_cpp_validate_ioctl_input(cmd, arg, &ioctl_ptr);
|
||||
if (rc != 0) {
|
||||
pr_err("input validation failed\n");
|
||||
return rc;
|
||||
|
@ -3198,7 +3223,7 @@ STREAM_BUFF_END:
|
|||
(cpp_dev->stream_cnt == 0)) {
|
||||
rc = cam_smmu_ops(cpp_dev->iommu_hdl, CAM_SMMU_DETACH);
|
||||
if (rc < 0) {
|
||||
pr_err("%s:%dError iommu atach failed\n",
|
||||
pr_err("%s:%d Error iommu detach failed\n",
|
||||
__func__, __LINE__);
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
|
@ -3207,6 +3232,7 @@ STREAM_BUFF_END:
|
|||
} else {
|
||||
pr_err("%s:%d IOMMMU attach triggered in invalid state\n",
|
||||
__func__, __LINE__);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -3831,7 +3857,7 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file,
|
|||
default:
|
||||
pr_err_ratelimited("%s: unsupported compat type :%x LOAD %lu\n",
|
||||
__func__, cmd, VIDIOC_MSM_CPP_LOAD_FIRMWARE);
|
||||
break;
|
||||
return -EINVAL;
|
||||
}
|
||||
mutex_unlock(&cpp_dev->mutex);
|
||||
|
||||
|
@ -3860,7 +3886,7 @@ static long msm_cpp_subdev_fops_compat_ioctl(struct file *file,
|
|||
default:
|
||||
pr_err_ratelimited("%s: unsupported compat type :%d\n",
|
||||
__func__, cmd);
|
||||
break;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (is_copytouser_req) {
|
||||
|
|
|
@ -3738,6 +3738,7 @@ static int iris_vidioc_s_ext_ctrls(struct file *file, void *priv,
|
|||
struct hci_fm_set_cal_req_proc proc_cal_req;
|
||||
struct hci_fm_set_spur_table_req spur_tbl_req;
|
||||
char *spur_data;
|
||||
char tmp_buf[2];
|
||||
|
||||
struct iris_device *radio = video_get_drvdata(video_devdata(file));
|
||||
char *data = NULL;
|
||||
|
@ -3876,9 +3877,18 @@ static int iris_vidioc_s_ext_ctrls(struct file *file, void *priv,
|
|||
case V4L2_CID_PRIVATE_IRIS_SET_SPURTABLE:
|
||||
memset(&spur_tbl_req, 0, sizeof(spur_tbl_req));
|
||||
data = (ctrl->controls[0]).string;
|
||||
bytes_to_copy = (ctrl->controls[0]).size;
|
||||
spur_tbl_req.mode = data[0];
|
||||
spur_tbl_req.no_of_freqs_entries = data[1];
|
||||
if (copy_from_user(&bytes_to_copy, &((ctrl->controls[0]).size),
|
||||
sizeof(bytes_to_copy))) {
|
||||
retval = -EFAULT;
|
||||
goto END;
|
||||
}
|
||||
if (copy_from_user(&tmp_buf[0], &data[0],
|
||||
sizeof(tmp_buf))) {
|
||||
retval = -EFAULT;
|
||||
goto END;
|
||||
}
|
||||
spur_tbl_req.mode = tmp_buf[0];
|
||||
spur_tbl_req.no_of_freqs_entries = tmp_buf[1];
|
||||
|
||||
if (((spur_tbl_req.no_of_freqs_entries * SPUR_DATA_LEN) !=
|
||||
bytes_to_copy - 2) ||
|
||||
|
|
|
@ -1939,6 +1939,9 @@ int uvc_ctrl_add_mapping(struct uvc_video_chain *chain,
|
|||
if (!found)
|
||||
return -ENOENT;
|
||||
|
||||
if (ctrl->info.size < mapping->size)
|
||||
return -EINVAL;
|
||||
|
||||
if (mutex_lock_interruptible(&chain->ctrl_mutex))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
|
|
|
@ -1479,7 +1479,7 @@ static void ipa_free_buffer(void *user1, int user2)
|
|||
kfree(user1);
|
||||
}
|
||||
|
||||
static int ipa_q6_pipe_delay(bool zip_pipes)
|
||||
int ipa_q6_pipe_delay(bool zip_pipes)
|
||||
{
|
||||
u32 reg_val = 0;
|
||||
int client_idx;
|
||||
|
@ -1864,14 +1864,14 @@ int ipa_q6_pre_shutdown_cleanup(void)
|
|||
BUG();
|
||||
|
||||
ipa_inc_client_enable_clks();
|
||||
|
||||
/*
|
||||
* pipe delay and holb discard for ZIP pipes are handled
|
||||
* in post shutdown callback.
|
||||
*/
|
||||
if (ipa_q6_pipe_delay(false)) {
|
||||
IPAERR("Failed to delay Q6 pipes\n");
|
||||
BUG();
|
||||
}
|
||||
* Do not delay Q6 pipes here. This may result in IPA reading a
|
||||
* DMA_TASK with lock bit set and then Q6 pipe delay is set. In this
|
||||
* situation IPA will be remain locked as the DMA_TASK with unlock
|
||||
* bit will not be read by IPA as pipe delay is enabled. IPA uC will
|
||||
* wait for pipe to be empty before issuing a BAM pipe reset.
|
||||
*/
|
||||
|
||||
if (ipa_q6_monitor_holb_mitigation(false)) {
|
||||
IPAERR("Failed to disable HOLB monitroing on Q6 pipes\n");
|
||||
|
@ -1910,13 +1910,13 @@ int ipa_q6_post_shutdown_cleanup(void)
|
|||
int res;
|
||||
|
||||
/*
|
||||
* pipe delay and holb discard for ZIP pipes are handled in
|
||||
* post shutdown.
|
||||
*/
|
||||
if (ipa_q6_pipe_delay(true)) {
|
||||
IPAERR("Failed to delay Q6 ZIP pipes\n");
|
||||
BUG();
|
||||
}
|
||||
* Do not delay Q6 pipes here. This may result in IPA reading a
|
||||
* DMA_TASK with lock bit set and then Q6 pipe delay is set. In this
|
||||
* situation IPA will be remain locked as the DMA_TASK with unlock
|
||||
* bit will not be read by IPA as pipe delay is enabled. IPA uC will
|
||||
* wait for pipe to be empty before issuing a BAM pipe reset.
|
||||
*/
|
||||
|
||||
if (ipa_q6_avoid_holb(true)) {
|
||||
IPAERR("Failed to set HOLB on Q6 ZIP pipes\n");
|
||||
BUG();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2010-2012, 2014-2015, The Linux Foundation. All rights
|
||||
/* Copyright (c) 2010-2012, 2014-2015, 2017 The Linux Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
@ -38,6 +38,7 @@
|
|||
static struct dentry *clients;
|
||||
static struct dentry *dir;
|
||||
static DEFINE_MUTEX(msm_bus_dbg_fablist_lock);
|
||||
static DEFINE_RT_MUTEX(msm_bus_dbg_cllist_lock);
|
||||
struct msm_bus_dbg_state {
|
||||
uint32_t cl;
|
||||
uint8_t enable;
|
||||
|
@ -289,7 +290,9 @@ static ssize_t client_data_read(struct file *file, char __user *buf,
|
|||
struct msm_bus_cldata *cldata = NULL;
|
||||
const struct msm_bus_client_handle *handle = file->private_data;
|
||||
int found = 0;
|
||||
ssize_t ret;
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry(cldata, &cl_list, list) {
|
||||
if ((cldata->clid == cl) ||
|
||||
(cldata->handle && (cldata->handle == handle))) {
|
||||
|
@ -298,12 +301,17 @@ static ssize_t client_data_read(struct file *file, char __user *buf,
|
|||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
if (!found) {
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bsize = cldata->size;
|
||||
return simple_read_from_buffer(buf, count, ppos,
|
||||
ret = simple_read_from_buffer(buf, count, ppos,
|
||||
cldata->buffer, bsize);
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int client_data_open(struct inode *inode, struct file *file)
|
||||
|
@ -339,7 +347,9 @@ int msm_bus_dbg_add_client(const struct msm_bus_client_handle *pdata)
|
|||
return -ENOMEM;
|
||||
}
|
||||
cldata->handle = pdata;
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_add_tail(&cldata->list, &cl_list);
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -352,6 +362,7 @@ int msm_bus_dbg_rec_transaction(const struct msm_bus_client_handle *pdata,
|
|||
bool found = false;
|
||||
char *buf = NULL;
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry(cldata, &cl_list, list) {
|
||||
if (cldata->handle == pdata) {
|
||||
found = true;
|
||||
|
@ -359,12 +370,15 @@ int msm_bus_dbg_rec_transaction(const struct msm_bus_client_handle *pdata,
|
|||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
if (!found) {
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (cldata->file == NULL) {
|
||||
if (pdata->name == NULL) {
|
||||
MSM_BUS_DBG("Client doesn't have a name\n");
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
pr_debug("\n%s setting up debugfs %s", __func__, pdata->name);
|
||||
|
@ -394,6 +408,7 @@ int msm_bus_dbg_rec_transaction(const struct msm_bus_client_handle *pdata,
|
|||
i += scnprintf(buf + i, MAX_BUFF_SIZE - i, "%llu ", ib);
|
||||
i += scnprintf(buf + i, MAX_BUFF_SIZE - i, "\n");
|
||||
cldata->size = i;
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
|
||||
trace_bus_update_request((int)ts.tv_sec, (int)ts.tv_nsec,
|
||||
pdata->name, pdata->mas, pdata->slv, ab, ib);
|
||||
|
@ -405,6 +420,7 @@ void msm_bus_dbg_remove_client(const struct msm_bus_client_handle *pdata)
|
|||
{
|
||||
struct msm_bus_cldata *cldata = NULL;
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry(cldata, &cl_list, list) {
|
||||
if (cldata->handle == pdata) {
|
||||
debugfs_remove(cldata->file);
|
||||
|
@ -413,6 +429,7 @@ void msm_bus_dbg_remove_client(const struct msm_bus_client_handle *pdata)
|
|||
break;
|
||||
}
|
||||
}
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
}
|
||||
|
||||
static int msm_bus_dbg_record_client(const struct msm_bus_scale_pdata *pdata,
|
||||
|
@ -430,7 +447,9 @@ static int msm_bus_dbg_record_client(const struct msm_bus_scale_pdata *pdata,
|
|||
cldata->clid = clid;
|
||||
cldata->file = file;
|
||||
cldata->size = 0;
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_add_tail(&cldata->list, &cl_list);
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -438,6 +457,7 @@ static void msm_bus_dbg_free_client(uint32_t clid)
|
|||
{
|
||||
struct msm_bus_cldata *cldata = NULL;
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry(cldata, &cl_list, list) {
|
||||
if (cldata->clid == clid) {
|
||||
debugfs_remove(cldata->file);
|
||||
|
@ -446,6 +466,7 @@ static void msm_bus_dbg_free_client(uint32_t clid)
|
|||
break;
|
||||
}
|
||||
}
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
}
|
||||
|
||||
static int msm_bus_dbg_fill_cl_buffer(const struct msm_bus_scale_pdata *pdata,
|
||||
|
@ -457,6 +478,7 @@ static int msm_bus_dbg_fill_cl_buffer(const struct msm_bus_scale_pdata *pdata,
|
|||
struct timespec ts;
|
||||
int found = 0;
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry(cldata, &cl_list, list) {
|
||||
if (cldata->clid == clid) {
|
||||
found = 1;
|
||||
|
@ -464,11 +486,14 @@ static int msm_bus_dbg_fill_cl_buffer(const struct msm_bus_scale_pdata *pdata,
|
|||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
if (!found) {
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (cldata->file == NULL) {
|
||||
if (pdata->name == NULL) {
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
MSM_BUS_DBG("Client doesn't have a name\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -516,21 +541,11 @@ static int msm_bus_dbg_fill_cl_buffer(const struct msm_bus_scale_pdata *pdata,
|
|||
|
||||
cldata->index = index;
|
||||
cldata->size = i;
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
static int msm_bus_dbg_update_request(struct msm_bus_cldata *cldata, int index)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if ((index < 0) || (index > cldata->pdata->num_usecases)) {
|
||||
MSM_BUS_DBG("Invalid index!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = msm_bus_scale_client_update_request(cldata->clid, index);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t msm_bus_dbg_update_request_write(struct file *file,
|
||||
const char __user *ubuf, size_t cnt, loff_t *ppos)
|
||||
{
|
||||
|
@ -540,19 +555,26 @@ static ssize_t msm_bus_dbg_update_request_write(struct file *file,
|
|||
char *chid;
|
||||
char *buf = kmalloc((sizeof(char) * (cnt + 1)), GFP_KERNEL);
|
||||
int found = 0;
|
||||
uint32_t clid;
|
||||
ssize_t res = cnt;
|
||||
|
||||
if (!buf || IS_ERR(buf)) {
|
||||
MSM_BUS_ERR("Memory allocation for buffer failed\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
if (cnt == 0)
|
||||
return 0;
|
||||
if (copy_from_user(buf, ubuf, cnt))
|
||||
return -EFAULT;
|
||||
if (cnt == 0) {
|
||||
res = 0;
|
||||
goto out;
|
||||
}
|
||||
if (copy_from_user(buf, ubuf, cnt)) {
|
||||
res = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
buf[cnt] = '\0';
|
||||
chid = buf;
|
||||
MSM_BUS_DBG("buffer: %s\n size: %zu\n", buf, sizeof(ubuf));
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry(cldata, &cl_list, list) {
|
||||
if (strnstr(chid, cldata->pdata->name, cnt)) {
|
||||
found = 1;
|
||||
|
@ -563,21 +585,35 @@ static ssize_t msm_bus_dbg_update_request_write(struct file *file,
|
|||
if (ret) {
|
||||
MSM_BUS_DBG("Index conversion"
|
||||
" failed\n");
|
||||
return -EFAULT;
|
||||
rt_mutex_unlock(
|
||||
&msm_bus_dbg_cllist_lock);
|
||||
res = -EFAULT;
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
MSM_BUS_DBG("Error parsing input. Index not"
|
||||
" found\n");
|
||||
found = 0;
|
||||
}
|
||||
if ((index < 0) ||
|
||||
(index > cldata->pdata->num_usecases)) {
|
||||
MSM_BUS_DBG("Invalid index!\n");
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
res = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
clid = cldata->clid;
|
||||
break;
|
||||
}
|
||||
}
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
|
||||
if (found)
|
||||
msm_bus_dbg_update_request(cldata, index);
|
||||
msm_bus_scale_client_update_request(clid, index);
|
||||
|
||||
out:
|
||||
kfree(buf);
|
||||
return cnt;
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -600,8 +636,10 @@ static ssize_t fabric_data_read(struct file *file, char __user *buf,
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
if (!found) {
|
||||
mutex_unlock(&msm_bus_dbg_fablist_lock);
|
||||
return -ENOENT;
|
||||
}
|
||||
bsize = fablist->size;
|
||||
ret = simple_read_from_buffer(buf, count, ppos,
|
||||
fablist->buffer, bsize);
|
||||
|
@ -690,8 +728,10 @@ static int msm_bus_dbg_fill_fab_buffer(const char *fabname,
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
if (!found) {
|
||||
mutex_unlock(&msm_bus_dbg_fablist_lock);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
if (fablist->file == NULL) {
|
||||
MSM_BUS_DBG("Fabric dbg entry does not exist\n");
|
||||
|
@ -742,6 +782,8 @@ static ssize_t msm_bus_dbg_dump_clients_read(struct file *file,
|
|||
"\nDumping curent client votes to trace log\n");
|
||||
if (*ppos)
|
||||
goto exit_dump_clients_read;
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry(cldata, &cl_list, list) {
|
||||
if (IS_ERR_OR_NULL(cldata->pdata))
|
||||
continue;
|
||||
|
@ -757,6 +799,7 @@ static ssize_t msm_bus_dbg_dump_clients_read(struct file *file,
|
|||
cldata->pdata->active_only);
|
||||
}
|
||||
}
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
exit_dump_clients_read:
|
||||
return simple_read_from_buffer(buf, count, ppos, msg, cnt);
|
||||
}
|
||||
|
@ -881,6 +924,7 @@ static int __init msm_bus_debugfs_init(void)
|
|||
goto err;
|
||||
}
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry(cldata, &cl_list, list) {
|
||||
if (cldata->pdata) {
|
||||
if (cldata->pdata->name == NULL) {
|
||||
|
@ -900,6 +944,7 @@ static int __init msm_bus_debugfs_init(void)
|
|||
&client_data_fops);
|
||||
}
|
||||
}
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
|
||||
if (debugfs_create_file("dump_clients", S_IRUGO | S_IWUSR,
|
||||
clients, NULL, &msm_bus_dbg_dump_clients_fops) == NULL)
|
||||
|
@ -912,6 +957,7 @@ static int __init msm_bus_debugfs_init(void)
|
|||
if (fablist->file == NULL) {
|
||||
MSM_BUS_DBG("Cannot create files for commit data\n");
|
||||
kfree(rules_buf);
|
||||
mutex_unlock(&msm_bus_dbg_fablist_lock);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -931,10 +977,14 @@ static void __exit msm_bus_dbg_teardown(void)
|
|||
struct msm_bus_cldata *cldata = NULL, *cldata_temp;
|
||||
|
||||
debugfs_remove_recursive(dir);
|
||||
|
||||
rt_mutex_lock(&msm_bus_dbg_cllist_lock);
|
||||
list_for_each_entry_safe(cldata, cldata_temp, &cl_list, list) {
|
||||
list_del(&cldata->list);
|
||||
kfree(cldata);
|
||||
}
|
||||
rt_mutex_unlock(&msm_bus_dbg_cllist_lock);
|
||||
|
||||
mutex_lock(&msm_bus_dbg_fablist_lock);
|
||||
list_for_each_entry_safe(fablist, fablist_temp, &fabdata_list, list) {
|
||||
list_del(&fablist->list);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2014-2017, 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
|
||||
|
@ -410,8 +410,10 @@ void print_all_rules(void)
|
|||
{
|
||||
struct rule_node_info *node_it = NULL;
|
||||
|
||||
mutex_lock(&msm_bus_rules_lock);
|
||||
list_for_each_entry(node_it, &node_list, link)
|
||||
print_rules(node_it);
|
||||
mutex_unlock(&msm_bus_rules_lock);
|
||||
}
|
||||
|
||||
void print_rules_buf(char *buf, int max_buf)
|
||||
|
@ -421,6 +423,7 @@ void print_rules_buf(char *buf, int max_buf)
|
|||
int i;
|
||||
int cnt = 0;
|
||||
|
||||
mutex_lock(&msm_bus_rules_lock);
|
||||
list_for_each_entry(node_it, &node_list, link) {
|
||||
cnt += scnprintf(buf + cnt, max_buf - cnt,
|
||||
"\n Now printing rules for Node %d cur_rule %d\n",
|
||||
|
@ -452,6 +455,7 @@ void print_rules_buf(char *buf, int max_buf)
|
|||
node_rule->rule_ops.mode);
|
||||
}
|
||||
}
|
||||
mutex_unlock(&msm_bus_rules_lock);
|
||||
}
|
||||
|
||||
static int copy_rule(struct bus_rule_type *src, struct rules_def *node_rule,
|
||||
|
@ -646,11 +650,12 @@ bool msm_rule_are_rules_registered(void)
|
|||
{
|
||||
bool ret = false;
|
||||
|
||||
mutex_lock(&msm_bus_rules_lock);
|
||||
if (list_empty(&node_list))
|
||||
ret = false;
|
||||
else
|
||||
ret = true;
|
||||
|
||||
mutex_unlock(&msm_bus_rules_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2008 Nokia Corporation
|
||||
* Copyright (C) 2009 Samsung Electronics
|
||||
* Author: Michal Nazarewicz (mina86@mina86.com)
|
||||
* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2012-2017, 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
|
||||
|
@ -1327,8 +1327,6 @@ rndis_qc_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
|
|||
rndis->port.func.suspend = rndis_qc_suspend;
|
||||
rndis->port.func.resume = rndis_qc_resume;
|
||||
|
||||
_rndis_qc = rndis;
|
||||
|
||||
if (rndis->xport == USB_GADGET_XPORT_BAM2BAM_IPA) {
|
||||
status = rndis_ipa_init(&rndis_ipa_params);
|
||||
if (status) {
|
||||
|
@ -1344,6 +1342,8 @@ rndis_qc_bind_config_vendor(struct usb_configuration *c, u8 ethaddr[ETH_ALEN],
|
|||
goto fail;
|
||||
}
|
||||
|
||||
_rndis_qc = rndis;
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
@ -1355,74 +1355,115 @@ fail:
|
|||
|
||||
static int rndis_qc_open_dev(struct inode *ip, struct file *fp)
|
||||
{
|
||||
int ret = 0;
|
||||
unsigned long flags;
|
||||
pr_info("Open rndis QC driver\n");
|
||||
|
||||
spin_lock_irqsave(&rndis_lock, flags);
|
||||
if (!_rndis_qc) {
|
||||
pr_err("rndis_qc_dev not created yet\n");
|
||||
return -ENODEV;
|
||||
ret = -ENODEV;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (rndis_qc_lock(&_rndis_qc->open_excl)) {
|
||||
pr_err("Already opened\n");
|
||||
return -EBUSY;
|
||||
ret = -EBUSY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
fp->private_data = _rndis_qc;
|
||||
pr_info("rndis QC file opened\n");
|
||||
fail:
|
||||
spin_unlock_irqrestore(&rndis_lock, flags);
|
||||
|
||||
return 0;
|
||||
if (!ret)
|
||||
pr_info("rndis QC file opened\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int rndis_qc_release_dev(struct inode *ip, struct file *fp)
|
||||
{
|
||||
struct f_rndis_qc *rndis = fp->private_data;
|
||||
|
||||
unsigned long flags;
|
||||
pr_info("Close rndis QC file\n");
|
||||
rndis_qc_unlock(&rndis->open_excl);
|
||||
|
||||
spin_lock_irqsave(&rndis_lock, flags);
|
||||
|
||||
if (!_rndis_qc) {
|
||||
pr_err("rndis_qc_dev not present\n");
|
||||
spin_unlock_irqrestore(&rndis_lock, flags);
|
||||
return -ENODEV;
|
||||
}
|
||||
rndis_qc_unlock(&_rndis_qc->open_excl);
|
||||
spin_unlock_irqrestore(&rndis_lock, flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long rndis_qc_ioctl(struct file *fp, unsigned cmd, unsigned long arg)
|
||||
{
|
||||
struct f_rndis_qc *rndis = fp->private_data;
|
||||
u8 qc_max_pkt_per_xfer = 0;
|
||||
u32 qc_max_pkt_size = 0;
|
||||
int ret = 0;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&rndis_lock, flags);
|
||||
if (!_rndis_qc) {
|
||||
pr_err("rndis_qc_dev not present\n");
|
||||
ret = -ENODEV;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
qc_max_pkt_per_xfer = _rndis_qc->ul_max_pkt_per_xfer;
|
||||
qc_max_pkt_size = _rndis_qc->max_pkt_size;
|
||||
|
||||
if (rndis_qc_lock(&_rndis_qc->ioctl_excl)) {
|
||||
ret = -EBUSY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&rndis_lock, flags);
|
||||
|
||||
pr_info("Received command %d\n", cmd);
|
||||
|
||||
if (rndis_qc_lock(&rndis->ioctl_excl))
|
||||
return -EBUSY;
|
||||
|
||||
switch (cmd) {
|
||||
case RNDIS_QC_GET_MAX_PKT_PER_XFER:
|
||||
ret = copy_to_user((void __user *)arg,
|
||||
&rndis->ul_max_pkt_per_xfer,
|
||||
sizeof(rndis->ul_max_pkt_per_xfer));
|
||||
&qc_max_pkt_per_xfer,
|
||||
sizeof(qc_max_pkt_per_xfer));
|
||||
if (ret) {
|
||||
pr_err("copying to user space failed\n");
|
||||
ret = -EFAULT;
|
||||
}
|
||||
pr_info("Sent UL max packets per xfer %d\n",
|
||||
rndis->ul_max_pkt_per_xfer);
|
||||
qc_max_pkt_per_xfer);
|
||||
break;
|
||||
case RNDIS_QC_GET_MAX_PKT_SIZE:
|
||||
ret = copy_to_user((void __user *)arg,
|
||||
&rndis->max_pkt_size,
|
||||
sizeof(rndis->max_pkt_size));
|
||||
&qc_max_pkt_size,
|
||||
sizeof(qc_max_pkt_size));
|
||||
if (ret) {
|
||||
pr_err("copying to user space failed\n");
|
||||
ret = -EFAULT;
|
||||
}
|
||||
pr_debug("Sent max packet size %d\n",
|
||||
rndis->max_pkt_size);
|
||||
qc_max_pkt_size);
|
||||
break;
|
||||
default:
|
||||
pr_err("Unsupported IOCTL\n");
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
rndis_qc_unlock(&rndis->ioctl_excl);
|
||||
spin_lock_irqsave(&rndis_lock, flags);
|
||||
|
||||
if (!_rndis_qc) {
|
||||
pr_err("rndis_qc_dev not present\n");
|
||||
ret = -ENODEV;
|
||||
goto fail;
|
||||
}
|
||||
rndis_qc_unlock(&_rndis_qc->ioctl_excl);
|
||||
|
||||
fail:
|
||||
spin_unlock_irqrestore(&rndis_lock, flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1445,10 +1486,11 @@ static int rndis_qc_init(void)
|
|||
|
||||
pr_info("initialize rndis QC instance\n");
|
||||
|
||||
spin_lock_init(&rndis_lock);
|
||||
|
||||
ret = misc_register(&rndis_qc_device);
|
||||
if (ret)
|
||||
pr_err("rndis QC driver failed to register\n");
|
||||
spin_lock_init(&rndis_lock);
|
||||
|
||||
ret = bam_data_setup(USB_FUNC_RNDIS, RNDIS_QC_NO_PORTS);
|
||||
if (ret) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015,2017, 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
|
||||
|
@ -81,6 +81,11 @@ void *msm_dba_register_client(struct msm_dba_reg_info *info,
|
|||
if (rc) {
|
||||
pr_err("%s: Client register failed (%s, %d)\n",
|
||||
__func__, info->chip_name, info->instance_id);
|
||||
/* remove the client from list before freeing */
|
||||
mutex_lock_nested(&device->dev_mutex,
|
||||
SINGLE_DEPTH_NESTING);
|
||||
list_del(&client->list);
|
||||
mutex_unlock(&device->dev_mutex);
|
||||
kfree(client);
|
||||
mutex_unlock(®ister_mutex);
|
||||
return ERR_PTR(rc);
|
||||
|
|
|
@ -275,7 +275,7 @@ static int t_show(struct seq_file *m, void *v)
|
|||
if (!*fmt)
|
||||
return 0;
|
||||
|
||||
seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt);
|
||||
seq_printf(m, "0x%lx : \"", 0L);
|
||||
|
||||
/*
|
||||
* Tabs and new lines need to be converted.
|
||||
|
|
|
@ -391,7 +391,8 @@ static inline int xfrm_replay_verify_len(struct xfrm_replay_state_esn *replay_es
|
|||
ulen = xfrm_replay_state_esn_len(up);
|
||||
|
||||
/* Check the overall length and the internal bitmap length to avoid
|
||||
* potential overflow. */
|
||||
* potential overflow.
|
||||
*/
|
||||
if (nla_len(rp) < ulen ||
|
||||
xfrm_replay_state_esn_len(replay_esn) != ulen ||
|
||||
replay_esn->bmp_len != up->bmp_len)
|
||||
|
|
|
@ -1729,10 +1729,10 @@ static ssize_t fw_name_store(struct wcd_cpe_core *core,
|
|||
if (pos)
|
||||
copy_count = pos - buf;
|
||||
|
||||
if (copy_count > WCD_CPE_IMAGE_FNAME_MAX) {
|
||||
if (copy_count > (WCD_CPE_IMAGE_FNAME_MAX - 1)) {
|
||||
dev_err(core->dev,
|
||||
"%s: Invalid length %d, max allowed %d\n",
|
||||
__func__, copy_count, WCD_CPE_IMAGE_FNAME_MAX);
|
||||
__func__, copy_count, WCD_CPE_IMAGE_FNAME_MAX - 1);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -1826,7 +1826,7 @@ static struct snd_soc_dai_link apq8084_dai_links[] = {
|
|||
.name = "APQ8084 Compr8",
|
||||
.stream_name = "COMPR8",
|
||||
.cpu_dai_name = "MultiMedia8",
|
||||
.platform_name = "msm-compr-dsp",
|
||||
.platform_name = "msm-compress-dsp",
|
||||
.dynamic = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
|
|
|
@ -3046,7 +3046,7 @@ static struct snd_soc_dai_link apq8084_common_dai_links[] = {
|
|||
.name = "APQ8084 Compr8",
|
||||
.stream_name = "COMPR8",
|
||||
.cpu_dai_name = "MultiMedia8",
|
||||
.platform_name = "msm-compr-dsp",
|
||||
.platform_name = "msm-compress-dsp",
|
||||
.dynamic = 1,
|
||||
.async_ops = ASYNC_DPCM_SND_SOC_PREPARE
|
||||
| ASYNC_DPCM_SND_SOC_HW_PARAMS,
|
||||
|
|
|
@ -1495,7 +1495,7 @@ static struct snd_soc_dai_link msm8226_common_dai[] = {
|
|||
.name = "MSM8226 Compr8",
|
||||
.stream_name = "COMPR8",
|
||||
.cpu_dai_name = "MultiMedia8",
|
||||
.platform_name = "msm-compr-dsp",
|
||||
.platform_name = "msm-compress-dsp",
|
||||
.dynamic = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
|
|
|
@ -2164,7 +2164,7 @@ static struct snd_soc_dai_link msm8974_common_dai_links[] = {
|
|||
.name = "MSM8974 Compr8",
|
||||
.stream_name = "COMPR8",
|
||||
.cpu_dai_name = "MultiMedia8",
|
||||
.platform_name = "msm-compr-dsp",
|
||||
.platform_name = "msm-compress-dsp",
|
||||
.dynamic = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
|
|
|
@ -2572,7 +2572,7 @@ static struct snd_soc_dai_link msm8994_common_dai_links[] = {
|
|||
.name = "MSM8994 Compr8",
|
||||
.stream_name = "COMPR8",
|
||||
.cpu_dai_name = "MultiMedia8",
|
||||
.platform_name = "msm-compr-dsp",
|
||||
.platform_name = "msm-compress-dsp",
|
||||
.dynamic = 1,
|
||||
.trigger = {SND_SOC_DPCM_TRIGGER_POST,
|
||||
SND_SOC_DPCM_TRIGGER_POST},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
snd-soc-qdsp6v2-objs += msm-dai-q6-v2.o msm-pcm-q6-v2.o msm-pcm-routing-v2.o \
|
||||
msm-compress-q6-v2.o msm-compr-q6-v2.o \
|
||||
msm-compress-q6-v2.o \
|
||||
msm-pcm-lpa-v2.o \
|
||||
msm-pcm-afe-v2.o msm-pcm-voip-v2.o \
|
||||
msm-pcm-voice-v2.o msm-dai-q6-hdmi-v2.o \
|
||||
|
|
|
@ -605,7 +605,9 @@ done:
|
|||
return cal_block;
|
||||
err:
|
||||
kfree(cal_block->cal_info);
|
||||
cal_block->cal_info = NULL;
|
||||
kfree(cal_block->client_info);
|
||||
cal_block->client_info = NULL;
|
||||
kfree(cal_block);
|
||||
cal_block = NULL;
|
||||
return cal_block;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 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
|
||||
* only version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _MSM_COMPR_H
|
||||
#define _MSM_COMPR_H
|
||||
#include <sound/apr_audio-v2.h>
|
||||
#include <sound/q6asm-v2.h>
|
||||
#include <sound/compress_params.h>
|
||||
#include <sound/compress_offload.h>
|
||||
#include <sound/compress_driver.h>
|
||||
|
||||
#include "msm-pcm-q6-v2.h"
|
||||
|
||||
struct compr_info {
|
||||
struct snd_compr_caps compr_cap;
|
||||
struct snd_compr_codec_caps codec_caps;
|
||||
struct snd_compr_params codec_param;
|
||||
};
|
||||
|
||||
struct compr_audio {
|
||||
struct msm_audio prtd;
|
||||
struct compr_info info;
|
||||
uint32_t codec;
|
||||
};
|
||||
|
||||
#endif /*_MSM_COMPR_H*/
|
|
@ -1148,7 +1148,7 @@ static int msm_lsm_ioctl_compat(struct snd_pcm_substream *substream,
|
|||
}
|
||||
|
||||
size = sizeof(*user) + userarg32.payload_size;
|
||||
user = kmalloc(size, GFP_KERNEL);
|
||||
user = kzalloc(size, GFP_KERNEL);
|
||||
if (!user) {
|
||||
dev_err(rtd->dev,
|
||||
"%s: Allocation failed event status size %d\n",
|
||||
|
@ -1169,7 +1169,7 @@ static int msm_lsm_ioctl_compat(struct snd_pcm_substream *substream,
|
|||
err = -EFAULT;
|
||||
}
|
||||
if (!err) {
|
||||
user32 = kmalloc(size, GFP_KERNEL);
|
||||
user32 = kzalloc(size, GFP_KERNEL);
|
||||
if (!user32) {
|
||||
dev_err(rtd->dev,
|
||||
"%s: Allocation event user status size %d\n",
|
||||
|
@ -1582,7 +1582,7 @@ static int msm_lsm_ioctl(struct snd_pcm_substream *substream,
|
|||
|
||||
size = sizeof(struct snd_lsm_event_status) +
|
||||
userarg.payload_size;
|
||||
user = kmalloc(size, GFP_KERNEL);
|
||||
user = kzalloc(size, GFP_KERNEL);
|
||||
if (!user) {
|
||||
dev_err(rtd->dev,
|
||||
"%s: Allocation failed event status size %d\n",
|
||||
|
|
Loading…
Reference in New Issue