From patchwork Fri Mar 12 05:47:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11551 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C0582BD1F1 for ; Fri, 12 Mar 2021 05:47:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D527868C6C; Fri, 12 Mar 2021 06:47:32 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HaPVGNwr"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AA19E60106 for ; Fri, 12 Mar 2021 06:47:31 +0100 (CET) Received: from localhost.localdomain (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F52588F; Fri, 12 Mar 2021 06:47:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615528051; bh=XBxq67T/2f0IlEX9MkVUO/1oCLtNl6E1w3ob5hedNls=; h=From:To:Cc:Subject:Date:From; b=HaPVGNwrvyD6kvie4HYtxmz6UDg6XUO21dMLLkdqLPjbcH5OQiQo5b9tqe8RQ6c3Z 3EUBK+MCUk2Y5YvwHhikeMjKmyslu3XGJ28dhFMRt02r1xyrETvELW0T7cD/yD71c8 kLZgjG2K3/mgym5yd296n0iojm8tQAFtYr6YaQoc= From: Kieran Bingham To: libcamera devel Date: Fri, 12 Mar 2021 05:47:19 +0000 Message-Id: <20210312054727.852622-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/8] IPU3 Stability X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series continues the investigation and resolution of stability issues identified on the IPU3 platform and pipeline handler. Patches [1/8] and [2/8] are split from a test patch provided to me by Laurent, where I have added the commit messages. These ensure that messages sent by the IPA are handled correctly and do not race at stop() time Patch [3/8] was identified by valgrind and fixes an issue related to uninitialised accesses on the buffers. Patch [4/8] extends the state machine checks of the Camera to ensure that the pipeline handler does not queue requests out of state. Patch [5/8] is techincally the only remaining patch from v1 of the IPU3 stability series but now makes this condtion a fatal error to catch incorrect usages in pipeline handlers. Patch [6/8] has already been posted separately and is key to the resolution of the IPU3 IPA shutdown procedure fixes. Patch [7/8] adds a guarantee that all requests have completed before releasing buffers. This guarantee would fail before this series. It may be helpful to add this assertion to a common call in the pipeline handler base class, or to the CameraData as part of future developments. Patch [8/8] adds further assertions that the FrameInfo can be found during event handling from the IPA. This also would have failed before this series. Kieran Bingham (6): libcamera: buffer: Initialise status libcamera: camera: Validate requests are completed in Running state libcamera: v4l2_videodevice: Prevent queueing buffers without a cache libcamera: pipeline: ipu3: Stop IPA before stopping devices libcamera: pipeline: ipu3: Ensure no requests are pending at stop() libcamera: pipeline: ipu3: Fail if the FrameInfo can't be found Laurent Pinchart (2): utils: ipc: proxy: Assert asynchronous calls execute in the running state utils: ipc: proxy: Process pending messages include/libcamera/buffer.h | 4 ++-- src/libcamera/camera.cpp | 10 ++++++++-- src/libcamera/pipeline/ipu3/ipu3.cpp | 18 +++++++++++++++--- src/libcamera/v4l2_videodevice.cpp | 10 ++++++++++ .../module_ipa_proxy.cpp.tmpl | 2 ++ .../libcamera_templates/proxy_functions.tmpl | 6 ++++-- 6 files changed, 41 insertions(+), 9 deletions(-) Tested-by: Jacopo Mondi