From patchwork Tue Jul 8 09:41:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Molton X-Patchwork-Id: 4503391 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 47A309F392 for ; Tue, 8 Jul 2014 09:41:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A59020170 for ; Tue, 8 Jul 2014 09:41:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 36E9A20158 for ; Tue, 8 Jul 2014 09:41:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753322AbaGHJl1 (ORCPT ); Tue, 8 Jul 2014 05:41:27 -0400 Received: from ducie-dc1.codethink.co.uk ([185.25.241.215]:37429 "EHLO ducie-dc1.codethink.co.uk" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753215AbaGHJl0 (ORCPT ); Tue, 8 Jul 2014 05:41:26 -0400 Received: from localhost (localhost [127.0.0.1]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTP id 060FE46EBB5; Tue, 8 Jul 2014 10:41:25 +0100 (BST) X-Virus-Scanned: Debian amavisd-new at ducie-dc1.codethink.co.uk Received: from ducie-dc1.codethink.co.uk ([127.0.0.1]) by localhost (ducie-dc1.codethink.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wincVSyETHVF; Tue, 8 Jul 2014 10:41:20 +0100 (BST) Received: from snark.dyn.ducie.codethink.co.uk (snark.dyn.ducie.codethink.co.uk [10.24.1.196]) by ducie-dc1.codethink.co.uk (Postfix) with ESMTPS id 0CB6A46E1BA; Tue, 8 Jul 2014 10:41:19 +0100 (BST) Received: from ian by snark.dyn.ducie.codethink.co.uk with local (Exim 4.82) (envelope-from ) id 1X4Rtl-0001zr-28; Tue, 08 Jul 2014 10:41:17 +0100 From: Ian Molton To: linux-media@vger.kernel.org Cc: linux-kernel@lists.codethink.co.uk, ian.molton@codethink.co.uk, g.liakhovetski@gmx.de, m.chehab@samsung.com, vladimir.barinov@cogentembedded.com, magnus.damm@gmail.com, horms@verge.net.au, linux-sh@vger.kernel.org Subject: [PATCH 1/4] media: rcar_vin: Dont aggressively retire buffers Date: Tue, 8 Jul 2014 10:41:11 +0100 Message-Id: <1404812474-7627-2-git-send-email-ian.molton@codethink.co.uk> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404812474-7627-1-git-send-email-ian.molton@codethink.co.uk> References: <1404812474-7627-1-git-send-email-ian.molton@codethink.co.uk> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP rcar_vin_videobuf_release() is called once per buffer from the buf_cleanup hook. There is no need to look up the queue and free all buffers at this point. Signed-off-by: Ian Molton Signed-off-by: William Towle --- drivers/media/platform/soc_camera/rcar_vin.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/soc_camera/rcar_vin.c b/drivers/media/platform/soc_camera/rcar_vin.c index e594230..7154500 100644 --- a/drivers/media/platform/soc_camera/rcar_vin.c +++ b/drivers/media/platform/soc_camera/rcar_vin.c @@ -493,17 +493,11 @@ static void rcar_vin_videobuf_release(struct vb2_buffer *vb) * to release could be any of the current buffers in use, so * release all buffers that are in use by HW */ - for (i = 0; i < MAX_BUFFER_NUM; i++) { - if (priv->queue_buf[i]) { - vb2_buffer_done(priv->queue_buf[i], - VB2_BUF_STATE_ERROR); - priv->queue_buf[i] = NULL; - } - } - } else { - list_del_init(to_buf_list(vb)); + priv->queue_buf[i] = NULL; } + list_del_init(to_buf_list(vb)); + spin_unlock_irq(&priv->lock); }