[{"id":18035,"web_url":"https://patchwork.libcamera.org/comment/18035/","msgid":"<80cab80d-1059-8887-bff9-1fcdae65a6af@ideasonboard.com>","date":"2021-07-08T15:41:25","subject":"Re: [libcamera-devel] [PATCH v2 2/2] utils: ipc: proxy: Reset\n\tControlSerializer during IPA configure","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Umang,\n\nOn 08/07/2021 11:54, Umang Jain wrote:\n> ControlSerializer should be reset during IPA (re)configuration,\n> so that it doesn't look up stale deserialized cache built from\n> consecutive previous runs. This is already recommended in\n> ControlSerializer docs but the implementation seems missing.\n> \n> The stale cache lookup seems to the core issue with Bug #58.\n\nYikes. I guess this is also partially related to\nhttps://bugs.libcamera.org/show_bug.cgi?id=31, but that is showing a\nslightly different symptom of the effects of having to synchronise\ncontrol lists across the IPC.\n\n> Bug: https://bugs.libcamera.org/show_bug.cgi?id=58\n> Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>\n> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\nTested locally, and fixes things as far as I can tell.\n\nIndeed there are further issues that appear after this related to an fd\nleak, but they are separate and I do not believe caused by this patch\n(but only visible when the system can run long enough thanks to this fix).\n\nTested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl   | 3 +++\n>  1 file changed, 3 insertions(+)\n> \n> diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> index 5a64fe9c..a4e008c7 100644\n> --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl\n> @@ -184,6 +184,9 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)\n>  \n>  {{proxy_funcs.func_sig(proxy_name, method, \"IPC\")}}\n>  {\n> +{%- if method.mojom_name == \"configure\" %}\n> +\tcontrolSerializer_.reset();\n> +{%- endif %}\n>  {%- set has_output = true if method|method_param_outputs|length > 0 or method|method_return_value != \"void\" %}\n>  {%- set cmd = cmd_enum_name + \"::\" + method.mojom_name|cap %}\n>  \tIPCMessage::Header _header = { static_cast<uint32_t>({{cmd}}), seq_++ };\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CC517C3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  8 Jul 2021 15:41:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DD07A6851F;\n\tThu,  8 Jul 2021 17:41:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6EAE768506\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  8 Jul 2021 17:41:28 +0200 (CEST)","from [192.168.0.20]\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E3F89E7;\n\tThu,  8 Jul 2021 17:41:27 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Ta5J1UE6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1625758888;\n\tbh=+3H0z6Rtuwvv4aFiB+hzI/owSwJV87VD7XO3mtbHpXs=;\n\th=To:References:From:Subject:Date:In-Reply-To:From;\n\tb=Ta5J1UE68DPztKntd6SYSRZTbR6nxDwWDnb1YI99wVrpN47sY2Vc0zwjRI59qq+2S\n\t1TSyc40JHhIZJNNa1iKgpeltIvMMOGBE/BbdX3CBT16F3b61dUlod4ia3B17X6wZpm\n\tli64mk92ChMbdTymaLjQdg2Wo9Wwh7jC51fv3k2s=","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20210708105405.147172-1-umang.jain@ideasonboard.com>\n\t<20210708105405.147172-3-umang.jain@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<80cab80d-1059-8887-bff9-1fcdae65a6af@ideasonboard.com>","Date":"Thu, 8 Jul 2021 16:41:25 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.11.0","MIME-Version":"1.0","In-Reply-To":"<20210708105405.147172-3-umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-GB","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v2 2/2] utils: ipc: proxy: Reset\n\tControlSerializer during IPA configure","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]