diff options
author | Sachin Nikam <snikam@nvidia.com> | 2011-06-30 21:10:05 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-07-18 19:04:48 -0700 |
commit | 6c78fcbf8a0206aece5eb7e972ba1e1e84276ba4 (patch) | |
tree | 8e74ee15ea50015385cd29be3bec6c49dcbc910d | |
parent | c0a5ebaa43e52b30ecb1f86d5ce7fa9a2325da8b (diff) |
media: tegra: avp: respond to unsupported service ids
AVP service driver responds error to AVP for invalid or unsupported
service IDs.
Bug 843473
Signed-off-by: Sachin Nikam <snikam@nvidia.com>
Reviewed-on: http://git-master/r/39225
(cherry picked from commit 11237d6a408d6ca7aea619e47b02ddf7e158945d)
Change-Id: I53d185b8b5a7cd720723a51ad7f0ad4aeafe3b3d
Reviewed-on: http://git-master/r/40596
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r-- | drivers/media/video/tegra/avp/avp_svc.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/media/video/tegra/avp/avp_svc.c b/drivers/media/video/tegra/avp/avp_svc.c index 4177bcb7d5bd..62cf76bb0ccb 100644 --- a/drivers/media/video/tegra/avp/avp_svc.c +++ b/drivers/media/video/tegra/avp/avp_svc.c @@ -457,7 +457,7 @@ static void do_svc_module_clock_set(struct avp_svc_info *avp_svc, aclk = &avp_svc->clks[mod->clk_req]; ret = clk_set_rate(aclk->clk, msg->clk_freq); if (ret) { - pr_err("avp_svc: Failed to set module (id = %d) frequency to %d kHz\n", + pr_err("avp_svc: Failed to set module (id = %d) frequency to %d Hz\n", msg->module_id, msg->clk_freq); resp.err = AVP_ERR_EINVAL; resp.act_freq = 0; @@ -476,6 +476,17 @@ send_response: sizeof(resp), GFP_KERNEL); } +static void do_svc_unsupported_msg(struct avp_svc_info *avp_svc, + u32 resp_svc_id) +{ + struct svc_common_resp resp; + + resp.err = AVP_ERR_ENOTSUP; + resp.svc_id = resp_svc_id; + trpc_send_msg(avp_svc->rpc_node, avp_svc->cpu_ep, &resp, + sizeof(resp), GFP_KERNEL); +} + static int dispatch_svc_message(struct avp_svc_info *avp_svc, struct svc_msg *msg, size_t len) @@ -563,7 +574,8 @@ static int dispatch_svc_message(struct avp_svc_info *avp_svc, do_svc_module_clock_set(avp_svc, msg, len); break; default: - pr_err("avp_svc: invalid SVC call 0x%x\n", msg->svc_id); + pr_warning("avp_svc: Unsupported SVC call 0x%x\n", msg->svc_id); + do_svc_unsupported_msg(avp_svc, msg->svc_id); ret = -ENOMSG; break; } |