Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3620689ybi; Tue, 2 Jul 2019 10:36:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzmmK1ufaKJqRWAX+qtYE9jG1nUupeZu7y9dEYmIe5yK29QmfuxYE8l/U/h9KLn04PrV5WD X-Received: by 2002:a17:90a:206a:: with SMTP id n97mr6931531pjc.10.1562088977659; Tue, 02 Jul 2019 10:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562088977; cv=none; d=google.com; s=arc-20160816; b=OzgFMWxSang3d5iAqUdqrF6o3B98M5Lpio2MbvCdJQrTC2jnJPgsl50RvXutBwmLyP M719fKz9Z7ecvx3EosGDc2bUyJ/0EzMjN+/WEez+qEhef+m9A7iUgEFwMKLHzjXy1Wpf 04H8zSrnFqLgQl/1UiDC2j4dVHewrKDxdrrIQmYFFjdWu8NLE2XTBfk4WKD7v0GevUUg iupAxGoQvzn/sk2kqMNx+vxUZDuoTwXX8+yIuHiB9otUQsDeJNdSB3zhjs04OxRFivDz 1UKXQKt1+MwE/M4cdRnsms3oSOr+eE2J7s2wi6Na1QeUoA/NKGVP3s+uLQOax6Mu7ENl ZbkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=jJt2O4ZjhRQkHi9yXofxN7jfMiav968m938Q3F3wSR0=; b=SB2i/m8mvOZ6bHDNoYki0Uo2A6Y/jGxRq7YP950gExWNrkNZ/RI7Cs92c/d2x2L8UL hdgRtYeBF0yRLY09ezGlygxTaYcro8YKm8PoQsNXipkZmXglBVoTvgEUObyCrjJXI6En dwyZ7dunqGO29Ey4m5r7CHwB+2EYRpIPVbl6f4Zgwvn8cGHfhcbAP5b50z2oATzk50i8 8NfNHXDNcv5DVA+0tXTld8y03zyL+aYCxAe0+3M8Lz7ZZxxrUSG9wueF1pO42S7HCYv4 YEG68rbPexPfQoexdDivOcz2m/qp3U0vdiajgdQsq3DyR4QOHNPml2HNgUlovYG83YMO TRGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="l/bkEEib"; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x11si12802538pln.292.2019.07.02.10.36.02; Tue, 02 Jul 2019 10:36:17 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="l/bkEEib"; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727065AbfGBRdj (ORCPT + 99 others); Tue, 2 Jul 2019 13:33:39 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:38468 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfGBRdi (ORCPT ); Tue, 2 Jul 2019 13:33:38 -0400 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x62HXax1076702; Tue, 2 Jul 2019 12:33:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1562088816; bh=jJt2O4ZjhRQkHi9yXofxN7jfMiav968m938Q3F3wSR0=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=l/bkEEibeU5UJSGc4K/5lpqqez1z+v1WO24Q3wQydPKTPimoF++kqQGVSnv8YMeoQ iKabra84CTfSYny3ECtbs2nXFVa2CfyGSQm3CEwVVQ/KFbMaW0MUS+Klc2hqZZlIWj IcgptF33aN7NxfgQLKHckisxNi788WV9Gvm+Sbbw= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x62HXaiU029088 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 2 Jul 2019 12:33:36 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Tue, 2 Jul 2019 12:33:35 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Tue, 2 Jul 2019 12:33:35 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x62HXZmV072144; Tue, 2 Jul 2019 12:33:35 -0500 Date: Tue, 2 Jul 2019 12:33:35 -0500 From: Bin Liu To: "Matwey V. Kornilov" CC: Greg KH , Alan Stern , "open list:MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER" , open list Subject: Re: [PATCH v2 0/6] musb: Improve performance for hub-attached webcams Message-ID: <20190702173335.GA2724@uda0271908> Mail-Followup-To: Bin Liu , "Matwey V. Kornilov" , Greg KH , Alan Stern , "open list:MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER" , open list References: <20190403185310.8437-1-matwey@sai.msu.ru> <20190614164554.27679-1-matwey@sai.msu.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Matwey, On Tue, Jul 02, 2019 at 08:29:03PM +0300, Matwey V. Kornilov wrote: > Ping? I was offline and just got back. I will review it soon. Sorry for the delay. -Bin. > > пт, 14 июн. 2019 г. в 19:47, Matwey V. Kornilov : > > > > The series is concerned to issues with isochronous transfer while > > streaming the USB webcam data. I discovered the issue first time > > when attached PWC USB webcam to AM335x-based BeagleBone Black SBC. > > It appeared that the root issue was in numerous missed IN requests > > during isochronous transfer where each missing leaded to the frame > > drop. Since every IN request is triggered in MUSB driver > > individually, it is important to queue the send IN request as > > earlier as possible when the previous IN completed. At the same > > time the URB giveback handler of the device driver has also to be > > called there, that leads to arbitrarily delay depending on the > > device driver performance. The details with the references are > > described in [1]. > > > > The issue has two parts: > > > > 1) peripheral driver URB callback performance > > 2) MUSB host driver performance > > > > It appeared that the first part is related to the wrong memory > > allocation strategy in the most USB webcam drivers. Non-cached > > memory is used in assumption that coherent DMA memory leads to > > the better performance than non-coherent memory in conjunction with > > the proper synchronization. Yet the assumption might be valid for > > x86 platforms some time ago, the issue was fixed for PWC driver in: > > > > 1161db6776bd ("media: usb: pwc: Don't use coherent DMA buffers for ISO transfer") > > > > that leads to 3.5x performance gain. The more generic fix for this > > common issue are coming for the rest drivers [2]. > > > > The patch allowed successfully running full-speed USB PWC webcams > > attached directly to BeagleBone Black USB port. > > > > However, the second part of the issue is still present for > > peripheral device attached through the high-speed USB hub due to > > its 125us frame time. The patch series is intended to reorganize > > musb_advance_schedule() to allow host to send IN request quicker. > > > > The patch series is organized as the following. First three patches > > improve readability of the existing code in > > musb_advance_schedule(). Patches 4 and 5 introduce updated > > signature for musb_start_urb(). The last patch introduce new > > code-path in musb_advance_schedule() which allows for faster > > response. > > > > References: > > > > [1] https://www.spinics.net/lists/linux-usb/msg165735.html > > [2] https://www.spinics.net/lists/linux-media/msg144279.html > > > > Changes since v1: > > - Patch 6 was redone to keep URB giveback order and stop transmission at > > erroneous URB. > > > > Matwey V. Kornilov (6): > > usb: musb: Use USB_DIR_IN when calling musb_advance_schedule() > > usb: musb: Introduce musb_qh_empty() helper function > > usb: musb: Introduce musb_qh_free() helper function > > usb: musb: Rename musb_start_urb() to musb_start_next_urb() > > usb: musb: Introduce musb_start_urb() > > usb: musb: Decrease URB starting latency in musb_advance_schedule() > > > > drivers/usb/musb/musb_host.c | 132 ++++++++++++++++++++++++++++--------------- > > drivers/usb/musb/musb_host.h | 1 + > > 2 files changed, 86 insertions(+), 47 deletions(-) > > > > -- > > 2.16.4 > > > > > -- > With best regards, > Matwey V. Kornilov