Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp4073604ima; Mon, 4 Feb 2019 09:44:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IZr0nnV+t6C3GBxDHouwWkag8gmwZwK3zsAxY/AX9BTs8Z3WCfoW88EuYe4B480+PTS0bLg X-Received: by 2002:a63:4384:: with SMTP id q126mr505268pga.160.1549302245095; Mon, 04 Feb 2019 09:44:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549302245; cv=none; d=google.com; s=arc-20160816; b=ofwNmVfPuydTRs7iOWNZcCbCiLy7miUlPcRpTxhwmguhx1H6LYWzMELBlNt5BJhAIu OYnhfSnh/AJN/cxkXXZVRlTEq1RuxtXLmlB0whmTmXFcKrpNYQvhN4dVZYKAJou4U9ag XqZ6qzzD7B85ckKsc6T5Sum1rPHkXva1/sSzph3OJKG5R6uBQEi9nhLKqZus6shGfBBO q6ON4SlP6N7ouiEI6fzIpafBrsQ6IbZ+3jYGnwlBYrwA/fTGuzq76iU171LPyjk6Y8EJ xmT2huV1vRHht+dT4DfEW/KgAlrNdoZl4Ivy7baoyYs0FtynCDEtdKJyf9qTIF9Qtu23 eSlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=fOeezqHi7GegLsIn+Qx/ZXg67R58+rgNfvNy8foE1JM=; b=t7F87r1w/VNeR1A+zb9Rcm9Ep4a2Gn3bykOYicmGNE/GfT0ucCug3lxqGhWMRLDm/0 Z9QQejc/rtY6zajLe80B+WvFjxIr5X4JChXLUfAOhKpPVgiClrExEmCHSO7ekYqBd9Jw y97ogXZAX4YgTV64Q44uZ4jYtBeIndPcwyrcgLhG/ZdkFFM+Ec3u03H26HShKoIkJO1K 2knttb+Xc1dD0xFY9liNP3qU0iAp1CrYgc7mOIIWN6KGtytGG0momwoSSuefYoIh7w+1 dhxiKPv3z7sgpBXNk5xgoAIv2DIZ3JM0cJ50WecnbiMJYA3MsdQ7wPkeJc2/N9kj/rGy c+wA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si549219plk.296.2019.02.04.09.43.49; Mon, 04 Feb 2019 09:44:05 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728538AbfBDRnd convert rfc822-to-8bit (ORCPT + 99 others); Mon, 4 Feb 2019 12:43:33 -0500 Received: from mga06.intel.com ([134.134.136.31]:30266 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728413AbfBDRnc (ORCPT ); Mon, 4 Feb 2019 12:43:32 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Feb 2019 09:43:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,560,1539673200"; d="scan'208";a="115192042" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga008.jf.intel.com with ESMTP; 04 Feb 2019 09:43:31 -0800 Received: from fmsmsx122.amr.corp.intel.com ([169.254.5.2]) by FMSMSX108.amr.corp.intel.com ([169.254.9.99]) with mapi id 14.03.0415.000; Mon, 4 Feb 2019 09:43:31 -0800 From: "Mani, Rajmohan" To: Sakari Ailus CC: Mauro Carvalho Chehab , Greg Kroah-Hartman , "linux-media@vger.kernel.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , Laurent Pinchart , Jacopo Mondi , "Qiu, Tian Shu" , "Cao, Bingbu" , "Zhi@paasikivi.fi.intel.com" , "Zhi, Yong" , "hverkuil@xs4all.nl" , "tfiga@chromium.org" Subject: RE: [PATCH] media: staging/intel-ipu3: Implement lock for stream on/off operations Thread-Topic: [PATCH] media: staging/intel-ipu3: Implement lock for stream on/off operations Thread-Index: AQHUuCOItqk09SukTkm5qxVbw0DkOqXICeuAgAACepCAA6IgAP//oZBwgAShetA= Date: Mon, 4 Feb 2019 17:43:30 +0000 Message-ID: <6F87890CF0F5204F892DEA1EF0D77A599B325D85@fmsmsx122.amr.corp.intel.com> References: <20190129222736.6216-1-rajmohan.mani@intel.com> <20190130085901.w2ogdoax7t4yfyj6@paasikivi.fi.intel.com> <6F87890CF0F5204F892DEA1EF0D77A599B325222@fmsmsx122.amr.corp.intel.com> <20190201163655.ufrazkvsabsp6gmv@paasikivi.fi.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTdjODI1MjMtMGI1Yy00NDc1LTkxMWUtY2UwZmE0YTdjNmQ2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTnVzSzBCaXpVQ0xHbnNKbG5mRWVTME5YKzZnZGtmQ2EyVFhtR3N0bFBGVHF5RFgyUEppZUZVWXFYT1pqQUZvcyJ9 x-originating-ip: [10.1.200.107] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, [snip] > > > > > fail_stop_pipeline: > > > > > @@ -543,6 +546,8 @@ static void ipu3_vb2_stop_streaming(struct > > > > vb2_queue *vq) > > > > > dev_err(&imgu->pci_dev->dev, > > > > > "failed to stop subdev streaming\n"); > > > > > > > > > > + mutex_lock(&imgu->streaming_lock); > > > > > + > > > > > /* Was this the first node with streaming disabled? */ > > > > > if (imgu->streaming && ipu3_all_nodes_streaming(imgu, node)) { > > > > > /* Yes, really stop streaming now */ @@ -552,6 +557,7 @@ > > > > static > > > > > void ipu3_vb2_stop_streaming(struct vb2_queue *vq) > > > > > imgu->streaming = false; > > > > > } > > > > > > > > > > + mutex_unlock(&imgu->streaming_lock); > > > > > ipu3_return_all_buffers(imgu, node, VB2_BUF_STATE_ERROR); > > > > I'd also call ipu3_return_all_buffers() before releasing the lock: in > > principle the user may have queued new buffers on the devices before > > the driver marks the buffers as faulty. > > Ack (Somehow I missed this comment.) [snip]