Loading drivers/char/diag/diagfwd_peripheral.c +8 −4 Original line number Diff line number Diff line Loading @@ -908,8 +908,6 @@ void diagfwd_channel_read(struct diagfwd_info *fwd_info) } if (fwd_info->buf_1 && !atomic_read(&fwd_info->buf_1->in_busy)) { temp_buf = fwd_info->buf_1; atomic_set(&temp_buf->in_busy, 1); if (driver->feature[fwd_info->peripheral].encode_hdlc && (fwd_info->type == TYPE_DATA || fwd_info->type == TYPE_CMD)) { Loading @@ -919,9 +917,11 @@ void diagfwd_channel_read(struct diagfwd_info *fwd_info) read_buf = fwd_info->buf_1->data; read_len = fwd_info->buf_1->len; } } else if (fwd_info->buf_2 && !atomic_read(&fwd_info->buf_2->in_busy)) { temp_buf = fwd_info->buf_2; if (read_buf) { temp_buf = fwd_info->buf_1; atomic_set(&temp_buf->in_busy, 1); } } else if (fwd_info->buf_2 && !atomic_read(&fwd_info->buf_2->in_busy)) { if (driver->feature[fwd_info->peripheral].encode_hdlc && (fwd_info->type == TYPE_DATA || fwd_info->type == TYPE_CMD)) { Loading @@ -931,6 +931,10 @@ void diagfwd_channel_read(struct diagfwd_info *fwd_info) read_buf = fwd_info->buf_2->data; read_len = fwd_info->buf_2->len; } if (read_buf) { temp_buf = fwd_info->buf_2; atomic_set(&temp_buf->in_busy, 1); } } else { pr_debug("diag: In %s, both buffers are empty for p: %d, t: %d\n", __func__, fwd_info->peripheral, fwd_info->type); Loading drivers/char/diag/diagfwd_smd.c +2 −3 Original line number Diff line number Diff line Loading @@ -740,14 +740,13 @@ static int diag_smd_read(void *ctxt, unsigned char *buf, int buf_len) } /* * In this case don't reset the buffers as there is no need to further * read over peripherals. Also release the wake source hold earlier. * Reset the buffers. Also release the wake source hold earlier. */ if (atomic_read(&smd_info->diag_state) == 0) { DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s closing read thread. diag state is closed\n", smd_info->name); diag_ws_release(); diagfwd_channel_read_done(smd_info->fwd_ctxt, buf, 0); return 0; } Loading Loading
drivers/char/diag/diagfwd_peripheral.c +8 −4 Original line number Diff line number Diff line Loading @@ -908,8 +908,6 @@ void diagfwd_channel_read(struct diagfwd_info *fwd_info) } if (fwd_info->buf_1 && !atomic_read(&fwd_info->buf_1->in_busy)) { temp_buf = fwd_info->buf_1; atomic_set(&temp_buf->in_busy, 1); if (driver->feature[fwd_info->peripheral].encode_hdlc && (fwd_info->type == TYPE_DATA || fwd_info->type == TYPE_CMD)) { Loading @@ -919,9 +917,11 @@ void diagfwd_channel_read(struct diagfwd_info *fwd_info) read_buf = fwd_info->buf_1->data; read_len = fwd_info->buf_1->len; } } else if (fwd_info->buf_2 && !atomic_read(&fwd_info->buf_2->in_busy)) { temp_buf = fwd_info->buf_2; if (read_buf) { temp_buf = fwd_info->buf_1; atomic_set(&temp_buf->in_busy, 1); } } else if (fwd_info->buf_2 && !atomic_read(&fwd_info->buf_2->in_busy)) { if (driver->feature[fwd_info->peripheral].encode_hdlc && (fwd_info->type == TYPE_DATA || fwd_info->type == TYPE_CMD)) { Loading @@ -931,6 +931,10 @@ void diagfwd_channel_read(struct diagfwd_info *fwd_info) read_buf = fwd_info->buf_2->data; read_len = fwd_info->buf_2->len; } if (read_buf) { temp_buf = fwd_info->buf_2; atomic_set(&temp_buf->in_busy, 1); } } else { pr_debug("diag: In %s, both buffers are empty for p: %d, t: %d\n", __func__, fwd_info->peripheral, fwd_info->type); Loading
drivers/char/diag/diagfwd_smd.c +2 −3 Original line number Diff line number Diff line Loading @@ -740,14 +740,13 @@ static int diag_smd_read(void *ctxt, unsigned char *buf, int buf_len) } /* * In this case don't reset the buffers as there is no need to further * read over peripherals. Also release the wake source hold earlier. * Reset the buffers. Also release the wake source hold earlier. */ if (atomic_read(&smd_info->diag_state) == 0) { DIAG_LOG(DIAG_DEBUG_PERIPHERALS, "%s closing read thread. diag state is closed\n", smd_info->name); diag_ws_release(); diagfwd_channel_read_done(smd_info->fwd_ctxt, buf, 0); return 0; } Loading