From patchwork Tue Sep 11 01:25:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antti Palosaari X-Patchwork-Id: 1434681 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 50BC340220 for ; Tue, 11 Sep 2012 01:26:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754799Ab2IKBZ6 (ORCPT ); Mon, 10 Sep 2012 21:25:58 -0400 Received: from mail.kapsi.fi ([217.30.184.167]:37895 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754374Ab2IKBZ6 (ORCPT ); Mon, 10 Sep 2012 21:25:58 -0400 Received: from dyn3-82-128-184-7.psoas.suomi.net ([82.128.184.7] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1TBFEj-0006yV-2R; Tue, 11 Sep 2012 04:25:57 +0300 From: Antti Palosaari To: linux-media@vger.kernel.org Cc: Antti Palosaari Subject: [PATCH 2/2] dvb_usb_v2: call streaming_ctrl() before kill urbs Date: Tue, 11 Sep 2012 04:25:14 +0300 Message-Id: <1347326714-19514-2-git-send-email-crope@iki.fi> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347326714-19514-1-git-send-email-crope@iki.fi> References: <1347326714-19514-1-git-send-email-crope@iki.fi> X-SA-Exim-Connect-IP: 82.128.184.7 X-SA-Exim-Mail-From: crope@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Logically it is better ask hardware to stop streaming before killing urbs carrying stream. Earlier it was just opposite. Now code runs: * submit urbs * start streaming ** streaming ongoing ** * stop streaming * kill urbs Signed-off-by: Antti Palosaari --- drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c index e2d73e1..f990159 100644 --- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c +++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c @@ -265,7 +265,6 @@ static inline int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, /* stop feeding if it is last pid */ if (adap->feed_count == 0) { dev_dbg(&d->udev->dev, "%s: stop feeding\n", __func__); - usb_urb_killv2(&adap->stream); if (d->props->streaming_ctrl) { ret = d->props->streaming_ctrl( @@ -274,9 +273,11 @@ static inline int dvb_usb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, dev_err(&d->udev->dev, "%s: streaming_ctrl() " \ "failed=%d\n", KBUILD_MODNAME, ret); + usb_urb_killv2(&adap->stream); goto err_mutex_unlock; } } + usb_urb_killv2(&adap->stream); mutex_unlock(&adap->sync_mutex); }