Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1170323ybh; Thu, 12 Mar 2020 18:47:21 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt3Rz/cLp23jfHuy00qcU6NFoL7MLUduKHppRWQCxHPvAX+McID4AhRGZHecbV97jk12G8k X-Received: by 2002:aca:75d5:: with SMTP id q204mr5185018oic.9.1584064041192; Thu, 12 Mar 2020 18:47:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584064041; cv=none; d=google.com; s=arc-20160816; b=NaYFFBEu+eSAGRDgTWMuacMJFDWVp9lhvHJQNG/1MzZndwvWjBDWL5q3OKSs+tBZan 6KqhRt+cRR4qXkWWuLNdO8GWDqEKg2qx0fUaaToBQd8+k0gcIgHJL5HtNdvhJ4CMExi6 dNMFHaUJzDGc+RRscmJb54b05L1Il8ctV2M5Aj4fy8FAgBaZgbeCmShpDwjiSq9qw3pw ljTjboQRleEEANnFDovK465z+yvg2MTC+n5cAhCbhKLVpH1zJ6qeM4ebJHL5wDPPqADG q9k7rzuHTPbpaq5OfUnY4diCl5Gc5rkUEYAnljp8ZTBx2kY834dO2dEjOarkMm1TfKFW W+gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lV0KVOp3cmkqZzMWcXyVAhjVzRG3rgetDf/wZXsRJWA=; b=ApyEYaHIoHS6V7VTKtOpOhWtZOLhM31a8rfIDWM4S2O/16R61hQiJjtpA0ROtAchgb CEJ00jKjUKXMVwdqTEpaY2iHb0Q4/VzPbxtq2z4z6VzZyChApJeTDO4paWHdoSbR37Pt Nifkr1jt+VDqV8Kwqu6gvwASiD7YAaKLWGnyAiTaRMSM8KiqwMtc4qI31KeRl8e6FCYy HCK0bOEr3+X4m5se8y9nnURabiJY96UQK5RSIYFf1iZP2HI9CNkxJNDkhpS3Ttfnr5M2 wMTo1Ur5fBcItWP1RvmaZepZ3QZc250K+LBGagp2/29HWIJMnLFHtWI9n4Zo6uM6Axq1 OVeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m138si3810197oig.53.2020.03.12.18.47.09; Thu, 12 Mar 2020 18:47:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726114AbgCMBqp (ORCPT + 99 others); Thu, 12 Mar 2020 21:46:45 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:48524 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbgCMBqp (ORCPT ); Thu, 12 Mar 2020 21:46:45 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id BA6EE296404 From: Helen Koike To: linux-media@vger.kernel.org Cc: mchehab@kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, linux-rockchip@lists.infradead.org, hans.verkuil@cisco.com, kernel@collabora.com, Helen Koike Subject: [PATCH 1/3] media: staging: rkisp1: cap: fix return values from pm functions Date: Thu, 12 Mar 2020 22:46:24 -0300 Message-Id: <20200313014626.3103091-2-helen.koike@collabora.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200313014626.3103091-1-helen.koike@collabora.com> References: <20200313014626.3103091-1-helen.koike@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- drivers/staging/media/rkisp1/rkisp1-capture.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c index 524e0dd38c1b..97091e5a6e6c 100644 --- a/drivers/staging/media/rkisp1/rkisp1-capture.c +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c @@ -938,11 +938,11 @@ static void rkisp1_vb2_stop_streaming(struct vb2_queue *queue) rkisp1_return_all_buffers(cap, VB2_BUF_STATE_ERROR); ret = v4l2_pipeline_pm_use(&node->vdev.entity, 0); - if (ret) + if (ret < 0) dev_err(rkisp1->dev, "pipeline close failed error:%d\n", ret); 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); @@ -995,12 +995,12 @@ 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; } ret = v4l2_pipeline_pm_use(entity, 1); - if (ret) { + if (ret < 0) { dev_err(cap->rkisp1->dev, "open cif pipeline failed %d\n", ret); goto err_pipe_pm_put; } -- 2.25.0