summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSachin Nikam <snikam@nvidia.com>2011-06-30 21:10:05 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-07-29 16:59:39 -0700
commit3af892d90c76c3df8959400d654f4f357c1cb18d (patch)
treecbc6f2bb5702d9fd801a9c4be93c0fd0b632eded /drivers
parent3c91facd90b09c02d9df9f7eb14ed3b7614aabba (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) Reviewed-on: http://git-master/r/40596 (cherry picked from commit 6c78fcbf8a0206aece5eb7e972ba1e1e84276ba4) Change-Id: I7ce56be10dc84fcb2a43916258d1c1deaf1b7d8d Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/42796 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/tegra/avp/avp_svc.c16
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 aecb8606497f..249b7daf008d 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;
}