From patchwork Mon Mar 16 21:00:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helen Mae Koike Fornazier X-Patchwork-Id: 11441303 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 252DF14E5 for ; Mon, 16 Mar 2020 21:01:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 F3CA4205ED for ; Mon, 16 Mar 2020 21:01:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="I3Ubmwpr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3CA4205ED 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=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=c1a7IkVtvKAZc418hb055izZad6Z/AknJtRtMnKAfTw=; b=I3UbmwprqvutcG XB+dcTHxRUXMmK61dK9kqK5EgepbTrQ3l6VPRQE6qbrjetc+35ixMVF304IJg/oeQxiJ15p0spz4d sSR0ha68v6eM84fo/iJa8pnpRHdKw41Jn/v7SpXXo9CDi7fYBzs8T3zp6PPNLYaA2M67MDYSnO4gW 8IPZfSRzqdCkvh6Ke0RD/NbMXCt60zIz9RNXR4xor+M8sep2fcpTpaES+IXdWJKaxkJuLV/QVPR0G 8vQ+JXeG0ikfBRqkVzKEbnTGbVbwTZ1sl1qkgHijaFeKG2SdcMz4cObuFk4lL53GczP9m+D2giryi /aLUFBnjVDycTgP5oOnw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jDwr7-0003ko-7r; Mon, 16 Mar 2020 21:01:01 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jDwr4-0003jJ-Oh for linux-rockchip@lists.infradead.org; Mon, 16 Mar 2020 21:01:00 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 0CE48291A70 From: Helen Koike To: linux-media@vger.kernel.org Subject: [PATCH v2 1/2] media: staging: rkisp1: cap: fix return values from pm functions Date: Mon, 16 Mar 2020 18:00:43 -0300 Message-Id: <20200316210044.595312-2-helen.koike@collabora.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200316210044.595312-1-helen.koike@collabora.com> References: <20200316210044.595312-1-helen.koike@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200316_140058_927488_945358B1 X-CRM114-Status: UNSURE ( 8.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 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, linux-kernel@vger.kernel.org, tfiga@chromium.org, linux-rockchip@lists.infradead.org, Helen Koike , hans.verkuil@cisco.com, kernel@collabora.com Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org If no errors occurs, pm functions return usage counters, so they can return positive numbers. This happens when streaming from multiple capture devices (mainpath and selfpath). Fix simultaneous streaming from mainpath and selfpath by not failing when pm usage counters returns a positive number. Signed-off-by: Helen Koike --- Changes in v2: - Rebased on media/master drivers/staging/media/rkisp1/rkisp1-capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c index 24fe6a7888aa..967bd05b4507 100644 --- a/drivers/staging/media/rkisp1/rkisp1-capture.c +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c @@ -939,7 +939,7 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue) v4l2_pipeline_pm_put(&node->vdev.entity); ret = pm_runtime_put(rkisp1->dev); - if (ret) + if (ret < 0) dev_err(rkisp1->dev, "power down failed error:%d\n", ret); rkisp1_dummy_buf_destroy(cap); @@ -992,7 +992,7 @@ rkisp1_vb2_start_streaming(struct vb2_queue *queue, unsigned int count) goto err_ret_buffers; ret = pm_runtime_get_sync(cap->rkisp1->dev); - if (ret) { + if (ret < 0) { dev_err(cap->rkisp1->dev, "power up failed %d\n", ret); goto err_destroy_dummy; }