Loading drivers/soc/qcom/rpm_log.c +5 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ struct msm_rpm_log_buffer { char *data; u32 len; u32 pos; struct mutex mutex; u32 max_len; u32 read_idx; struct msm_rpm_log_platform_data *pdata; Loading Loading @@ -216,6 +217,7 @@ static ssize_t msm_rpm_log_file_read(struct file *file, char __user *bufu, if (!access_ok(VERIFY_WRITE, bufu, count)) return -EFAULT; mutex_lock(&buf->mutex); /* check for more messages if local buffer empty */ if (buf->pos == buf->len) { buf->pos = 0; Loading @@ -224,6 +226,7 @@ static ssize_t msm_rpm_log_file_read(struct file *file, char __user *bufu, } if ((file->f_flags & O_NONBLOCK) && buf->len == 0) mutex_unlock(&buf->mutex); return -EAGAIN; /* loop until new messages arrive */ Loading @@ -239,6 +242,7 @@ static ssize_t msm_rpm_log_file_read(struct file *file, char __user *bufu, remaining = __copy_to_user(bufu, &(buf->data[buf->pos]), out_len); buf->pos += out_len - remaining; mutex_unlock(&buf->mutex); return out_len - remaining; } Loading Loading @@ -285,6 +289,7 @@ static int msm_rpm_log_file_open(struct inode *inode, struct file *file) buf->pdata = pdata; buf->len = 0; buf->pos = 0; mutex_init(&buf->mutex); buf->max_len = PRINTED_LENGTH(pdata->log_len); buf->read_idx = msm_rpm_log_read(pdata, MSM_RPM_LOG_PAGE_INDICES, MSM_RPM_LOG_HEAD); Loading Loading
drivers/soc/qcom/rpm_log.c +5 −0 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ struct msm_rpm_log_buffer { char *data; u32 len; u32 pos; struct mutex mutex; u32 max_len; u32 read_idx; struct msm_rpm_log_platform_data *pdata; Loading Loading @@ -216,6 +217,7 @@ static ssize_t msm_rpm_log_file_read(struct file *file, char __user *bufu, if (!access_ok(VERIFY_WRITE, bufu, count)) return -EFAULT; mutex_lock(&buf->mutex); /* check for more messages if local buffer empty */ if (buf->pos == buf->len) { buf->pos = 0; Loading @@ -224,6 +226,7 @@ static ssize_t msm_rpm_log_file_read(struct file *file, char __user *bufu, } if ((file->f_flags & O_NONBLOCK) && buf->len == 0) mutex_unlock(&buf->mutex); return -EAGAIN; /* loop until new messages arrive */ Loading @@ -239,6 +242,7 @@ static ssize_t msm_rpm_log_file_read(struct file *file, char __user *bufu, remaining = __copy_to_user(bufu, &(buf->data[buf->pos]), out_len); buf->pos += out_len - remaining; mutex_unlock(&buf->mutex); return out_len - remaining; } Loading Loading @@ -285,6 +289,7 @@ static int msm_rpm_log_file_open(struct inode *inode, struct file *file) buf->pdata = pdata; buf->len = 0; buf->pos = 0; mutex_init(&buf->mutex); buf->max_len = PRINTED_LENGTH(pdata->log_len); buf->read_idx = msm_rpm_log_read(pdata, MSM_RPM_LOG_PAGE_INDICES, MSM_RPM_LOG_HEAD); Loading