From patchwork Wed Mar 24 15:01:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 11698 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 92046C32E5 for ; Wed, 24 Mar 2021 15:01:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4852F68D6D; Wed, 24 Mar 2021 16:01:37 +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="pDTQDi5z"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8118E602E3 for ; Wed, 24 Mar 2021 16:01:32 +0100 (CET) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 145928F3; Wed, 24 Mar 2021 16:01:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1616598092; bh=+DxDbIUa9hnNztgGs3b/btCSQklwvSzv9ZM90nyBzsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pDTQDi5zpgg+V9I80WMdtxDDh5WD/jX/rgY1K9793FoEyiQ4G6mndx8rdZ3ZJ5OVC 4TfR0o5GTeYWa8AU2cVNwgYotjuJ9lpsHsDBLRClzhml5Cs43KuPnCI1gVqbItB/oD Lr0YfIuBkdUu+7ZkF3fXsRwlmbIXHx8MjEzyXj/g= From: Kieran Bingham To: libcamera devel Date: Wed, 24 Mar 2021 15:01:23 +0000 Message-Id: <20210324150125.1318325-5-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210324150125.1318325-1-kieran.bingham@ideasonboard.com> References: <20210324150125.1318325-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/6] libcamera: pipeline: ipu3: Stop IPA before stopping devices 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" The IPA should be stopped before the hardware devices to ensure that all asynchronous actions have completed within the IPA before resources are removed and released. Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/ipu3/ipu3.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index fc40dcb381ea..34ee600340b1 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -764,13 +764,13 @@ void PipelineHandlerIPU3::stop(Camera *camera) IPU3CameraData *data = cameraData(camera); int ret = 0; + data->ipa_->stop(); + ret |= data->imgu_->stop(); ret |= data->cio2_.stop(); if (ret) LOG(IPU3, Warning) << "Failed to stop camera " << camera->id(); - data->ipa_->stop(); - freeBuffers(camera); }