From patchwork Thu Jun 25 17:42:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11627333 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C13314F6 for ; Fri, 26 Jun 2020 12:02:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49DF22078D for ; Fri, 26 Jun 2020 12:02:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ODaRYg8b"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="HItPWgCN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49DF22078D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Jttgt5ETvYAT0xu43BbLE7/LRxHyDI0dnjhIt2+QHMo=; b=ODaRYg8bGPw/GgxPzQv5q0Nipe mCzxC9vd37Ao2qR8BBQc0dSAPCb8L4MwpxJhJ84pFnziqGCir11Pbacxd2/KBhkK47Y5YpVZyWtsM sLjaGMM9KxFHjVb39r7PfTmmNlzXfnchvecqq+bujxSXF3jOLhIoYmH40q8pnxef5EvLr9qcCCLuJ gcDx2xTPATvJbAsWtCQBeFPjn2f6RqjzzA2cS8MXZ9tE0hcPKWXEYbFm4LxI973xmniEuaxR5p+2s fV/BWc3NQ7CP/Ia5lnPXUqVE0VF2Y8Z771r5XMLVi9nEFAy6O3HXkWpbOanzaqNiv412dVc6N+UNC YWkimIig==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jon3e-0002Lt-3X; Fri, 26 Jun 2020 12:02:14 +0000 Received: from casper.infradead.org ([90.155.50.34]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jomUB-00022t-0y for linux-rockchip@merlin.infradead.org; Fri, 26 Jun 2020 11:25:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description; bh=YG3F6N+s7eTPk5kwyhEsOjCLUnn2MyeScYhj8C7IiFM=; b=HItPWgCN0t3tZaBq14PlP+MEzS B2ZhpkJcwkLTAFjnz7QJcPkeW7VY9hnjAfXJ8jNedMOPhklK6+GZGeGsQ2TluGsKrxvKrAeKiNNei cZ8uuvyQKPnWupRCpvY8F5dgjgZWMSFbmxj/uReyJj795npQ6Dtiqj80KdIE0a95NlQEdg7TWIYK4 bZirgzwt67h0SWB0flatoPwaPYaxaPLnMIHlsRfdaAvUIwx2vi78yicm992MYiP7Vx3zxvbt2NG8P BQoi55A+TXlOz1rAwW8KTuKGAk0QaNjB/wvYqTjEFn8ecaysMVq+1SazSOWAkCf2UsTgB6uXmx4SE sPhYQylQ==; Received: from bhuna.collabora.co.uk ([46.235.227.227]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jomOH-0006sN-1B for linux-rockchip@lists.infradead.org; Fri, 26 Jun 2020 11:19:33 +0000 Received: from localhost.localdomain (p200300cb8737cf00e4140a231ed1025d.dip0.t-ipconnect.de [IPv6:2003:cb:8737:cf00:e414:a23:1ed1:25d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 765732A5763; Thu, 25 Jun 2020 18:43:06 +0100 (BST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com Subject: [PATCH 3/3] media: staging: rkisp1: params: in 'stop_streaming' don't release the lock while returning buffers Date: Thu, 25 Jun 2020 19:42:57 +0200 Message-Id: <20200625174257.22216-4-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200625174257.22216-1-dafna.hirschfeld@collabora.com> References: <20200625174257.22216-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200626_121930_238211_246DB713 X-CRM114-Status: GOOD ( 11.86 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-1.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.235.227.227 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mchehab@kernel.org, dafna.hirschfeld@collabora.com, dafna3@gmail.com, tfiga@chromium.org, hverkuil@xs4all.nl, linux-rockchip@lists.infradead.org, helen.koike@collabora.com, sakari.ailus@linux.intel.com, kernel@collabora.com, ezequiel@collabora.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org In the stop_streaming callback 'rkisp1_params_vb2_stop_streaming' there is no need to release the lock 'config_lock' and then acquire it again at each iteration when returning all buffers. This is because the stream is about to end and there is no need to let the isr access a buffer. Signed-off-by: Dafna Hirschfeld --- drivers/staging/media/rkisp1/rkisp1-params.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-params.c b/drivers/staging/media/rkisp1/rkisp1-params.c index bf006dbeee2d..5169b02731f1 100644 --- a/drivers/staging/media/rkisp1/rkisp1-params.c +++ b/drivers/staging/media/rkisp1/rkisp1-params.c @@ -1488,19 +1488,13 @@ static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq) /* stop params input firstly */ spin_lock_irqsave(¶ms->config_lock, flags); params->is_streaming = false; - spin_unlock_irqrestore(¶ms->config_lock, flags); for (i = 0; i < RKISP1_ISP_PARAMS_REQ_BUFS_MAX; i++) { - spin_lock_irqsave(¶ms->config_lock, flags); if (!list_empty(¶ms->params)) { buf = list_first_entry(¶ms->params, struct rkisp1_buffer, queue); list_del(&buf->queue); - spin_unlock_irqrestore(¶ms->config_lock, - flags); } else { - spin_unlock_irqrestore(¶ms->config_lock, - flags); break; } @@ -1508,6 +1502,7 @@ static void rkisp1_params_vb2_stop_streaming(struct vb2_queue *vq) vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); buf = NULL; } + spin_unlock_irqrestore(¶ms->config_lock, flags); } static int