Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5337438ybe; Tue, 10 Sep 2019 02:03:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAn/RWttg2wSELBRHlSVbH8sFogiH65gG4ct3DiSZigFa3DoGHxaMCSlDc/BsxmEPszLpv X-Received: by 2002:a50:eb93:: with SMTP id y19mr22344973edr.65.1568106207394; Tue, 10 Sep 2019 02:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568106207; cv=none; d=google.com; s=arc-20160816; b=nlgI7LvcqAYqQPcF7uEeBcJsVREteZuqBWTWcUY8npa3S7Rq6N7IQNYYOde2Zzv2gV BwvkEpXJkFUQu3MlTtm9WTBJ4WIuDzZFBYido2W5T8tx9rmuzyP8lIkPNgQ0HHSInybI zQ2tf52kLLAcJatb7e1Inigr5sQUKSwTKCvJbjAy2X/EDRY+Xa+zkPxxiMzcXO2P1Uyq CKadbRpWGiyQCsmFCqHuroSPRF7JbPrvLgPpv5YRmQvAgvAFqr6SxWx9YEkD07E3oi9q Qpl2zoM3cJh3WB0ZMMej/lFdujplgTkphuogE2oN5jR6TndoYbhUn1YWDKLWLUo/iKrf Pb6g== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AvT+f9cEL1vGiQWAZExwzAMP70MtlJ3IxUh/9G+ER/E=; b=C2yGNG2gsAy+6TelGjfIezWFav39FKzWBSoX36GuXWO8n8VgvpbE4TE8+5xGMAl0q7 tNR+4VStRmajG468mmh7z2V80dXc0BnscWcxaGV3fcAW9YBLPEodIWpiKyJCpwTjrkFw NaqUScuOgx5vIr6n25lnQ5CDBYRjrNA8YyrNbvPt6VCOcvYMQkeTXMea4YWif55otta6 pxEyUiUe/kt2ub2aTDPm5SrrKAOvqSnN17TXTxd+z80nAGCoil31uPXhHkg00JYazkCV RNCi8BkOpSxIos3kMVqTL/+vKbtMpObJcM7RGZlRVZt70imxemD6XuwRVoa9DK0spiWh nTzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Dj5KPMu0; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z55si10231755edz.254.2019.09.10.02.03.02; Tue, 10 Sep 2019 02:03:27 -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=@gmail.com header.s=20161025 header.b=Dj5KPMu0; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728540AbfIIQdU (ORCPT + 99 others); Mon, 9 Sep 2019 12:33:20 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:44594 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725908AbfIIQdT (ORCPT ); Mon, 9 Sep 2019 12:33:19 -0400 Received: by mail-io1-f66.google.com with SMTP id j4so30153634iog.11; Mon, 09 Sep 2019 09:33:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AvT+f9cEL1vGiQWAZExwzAMP70MtlJ3IxUh/9G+ER/E=; b=Dj5KPMu0kD52YffT8ZFudAnK2ovKtPbgMmLM7BiXrVP4OodzIcpdgSSW+2LQGDQFud 3G5xq7la8Lj/fB2+X7fKOty6H6PvhzfKNIRj3BLwJkILTsVZdpVu2CXOAu2mu23/7ACr eNADveWgLBQsusoUa1BzI8J+pbg7V0BC0GzumyRu4fBPvDTr1I26Hyp9VPEg71JKwI61 iIn7eovAly6WYoRgb5Xm3LRcPc67VAKjuEdTVQ3juz8noLTGrXRcAWx2RnApSrfiUwU3 S/it1Kg0Cd2YGL3GxnUVf18Qep/mvhX/6N4WHUoVO2Gotpfb/2mkc74r+oUktvE6bDG8 cihA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AvT+f9cEL1vGiQWAZExwzAMP70MtlJ3IxUh/9G+ER/E=; b=KoUlq9UGYYZNgwZ+79ZkDK7oUrKIsQ4ps/w3IaTqTj1dgbSMWSghYCSW2/KFJCHIp0 B/3ggWaDdEG/esHzrwEsjbZpRxuX7FHxgALPGr+FEUPEOYDJo5GuQVpK2wAMHIDAs4oW 4FJg7fkM5N3M799+7SqYxVARfdcH6yqqTsdVPDOhWCRkJep6EsSFaPQIqSuvs+eQChSA j15ZNzvtjhmcAEgqUfuPTJRCTJ/t3nqwohFmcx5nnZgi7XBHusUdK82u37ByvU8GE102 cTAy6NVYhI2aoMmRZsjKmKEQ2coEgNuaIHWoJ2Xn7zJoHnk4pCFpgThyC3rt8QxDbHCn ZktQ== X-Gm-Message-State: APjAAAVJjdUKUNYwLkK/r7YsjPbrNk2EF8y0TOxKwbpNlKZUHoTe5LJP tCQ7/3cUzoaYpDTmSaPn5fsRIuRam6+Kwe3qveE= X-Received: by 2002:a02:cdca:: with SMTP id m10mr12873526jap.44.1568046798789; Mon, 09 Sep 2019 09:33:18 -0700 (PDT) MIME-Version: 1.0 References: <20190403185310.8437-1-matwey@sai.msu.ru> <20190614164554.27679-1-matwey@sai.msu.ru> <20190702173335.GA2724@uda0271908> In-Reply-To: <20190702173335.GA2724@uda0271908> From: "Matwey V. Kornilov" Date: Mon, 9 Sep 2019 19:33:07 +0300 Message-ID: Subject: Re: [PATCH v2 0/6] musb: Improve performance for hub-attached webcams To: Bin Liu Cc: Greg KH , Alan Stern , "open list:MUSB MULTIPOINT HIGH SPEED DUAL-ROLE CONTROLLER" , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org =D0=B2=D1=82, 2 =D0=B8=D1=8E=D0=BB. 2019 =D0=B3. =D0=B2 20:33, Bin Liu : > > 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. Ping? > > -Bin. > > > > > =D0=BF=D1=82, 14 =D0=B8=D1=8E=D0=BD. 2019 =D0=B3. =D0=B2 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 fo= r 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 transmissio= n 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 --=20 With best regards, Matwey V. Kornilov