From patchwork Mon Jun 23 14:42:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 32371 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A21BD20540 for ; Mon, 23 Jun 2014 14:42:19 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id m5sf19806414qaj.2 for ; Mon, 23 Jun 2014 07:42:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=5OAVKuLUCbPUg9Y19yaLVht7pcFZ8COcqic8NlKy2qw=; b=DfYnTnhkaY82qVC6iP+SYnkMbX9GPwQ0a+AFltP5UgJ0leYduP/krkrhrSC1DmZQqK 2/A07V9Pb/sr7Ifw5LjkfjNaDT8UVv8wd3ZpVlulAPl2MtFX1Tv5nD40ZaeDpJ5xyYl/ ic9xxCvUwZa1h2XFto8yrhonzc+qLsEx/iSskWvS5YsYU8+FBWjMzYckaRJfAx0pSuyP 4Tgu1WTIplHpPXyz1fV4E43ovHqISs4+Ut3388EH705VseswiIc8VUEj0exQqlUUAH2g O8HLmdWu/13ErnTTJn1WFL6Qn4tjUl4e7VXgY3UHVHDN6VwfUbuar6ap8vrn5Tq1Bu0j 4p7A== X-Gm-Message-State: ALoCoQmk0GQQXLGayMUO5kBZ3Uhw2p93or60jvX0/7z29os+L0JB1z0A625gqfYp+una9QE21fsk X-Received: by 10.58.108.40 with SMTP id hh8mr10054330veb.18.1403534539492; Mon, 23 Jun 2014 07:42:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.239 with SMTP id l102ls1804713qgd.81.gmail; Mon, 23 Jun 2014 07:42:19 -0700 (PDT) X-Received: by 10.221.64.20 with SMTP id xg20mr19701720vcb.3.1403534539412; Mon, 23 Jun 2014 07:42:19 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id ut6si9128927veb.11.2014.06.23.07.42.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 23 Jun 2014 07:42:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id i13so6143048veh.8 for ; Mon, 23 Jun 2014 07:42:19 -0700 (PDT) X-Received: by 10.221.26.71 with SMTP id rl7mr879704vcb.69.1403534539338; Mon, 23 Jun 2014 07:42:19 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp135739vcb; Mon, 23 Jun 2014 07:42:18 -0700 (PDT) X-Received: by 10.68.216.101 with SMTP id op5mr29858213pbc.148.1403534538230; Mon, 23 Jun 2014 07:42:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az1si22244106pbd.0.2014.06.23.07.42.17; Mon, 23 Jun 2014 07:42:17 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754184AbaFWOmN (ORCPT + 3 others); Mon, 23 Jun 2014 10:42:13 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:60898 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754086AbaFWOmM (ORCPT ); Mon, 23 Jun 2014 10:42:12 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s5NEg4qg032637; Mon, 23 Jun 2014 09:42:04 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5NEg4jm014149; Mon, 23 Jun 2014 09:42:04 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Mon, 23 Jun 2014 09:42:04 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s5NEg3tw026352; Mon, 23 Jun 2014 09:42:03 -0500 Date: Mon, 23 Jun 2014 09:42:01 -0500 From: Felipe Balbi To: Alan Stern CC: pedro , Subject: Re: musb + full speed device Message-ID: <20140623144156.GA16963@saruman.home> Reply-To: References: <53A699C5.9040803@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Hi, On Sun, Jun 22, 2014 at 10:39:07AM -0400, Alan Stern wrote: > > What happens if you attach the full-speed device to a high-speed hub > > and plug that hub into the MUSB? > > > > > > That's a very interesting test i will definitely do. Unfortunately, even > > if that solves the problem, we could not use that on our production > > boards because we cannot change the design, we are very advanced and > > nearly approaching the production phase. We have no chance of changing > > any hardware, it should be a software solution. > > > > I'm also very interested in any opinions about my assumptions because I > > really don't know if I'm misunderstanding something and the problem > > could be on any other place. > > > > Basically that assumptions were that we are sending too small packets > > (64B) which combines with the interrupt latencies and the degraded > > performance of MUSB as it has more work done in software than an EHCI > > interface. So for reaching the required 0.5MB/s by reducing the time > > spent on the OMAP micro (which i find difficult) or by increasing the > > packet size, having to use the Isochronous interface with a risk of > > packet losing. > > I don't know much about the details of the MUSB driver. Your > assumption seems reasonable, though. I must say, it's been years since I last tested full speed with musb, but one thing to keep in mind is that MUSB's internal DMA engine (the inventra dma engine) is pretty stupid and you end up having to program each, in your case, 64B packet instead of starting a block transfer. That's because mode1 DMA (Mentor's parlance for a 'block transfer') is very quirky. I would suggest using the kernel's function profiler to figure out where most of the time is spent and trying to optimize that part of the code. One thing I must ask, are you processing your packets in during giveback? You might want to try setting HCD_BH flag if that's the case. I just noticed that we missed sending that patch upstream. Here it is and I'll send it formally soon if it helps you out, with your Tested-by tag. >From 8027f584b4405902b7ec890841aa6c7b8ebd6161 Mon Sep 17 00:00:00 2001 From: George Cherian Date: Wed, 5 Mar 2014 14:01:43 +0530 Subject: [PATCH] usb: musb: musb_host: Enable HCD_BH flag to handle urb return in bottom half Enable HCD_BH flag for musb host controller driver. This improves the MSC/UVC through put. With this enabled even 640x480@30fps webcam streaming is also supported. Signed-off-by: George Cherian Signed-off-by: Felipe Balbi --- drivers/usb/musb/musb_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index eb06291..bc3b28c 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -2612,7 +2612,7 @@ static const struct hc_driver musb_hc_driver = { .description = "musb-hcd", .product_desc = "MUSB HDRC host driver", .hcd_priv_size = sizeof(struct musb *), - .flags = HCD_USB2 | HCD_MEMORY, + .flags = HCD_USB2 | HCD_MEMORY | HCD_BH, /* not using irq handler or reset hooks from usbcore, since * those must be shared with peripheral code for OTG configs