From nobody Thu Apr 2 12:35:26 2026 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazon11010050.outbound.protection.outlook.com [40.93.198.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A0143890EF; Fri, 13 Mar 2026 09:09:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.198.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773392955; cv=fail; b=IX0FYEjLI/eaNeK2DQkuzmVplqkYyJymmCDBH3LWMNEZiYX+zN6ts6N59c9SZbuNp8ed2Z0emsdT07xSEGQg+P15RP9KQVV0XDYYw8AMpftNG3pqzhhZ+4aBED9unDR5PlFW3phfX5e2r+oH8Bo22h6o1awSVbrrbmk61jo+RnU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773392955; c=relaxed/simple; bh=53y8xeGVmpEijpguOumbkzeG9PAyByD959aRlt7WQi4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XRWdQhIut5PQXG2uUBK3T45IgSJQDfAjyDdL7/lKlXnB2hUk2ttWgFGbQI8BdX8UnLfYv8kJWkezeDLoBYACfWNJqU3T0lh+tYX/J6doDcr243Oit1XtTnAuHaWIT8slwjIq3GEhgZXcKnNW0vJXd7UGTQpHyTcVueIv/at+cj4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=FhUM3EKX; arc=fail smtp.client-ip=40.93.198.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="FhUM3EKX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gd8y0E+RTNtV81IFzLNwjbgnSst4d1LZh40MRkFnwtQnGHILTb63k3ZsZ1dMSukjjForU3cJLivQcUD+i+mZZqdYmdiY+5ZahNdKeh+Qzp0N+LfQa2X1lu6tfZPsjYET5tMevWiB5OzwEdWGwf2QvmXxuFInw1auSPi+oiFwJrTAqRqN7gK73IqJZ3+tKj/wNljxaZLfOPQ6NMvudKUjORHXWLC2IpP0kwANlfcwVbize2twP8InIPUswBLK2iEtzGAkHlQu/QfLT1beexM2IDV+mxCoyUWg0a2qYT/dugMv99cd8jrmU80wJLq1jlWQzvGSmJumKor3aZI6pnVRZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gqBpHcCrd+hs62WdlzeDw6pYebUPZwuUQu1jKPHpfxU=; b=zC8s2PWDDr9gbBykNgxUpqsCRNOchPPM5LbscsdK/IsfUs7DMS9ZpQ9YqtJa1yZSOnJTkfZWtmA8pNk5JPaEStw6sivKrnH7XGN9VsClmUOlmEBpIESwGGRgrT3T8JmHhPxDK8BNT4FlHxXs6ValQOBwJBMkQS7uUIwtO1cKjy/7vznbWDlCA/U1T7xi8ZgK3zJx33N+guJmNLfYDjQC3mMcWqHKdgmktHwzEp9MJxX8VpefzNhXfEfuL4mkAdCW22djxkfJ4qOJA9YO9vbaid8sB8fOO5pDFkRS5mYakfWDNHij08NPdC71K4rW6ur5tjWN6Ph6q148UafgN2UVkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.195) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gqBpHcCrd+hs62WdlzeDw6pYebUPZwuUQu1jKPHpfxU=; b=FhUM3EKXcJairnuoTFYQn6ebcSqI4DeoXdIewgZGonm2tAW7NfqjF1PfVRolQ1zHtI6iqIqDTnasM0U77uK9NwL/2uiPo7TwS4K7OgY3y8a8Rnp7qxx3yhUFlWFNhgzoSk8ysHsj6b188KWB2pP/X4ggDKVfxz59qtcUca8AQm4= Received: from MN2PR01CA0045.prod.exchangelabs.com (2603:10b6:208:23f::14) by MW5PR10MB5716.namprd10.prod.outlook.com (2603:10b6:303:1a3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9700.17; Fri, 13 Mar 2026 09:09:11 +0000 Received: from BL02EPF0001A107.namprd05.prod.outlook.com (2603:10b6:208:23f:cafe::e8) by MN2PR01CA0045.outlook.office365.com (2603:10b6:208:23f::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9678.27 via Frontend Transport; Fri, 13 Mar 2026 09:08:47 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.195) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.195 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.195; helo=flwvzet201.ext.ti.com; pr=C Received: from flwvzet201.ext.ti.com (198.47.21.195) by BL02EPF0001A107.mail.protection.outlook.com (10.167.241.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9700.17 via Frontend Transport; Fri, 13 Mar 2026 09:09:09 +0000 Received: from DFLE207.ent.ti.com (10.64.6.65) by flwvzet201.ext.ti.com (10.248.192.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Fri, 13 Mar 2026 04:08:41 -0500 Received: from DFLE206.ent.ti.com (10.64.6.64) by DFLE207.ent.ti.com (10.64.6.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Fri, 13 Mar 2026 04:08:41 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE206.ent.ti.com (10.64.6.64) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Fri, 13 Mar 2026 04:08:41 -0500 Received: from ws.dhcp.ti.com (ws.dhcp.ti.com [172.24.233.149]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 62D972bi274611; Fri, 13 Mar 2026 04:08:35 -0500 From: Rishikesh Donadkar To: , , CC: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v12 14/17] media: ti: j721e-csi2rx: Change the drain architecture for multistream Date: Fri, 13 Mar 2026 14:36:58 +0530 Message-ID: <20260313090701.646534-15-r-donadkar@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260313090701.646534-1-r-donadkar@ti.com> References: <20260313090701.646534-1-r-donadkar@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF0001A107:EE_|MW5PR10MB5716:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d4ffbb0-bb12-491c-24a5-08de80e02fa3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|36860700016|376014|82310400026|1800799024|22082099003|56012099003|18002099003; X-Microsoft-Antispam-Message-Info: 8kZN78wCdWgyE7ADC1axsXspAtek98OfRKGX4C9YPnJisDPlx/ymMJzvLlA+Xb7P94FYDdYh39VtwJaoMnDjK2U1yKygE9YHMYi2DzidRwuRnYLidn2OOpgPPa6M9GUWuyA6I2GuBtBjlx8Y4w8dDit4R23q+rY3VDvTZvzydUy/RqrBYOrjYZUGK/3bqm1KJ3De9qg5v4M7S1iX1kzABFktmgLB5aFO9V2J5t4fr58A3ddMWTDj/q2En+SMLPn+Q2v3YKHA6YW+pacTWR9r5sFWnsK4D/bHrWbmvfuHobONFTgmYcRmrKs42SDoUuNcx+gU8UNXY093dq4MGozCRb8AjQID9PP66C04Dx/xT8CUqWDsQMu9XBtSnUitMcdewIiIIYWK7q99eHxhwgTdlBg83Y/HVXoDmVkFkL1t79Qeu+MiPq2dnXRSbxFG7271gQOwncQyBnGFLS4jv6JKGRceXmivj6P/DlJgcsTE4BROap++TxaRWftWAkPvOd3lK59pzIotqPcXBEJlQFwxlEjoxsH/iHSzIOC7cGJQsqQGi8VBPQ+jVgsQp6+JUk1s9qkDgxw9uWTuHBUxDZhYK4mMxBM9IV035mjCIE+WTE60whUp7430hhIWttfThRD7bvwz3XUV2scTDO70neaS22KAUPGytCk/oJ3AgiqjgZupz6gBSwn5Vp/uXz8MSzHI/uuVfaAY3pkTZk2QkFKQjlxI/d9e0ocmIoAzMCKwMrTCIHo8yTPhFhKIZ35iJLWl0YUtbVt8JKhcIRekL4icLA== X-Forefront-Antispam-Report: CIP:198.47.21.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet201.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(7416014)(36860700016)(376014)(82310400026)(1800799024)(22082099003)(56012099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cr7K3mf4Cdk9OUf7/skpXiEKT0DdOVd50X9glFY9JKkkXzmAVhvwg/vn0Noe5VZX4ayCmS+kHfsXe0voZpDhpQnhlZe6jwVqK4oa74O9P2O6nVi1Xi7JceFRBQ0tZhIshHvn69LWttCqt+31Q1L4Y4v2VaHTyxejJZrSfGMuFxKzb+OrrcJGvGsIOkEO+jWOApFtP3455VlJw5JecovKgjVhHgbof5hXPo0Aw+zz2Vw0rOlFO8y7rwn/s8Uh1HARcTb5UM6wpkKxVjM1k5o6VbKL3suMeW9EuqsrZTFQh/ieUYbytkfh1TIOPSsUCKcDvc+xQfD24TBucRUISYWz9CnIlbQqPKpw5BkZ2Hg5AwLGcoTfU06g+wz8Ie2y89tY2SHxm3odHZr36jJ0sNTB1gRHF6NZbq9Qw/gpanOUUbd+QyVdLiNPbFdI7SiGO099 X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2026 09:09:09.2276 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d4ffbb0-bb12-491c-24a5-08de80e02fa3 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.195];Helo=[flwvzet201.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF0001A107.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR10MB5716 Content-Type: text/plain; charset="utf-8" On buffer starvation the DMA is marked IDLE, and the stale data in the internal FIFOs gets drained only on the next VIDIOC_QBUF call from the userspace. This approach works fine for a single stream case. But in multistream scenarios, buffer starvation for one stream can block the shared HW FIFO of the CSI2RX IP. This can stall the pipeline for all other streams, even if buffers are available for them. This patch introduces a new architecture, that continuously drains data from the shared HW FIFO into a small (32KiB) buffer if no buffers are made available to the driver from the userspace. This ensures independence between different streams, where a slower downstream element for one camera does not block streaming for other cameras. Additionally, after we drain for a stream, the next frame will be a partial frame, as a portion of its data will have already been drained before a valid buffer is queued by user space to the driver. Return the partial frame to user space with VB2_BUF_STATE_ERROR. Use wait for completion barrier to make sure the shared hardware FIFO is cleared of the data at the end of stream after the source has stopped sending data. Reviewed-by: Jai Luthra Reviewed-by: Yemike Abhilash Chandra Signed-off-by: Rishikesh Donadkar Reviewed-by: Tomi Valkeinen --- .../platform/ti/j721e-csi2rx/j721e-csi2rx.c | 121 +++++++++--------- 1 file changed, 58 insertions(+), 63 deletions(-) diff --git a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c b/driver= s/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c index 7d50b8dd8a6a4..dda8a66babeca 100644 --- a/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c +++ b/drivers/media/platform/ti/j721e-csi2rx/j721e-csi2rx.c @@ -82,8 +82,8 @@ struct ti_csi2rx_buffer { =20 enum ti_csi2rx_dma_state { TI_CSI2RX_DMA_STOPPED, /* Streaming not started yet. */ - TI_CSI2RX_DMA_IDLE, /* Streaming but no pending DMA operation. */ TI_CSI2RX_DMA_ACTIVE, /* Streaming and pending DMA operation. */ + TI_CSI2RX_DMA_DRAINING, /* Dumping all the data in drain buffer */ }; =20 struct ti_csi2rx_dma { @@ -109,6 +109,7 @@ struct ti_csi2rx_ctx { struct v4l2_format v_fmt; struct ti_csi2rx_dma dma; struct media_pad pad; + struct completion drain_complete; u32 sequence; u32 idx; u32 vc; @@ -249,6 +250,10 @@ static const struct ti_csi2rx_fmt ti_csi2rx_formats[] = =3D { static int ti_csi2rx_start_dma(struct ti_csi2rx_ctx *ctx, struct ti_csi2rx_buffer *buf); =20 +/* Forward declarations needed by ti_csi2rx_drain_callback. */ +static int ti_csi2rx_drain_dma(struct ti_csi2rx_ctx *ctx); +static int ti_csi2rx_dma_submit_pending(struct ti_csi2rx_ctx *ctx); + static const struct ti_csi2rx_fmt *find_format_by_fourcc(u32 pixelformat) { unsigned int i; @@ -608,9 +613,32 @@ static void ti_csi2rx_setup_shim(struct ti_csi2rx_ctx = *ctx) =20 static void ti_csi2rx_drain_callback(void *param) { - struct completion *drain_complete =3D param; + struct ti_csi2rx_ctx *ctx =3D param; + struct ti_csi2rx_dma *dma =3D &ctx->dma; + unsigned long flags; =20 - complete(drain_complete); + spin_lock_irqsave(&dma->lock, flags); + + if (dma->state =3D=3D TI_CSI2RX_DMA_STOPPED) { + complete(&ctx->drain_complete); + spin_unlock_irqrestore(&dma->lock, flags); + return; + } + + /* + * If dma->queue is empty, it indicates that no buffer has been + * provided by user space. In this case, initiate a transactions + * to drain the DMA. Since one drain of size DRAIN_BUFFER_SIZE + * will be done here, the subsequent frame will be a + * partial frame, with a size of frame_size - DRAIN_BUFFER_SIZE + */ + if (list_empty(&dma->queue)) { + if (ti_csi2rx_drain_dma(ctx)) + dev_warn(ctx->csi->dev, "DMA drain failed\n"); + } else { + ti_csi2rx_dma_submit_pending(ctx); + } + spin_unlock_irqrestore(&dma->lock, flags); } =20 /* @@ -628,12 +656,9 @@ static int ti_csi2rx_drain_dma(struct ti_csi2rx_ctx *c= tx) { struct ti_csi2rx_dev *csi =3D ctx->csi; struct dma_async_tx_descriptor *desc; - struct completion drain_complete; dma_cookie_t cookie; int ret; =20 - init_completion(&drain_complete); - desc =3D dmaengine_prep_slave_single(ctx->dma.chan, csi->drain.paddr, csi->drain.len, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); @@ -643,7 +668,7 @@ static int ti_csi2rx_drain_dma(struct ti_csi2rx_ctx *ct= x) } =20 desc->callback =3D ti_csi2rx_drain_callback; - desc->callback_param =3D &drain_complete; + desc->callback_param =3D ctx; =20 cookie =3D dmaengine_submit(desc); ret =3D dma_submit_error(cookie); @@ -652,13 +677,6 @@ static int ti_csi2rx_drain_dma(struct ti_csi2rx_ctx *c= tx) =20 dma_async_issue_pending(ctx->dma.chan); =20 - if (!wait_for_completion_timeout(&drain_complete, - msecs_to_jiffies(DRAIN_TIMEOUT_MS))) { - dmaengine_terminate_sync(ctx->dma.chan); - dev_dbg(csi->dev, "DMA transfer timed out for drain buffer\n"); - ret =3D -ETIMEDOUT; - goto out; - } out: return ret; } @@ -702,14 +720,24 @@ static void ti_csi2rx_dma_callback(void *param) spin_lock_irqsave(&dma->lock, flags); =20 WARN_ON(!list_is_first(&buf->list, &dma->submitted)); - vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); + + if (dma->state =3D=3D TI_CSI2RX_DMA_DRAINING) { + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); + dma->state =3D TI_CSI2RX_DMA_ACTIVE; + } else { + vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); + } + list_del(&buf->list); =20 ti_csi2rx_dma_submit_pending(ctx); =20 - if (list_empty(&dma->submitted)) - dma->state =3D TI_CSI2RX_DMA_IDLE; - + if (list_empty(&dma->submitted)) { + dma->state =3D TI_CSI2RX_DMA_DRAINING; + if (ti_csi2rx_drain_dma(ctx)) + dev_warn(ctx->csi->dev, + "DMA drain failed on one of the transactions\n"); + } spin_unlock_irqrestore(&dma->lock, flags); } =20 @@ -754,6 +782,8 @@ static void ti_csi2rx_stop_dma(struct ti_csi2rx_ctx *ct= x) dma->state =3D TI_CSI2RX_DMA_STOPPED; spin_unlock_irqrestore(&dma->lock, flags); =20 + init_completion(&ctx->drain_complete); + if (state !=3D TI_CSI2RX_DMA_STOPPED) { /* * Normal DMA termination does not clean up pending data on @@ -762,11 +792,19 @@ static void ti_csi2rx_stop_dma(struct ti_csi2rx_ctx *= ctx) * enforced before terminating DMA. */ ret =3D ti_csi2rx_drain_dma(ctx); - if (ret && ret !=3D -ETIMEDOUT) + if (ret) dev_warn(ctx->csi->dev, "Failed to drain DMA. Next frame might be bogus\n"); } =20 + /* We wait for the drain to complete so that the stream stops + * cleanly, making sure the shared hardware FIFO is cleared of + * data from the current stream. No more data will be coming from + * the source after this. + */ + wait_for_completion_timeout(&ctx->drain_complete, + msecs_to_jiffies(DRAIN_TIMEOUT_MS)); + ret =3D dmaengine_terminate_sync(ctx->dma.chan); if (ret) dev_err(ctx->csi->dev, "Failed to stop DMA: %d\n", ret); @@ -829,57 +867,14 @@ static void ti_csi2rx_buffer_queue(struct vb2_buffer = *vb) struct ti_csi2rx_ctx *ctx =3D vb2_get_drv_priv(vb->vb2_queue); struct ti_csi2rx_buffer *buf; struct ti_csi2rx_dma *dma =3D &ctx->dma; - bool restart_dma =3D false; unsigned long flags =3D 0; - int ret; =20 buf =3D container_of(vb, struct ti_csi2rx_buffer, vb.vb2_buf); buf->ctx =3D ctx; =20 spin_lock_irqsave(&dma->lock, flags); - /* - * Usually the DMA callback takes care of queueing the pending buffers. - * But if DMA has stalled due to lack of buffers, restart it now. - */ - if (dma->state =3D=3D TI_CSI2RX_DMA_IDLE) { - /* - * Do not restart DMA with the lock held because - * ti_csi2rx_drain_dma() might block for completion. - * There won't be a race on queueing DMA anyway since the - * callback is not being fired. - */ - restart_dma =3D true; - dma->state =3D TI_CSI2RX_DMA_ACTIVE; - } else { - list_add_tail(&buf->list, &dma->queue); - } + list_add_tail(&buf->list, &dma->queue); spin_unlock_irqrestore(&dma->lock, flags); - - if (restart_dma) { - /* - * Once frames start dropping, some data gets stuck in the DMA - * pipeline somewhere. So the first DMA transfer after frame - * drops gives a partial frame. This is obviously not useful to - * the application and will only confuse it. Issue a DMA - * transaction to drain that up. - */ - ret =3D ti_csi2rx_drain_dma(ctx); - if (ret && ret !=3D -ETIMEDOUT) - dev_warn(ctx->csi->dev, - "Failed to drain DMA. Next frame might be bogus\n"); - - spin_lock_irqsave(&dma->lock, flags); - ret =3D ti_csi2rx_start_dma(ctx, buf); - if (ret) { - vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); - dma->state =3D TI_CSI2RX_DMA_IDLE; - spin_unlock_irqrestore(&dma->lock, flags); - dev_err(ctx->csi->dev, "Failed to start DMA: %d\n", ret); - } else { - list_add_tail(&buf->list, &dma->submitted); - spin_unlock_irqrestore(&dma->lock, flags); - } - } } =20 static int ti_csi2rx_get_stream(struct ti_csi2rx_ctx *ctx) --=20 2.34.1