Loading drivers/rpmsg/rpm-smd.c +21 −19 Original line number Diff line number Diff line Loading @@ -94,8 +94,6 @@ struct msm_rpm_driver_data { uint32_t ch_type; struct smd_channel *ch_info; struct work_struct work; spinlock_t smd_lock_write; spinlock_t smd_lock_read; struct completion smd_open; }; Loading Loading @@ -206,7 +204,6 @@ enum rpm_msg_fmts { }; static struct rb_root tr_root = RB_ROOT; static int msm_rpm_send_smd_buffer(char *buf, uint32_t size); static uint32_t msm_rpm_get_next_msg_id(void); static inline uint32_t get_offset_value(uint32_t val, uint32_t offset, Loading Loading @@ -705,6 +702,24 @@ static struct msm_rpm_driver_data msm_rpm_data = { .smd_open = COMPLETION_INITIALIZER(msm_rpm_data.smd_open), }; static int trysend_count = 20; module_param(trysend_count, int, 0664); static int msm_rpm_trysend_smd_buffer(char *buf, uint32_t size) { int ret; int count = 0; do { ret = rpmsg_trysend(rpm->rpm_channel, buf, size); if (!ret) break; udelay(10); count++; } while (count < trysend_count); return ret; } static int msm_rpm_flush_requests(bool print) { struct rb_node *t; Loading @@ -722,8 +737,8 @@ static int msm_rpm_flush_requests(bool print) set_msg_id(s->buf, msm_rpm_get_next_msg_id()); ret = msm_rpm_send_smd_buffer(s->buf, get_buf_len(s->buf)); ret = msm_rpm_trysend_smd_buffer(s->buf, get_buf_len(s->buf)); WARN_ON(ret != 0); trace_rpm_smd_send_sleep_set(get_msg_id(s->buf), type, id); Loading Loading @@ -1185,17 +1200,6 @@ static void msm_rpm_log_request(struct msm_rpm_request *cdata) pr_info("request info %s\n", buf); } static int msm_rpm_send_smd_buffer(char *buf, uint32_t size) { unsigned long flags; int ret; spin_lock_irqsave(&msm_rpm_data.smd_lock_write, flags); ret = rpmsg_send(rpm->rpm_channel, buf, size); spin_unlock_irqrestore(&msm_rpm_data.smd_lock_write, flags); return ret; } static int msm_rpm_send_data(struct msm_rpm_request *cdata, int msg_type, bool noack) { Loading Loading @@ -1290,7 +1294,7 @@ static int msm_rpm_send_data(struct msm_rpm_request *cdata, msm_rpm_add_wait_list(msg_id, noack); ret = msm_rpm_send_smd_buffer(&cdata->buf[0], msg_size); ret = rpmsg_send(rpm->rpm_channel, &cdata->buf[0], msg_size); if (!ret) { for (i = 0; (i < cdata->write_idx); i++) Loading Loading @@ -1604,8 +1608,6 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) mutex_init(&rpm->lock); init_completion(&rpm->ack); spin_lock_init(&msm_rpm_data.smd_lock_write); spin_lock_init(&msm_rpm_data.smd_lock_read); skip_init: probe_status = of_platform_populate(p, NULL, NULL, &rpdev->dev); Loading Loading
drivers/rpmsg/rpm-smd.c +21 −19 Original line number Diff line number Diff line Loading @@ -94,8 +94,6 @@ struct msm_rpm_driver_data { uint32_t ch_type; struct smd_channel *ch_info; struct work_struct work; spinlock_t smd_lock_write; spinlock_t smd_lock_read; struct completion smd_open; }; Loading Loading @@ -206,7 +204,6 @@ enum rpm_msg_fmts { }; static struct rb_root tr_root = RB_ROOT; static int msm_rpm_send_smd_buffer(char *buf, uint32_t size); static uint32_t msm_rpm_get_next_msg_id(void); static inline uint32_t get_offset_value(uint32_t val, uint32_t offset, Loading Loading @@ -705,6 +702,24 @@ static struct msm_rpm_driver_data msm_rpm_data = { .smd_open = COMPLETION_INITIALIZER(msm_rpm_data.smd_open), }; static int trysend_count = 20; module_param(trysend_count, int, 0664); static int msm_rpm_trysend_smd_buffer(char *buf, uint32_t size) { int ret; int count = 0; do { ret = rpmsg_trysend(rpm->rpm_channel, buf, size); if (!ret) break; udelay(10); count++; } while (count < trysend_count); return ret; } static int msm_rpm_flush_requests(bool print) { struct rb_node *t; Loading @@ -722,8 +737,8 @@ static int msm_rpm_flush_requests(bool print) set_msg_id(s->buf, msm_rpm_get_next_msg_id()); ret = msm_rpm_send_smd_buffer(s->buf, get_buf_len(s->buf)); ret = msm_rpm_trysend_smd_buffer(s->buf, get_buf_len(s->buf)); WARN_ON(ret != 0); trace_rpm_smd_send_sleep_set(get_msg_id(s->buf), type, id); Loading Loading @@ -1185,17 +1200,6 @@ static void msm_rpm_log_request(struct msm_rpm_request *cdata) pr_info("request info %s\n", buf); } static int msm_rpm_send_smd_buffer(char *buf, uint32_t size) { unsigned long flags; int ret; spin_lock_irqsave(&msm_rpm_data.smd_lock_write, flags); ret = rpmsg_send(rpm->rpm_channel, buf, size); spin_unlock_irqrestore(&msm_rpm_data.smd_lock_write, flags); return ret; } static int msm_rpm_send_data(struct msm_rpm_request *cdata, int msg_type, bool noack) { Loading Loading @@ -1290,7 +1294,7 @@ static int msm_rpm_send_data(struct msm_rpm_request *cdata, msm_rpm_add_wait_list(msg_id, noack); ret = msm_rpm_send_smd_buffer(&cdata->buf[0], msg_size); ret = rpmsg_send(rpm->rpm_channel, &cdata->buf[0], msg_size); if (!ret) { for (i = 0; (i < cdata->write_idx); i++) Loading Loading @@ -1604,8 +1608,6 @@ static int qcom_smd_rpm_probe(struct rpmsg_device *rpdev) mutex_init(&rpm->lock); init_completion(&rpm->ack); spin_lock_init(&msm_rpm_data.smd_lock_write); spin_lock_init(&msm_rpm_data.smd_lock_read); skip_init: probe_status = of_platform_populate(p, NULL, NULL, &rpdev->dev); Loading