From patchwork Mon Jun 25 10:21:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Schlabbach X-Patchwork-Id: 10485479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 688DD603B5 for ; Mon, 25 Jun 2018 10:22:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4F0C52872F for ; Mon, 25 Jun 2018 10:22:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43A7D2873D; Mon, 25 Jun 2018 10:22:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, FROM_WORDY, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C94E42872F for ; Mon, 25 Jun 2018 10:22:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755090AbeFYKWB (ORCPT ); Mon, 25 Jun 2018 06:22:01 -0400 Received: from mout.gmx.net ([212.227.15.15]:42921 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755094AbeFYKWB (ORCPT ); Mon, 25 Jun 2018 06:22:01 -0400 Received: from [91.65.108.120] ([91.65.108.120]) by web-mail.gmx.net (3c-app-gmx-bs15.server.lan [172.19.170.67]) (via HTTP); Mon, 25 Jun 2018 12:21:59 +0200 MIME-Version: 1.0 Message-ID: From: "Robert Schlabbach" To: linux-media@vger.kernel.org Subject: [PATCH] em28xx: fix dual transport stream capture hanging Date: Mon, 25 Jun 2018 12:21:59 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:gakx7HP6DAHhuR6chjvdE8bFxxJg4uTVLmyigmSw9oXjXJHoN8bBXw9w5ehBjOjpotR2P n/MiXOiGloznvER4n2Gvux8JlX8bSg+RL/ZCkNzhYxoANhHwl5P7fxIpsuA1eQfKH7koWSKfSPRP V5OcD/Pa3qwQCoU21QKTBjxbFUUncEwXQbxPZbYmzuEDIFd4eLAQuecDK4OkiI6JyLNmrHqwg234 ZF+OQ5QjezTv4gYiad37gZh44CFHIx5IXFxmbbV+kwmbJDVAXUOxXde0kd1M+HS8HClyft/3ZwlV J4= X-UI-Out-Filterresults: notjunk:1; V01:K0:IsSYZw6fwfc=:wiyaQfgQeMQi6uMZ3/mcO6 OEwP4mS2znKKrxiNNFnN1sWJn2HeqYOgOXP+0u30tOKngiwdoKP5uKgnHgFIwzprngfkn6rjC XcpaSrxNbRjzrwwSNr3srev17vqmRW/MSw729wBHVJruJ3SiKAaYnTvbFQntVklrNsCdpl7tb Ydfhplc7Z8rFcDLgERw9BXabLA7R2rlU8dUsylt2k+HtwM391Pp8rJ8SgvP75kgCOdhJ7FoQo QOTgkcVdZYYcZnGMD/z2iH+tljK2UN94J9w5CzFJaTHpFXWUzf+C+u46k9ejQoIy5PySqt3tf fE//fdBa0Pb6GSquy/lPW5PFwtr+g88dmXjVE5ClmV+YBpqEeWAlpYPe2F1wLy+GzAMEOCEOL h0907iBqrCY50XnK0CD9khTwU1Lv5Potamp0Pa3MqaaFmky+5IYZ1Vli+Mr/GLKdIsc/rBPPf WlABUi7olXJzuBKaBBr4je8Jh/rbxEzWqFWGw89ywKO27wHaILdl Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On my Marvell Kirkwood system with a Hauppauge WinTV dualHD USB, trying to use both tuners at the same time always resulted in the device not delivering any stream at all anymore, no matter in which order the tuners were started. I tracked this down to the usb_set_interface() call in the function em28xx_start_streaming() in em28xx_dvb.c. This call appears to be superfluous, as the alternate setting is already set in em28xx_dvb_init(). But even more importantly, this call is in violation of the USB API, which states for usb_set_interface(): "Also, drivers must not change altsettings while urbs are scheduled for endpoints in that interface; all such urbs must first be completed (perhaps forced by unlinking)." As URBs _are_ scheduled when a transport stream capture is already running, this call must not be made. This patch removes the call, which makes the dual transport stream capture work for me. Signed-off-by: Robert Schlabbach --- drivers/media/usb/em28xx/em28xx-dvb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index b778d8a1..13c57dbc 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -199,7 +199,6 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb) int rc; struct em28xx_i2c_bus *i2c_bus = dvb->adapter.priv; struct em28xx *dev = i2c_bus->dev; - struct usb_device *udev = interface_to_usbdev(dev->intf); int dvb_max_packet_size, packet_multiplier, dvb_alt; if (dev->dvb_xfer_bulk) { @@ -218,7 +217,6 @@ static int em28xx_start_streaming(struct em28xx_dvb *dvb) dvb_alt = dev->dvb_alt_isoc; } - usb_set_interface(udev, dev->ifnum, dvb_alt); rc = em28xx_set_mode(dev, EM28XX_DIGITAL_MODE); if (rc < 0) return rc;