Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3117250imm; Thu, 24 May 2018 23:30:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZomos3Pqg7mHSZAJ9+FrcS39It36qQIgcWOLBX8OPnBjaqLrqDsf6N1pCyUmi6G80mUazlK X-Received: by 2002:a62:f55b:: with SMTP id n88-v6mr1241559pfh.208.1527229800636; Thu, 24 May 2018 23:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527229800; cv=none; d=google.com; s=arc-20160816; b=yxcMy07Tzg0Y3x0zCSaGZjP1egZCdiqntziR2R9Ph9TuI4mNCr7JtyHAHDI8NM+5Mh Eo4Uuw4J0fImNoGTQTS7WWpBzhiXgaRYlQhVC3IsuVjaXcUKQS6q3R5blpbXWiQRXlx1 tg2LUQwT4wRcJYrTny7NLJLXsf7R6ACqV+2ppbXlU4LApXywGo0+ayQNghlYHNumXg+3 wc4CPkKQVBFmL59/1YEoliRXJkiEze1BfKOndY86ikAoOHTPypBaL26lrgwn8RjLnvsG 0W4xfcZjTwPDrgvNixgPI/MyFGDGTE2jMET261QInLH9fm/DJOT/Gbj7uPPfv5lyNXgr c1Xg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=4+Gq29uJokME8NY8AZxW7wGixITuriPfBIofyNPWpD4=; b=WF610ehW7mTmZhtgtAHokJvYsgdZNwLQXMahfvEIeGLQmxvExgjcHC2d88Svgm2pAE BZpxjGMVeVuVFc3Y0v9cSO4lTbLIPwC11uA26knwSMTru+vNRD91K1Rktn2Ve4Q5ePhm mfr2loQndK7nIAfLEi8nQpydcQ1Z9zMrFLG+2fFnOypbTAKLrgNg59V0Nf2CUjRkylIL BjGTGbL44IlSNHZYQL+SwWO2u6w7l99XFSmXwdgSFK3J70e7ejp3XUkFPK6MyDajub1O TorpZRG8Q6YfHwuK88TooyDL1z+Z6RpeKQaCu8r2tV+Lev3/EuW26XFVzkGPJv+8Lskp wDJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AkkSvF2u; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b17-v6si17935679pgv.196.2018.05.24.23.29.45; Thu, 24 May 2018 23:30:00 -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=@kernel.org header.s=default header.b=AkkSvF2u; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935831AbeEYG3d (ORCPT + 99 others); Fri, 25 May 2018 02:29:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:46808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935695AbeEYG3b (ORCPT ); Fri, 25 May 2018 02:29:31 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 722FC20849; Fri, 25 May 2018 06:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527229771; bh=SxDXk+XWg5YM++0yBoz/B2CEp+sam8g/o05JohW1NyY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AkkSvF2uLn2SxHPGFezxeaWGBVvaLVL3fpEeIYgQyGt9o/Pvki4NVdoVbnYKUA5fC eQzncpbh3QfQ0jAS6rFi6zpUainEX223QlX2BzkjmfpyXwQ83ugpBb1RALu83fcv82 P3FZMKyp8YL62G0v5ySsqjyWLsFrVexDfSSHQAnU= Date: Fri, 25 May 2018 08:29:13 +0200 From: Greg Kroah-Hartman To: Nicolas Boichat Cc: Alan Stern , linux-usb@vger.kernel.org, Mathias Nyman , Felipe Balbi , Eugene Korenevsky , Peter Chen , Daniel Drake , Joe Perches , Johan Hovold , Richard Leitner , lkml , Guenter Roeck Subject: Re: [PATCH] usb: hub: Per-port setting to use old enumeration scheme Message-ID: <20180525062913.GA11968@kroah.com> References: <20180523021656.122455-1-drinkcat@chromium.org> <20180523163936.GE12456@kroah.com> <20180524162157.GA26662@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 25, 2018 at 06:05:16AM +0800, Nicolas Boichat wrote: > On Fri, May 25, 2018 at 12:21 AM, Greg Kroah-Hartman > wrote: > > On Thu, May 24, 2018 at 07:42:00AM +0800, Nicolas Boichat wrote: > >> On Thu, May 24, 2018 at 12:39 AM, Greg Kroah-Hartman > >> wrote: > >> > On Wed, May 23, 2018 at 10:03:55AM -0400, Alan Stern wrote: > >> >> On Wed, 23 May 2018, Nicolas Boichat wrote: > >> >> > >> >> > The "old" enumeration scheme is considerably faster (it takes > >> >> > ~294ms instead of ~439ms to get the descriptor). > >> >> > > >> >> > It is currently only possible to use the old scheme globally > >> >> > (/sys/module/usbcore/parameters/old_scheme_first), which is not > >> >> > desirable as the new scheme was introduced to increase compatibility > >> >> > with more devices. > >> >> > > >> >> > However, in our case, we care about time-to-active for a specific > >> >> > USB device (which we make the firmware for), on a specific port > >> >> > (that is pogo-pin based: not a standard USB port). This new > >> >> > sysfs option makes it possible to use the old scheme on a single > >> >> > port only. > >> >> > > >> >> > Signed-off-by: Nicolas Boichat > >> >> > --- > >> >> > > >> >> > There are other "quirks" that we could add to reduce further > >> >> > enumeration time (e.g. reduce USB debounce time, reduce TRSTRCY > >> >> > to 10ms instead of 50ms as used currently), but the logic is quite > >> >> > similar, so it'd be good to have this reviewed first. > >> >> > >> >> I'm not opposed to the idea in principle, although I don't like your > >> >> implementation because it breaks the original old_scheme_first > >> >> parameter. > >> > >> I don't think it breaks the original parameter? I mean, > >> /sys/module/usbcore/parameters/old_scheme_first is still a global > >> default, while bit 0 of /sys/bus/usb/devices/x/y/z/quirks becomes a > >> port-specific override. > >> > >> >> Let's see what some other people think. > >> >> > >> >> Yours is a rather special case, because you know exactly what device > >> >> will be attached to a specific port. Still, I can see that sort of > >> >> thing happening in constrained and special-purpose settings. > >> >> > >> >> How do you arrange to set the new quirk before the device is > >> >> discovered? > >> > > >> > Yeah, this last question is what I had when looking at this. Or does it > >> > not matter at first boot and only matters for wake-up? > >> > >> It does not matter on boot, we have plenty of time to enumerate the > >> device. We use USB (auto-)suspend and remote wake, so no > >> re-enumeration there either. It only matters on unplug/replug where > >> the device needs to be re-enumerated. > > > > How does this device get unplugged/replugged if it is connected directly > > to the device? > > It is external. Essentially, this is a tablet with a detachable > keyboard/touchpad. The interface between tablet and base is USB, over > pogo pins. The port is non-standard (pogo, not normal USB), and we > fully control the firmware on the base side as well, which allows us > to take shortcuts like this: we know exactly what device will be > connected on that port. Ah, ok, that makes more sense, thanks for the explanation. I'll go queue this up in a bit. greg k-h