Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2926081imm; Thu, 24 May 2018 19:11:15 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr9SlkNxJ0XNO/Yd2cttrmjhGOi2dWuNm+RxV99U/grZPcQSyzLG/vPNJuSm8tPh9i+eOwR X-Received: by 2002:a17:902:28e8:: with SMTP id f95-v6mr546648plb.250.1527214275418; Thu, 24 May 2018 19:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527214275; cv=none; d=google.com; s=arc-20160816; b=gI1MywPk6ErSnq0sZk49tY53X+6XBiNCHWZVVaFXrZMPc8ZiUrEJQUBxLkwiKvBOM4 twJOQswYESucXmZHc+2KAYbiSe2f/aNOunv8lJcuQqNopzjbJFaEG+PBrJ9dfcTCMZRR U9gED3j4kgpbfV1PSG8DhYQbrwCfCs+sJ4t6jp+L2kKeB3GOohDWU2q8urzrwI1gyUXO SNpaUGnAiqWBa729C9EIJLSBS55pPlMrl74vm7mPluh8TWOViQhJXfrZxJGNq+5nuted s+MCa/BoCCbhpdD/nn2D4OnKXABSoJnow409d4f8jYs5vHGvUn3VfjICDZRadb8K8aAI ZHfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=cbuRQIUmgT6n+PQLJFxypK9qEkte/wPVUjr35ge5Mjo=; b=NwNKQK7gcAp8CFkiomEgKGLJ6aRNyAZPemjaFpXsql1ZUtpCSRd1bV6HqyS4DmCFms 6qJ8xzhYfGg5O8foidsRUR/C98P/kzXOgQe+DrKbmDA3qzAqv+GBsjL9CW22ZJqW0GnN uKf4pHLq6sBYCZ9FfXYxulYtWzW69MtOMJxXpioOPWQ/XuJez4WE37mgj2JisKPPAM1K EXEc5ROnvo9Txy+Wmntpqy5YTmCizkHD/lQS4BxCTI5F+1t0vGHQY1F8caGZIKPSMZZS KBnEy1kQorQqp9LTZNhKkr8xRUnqWsfp7atLd1zYAGHHjIeW0XduOR9pK0188EzuGRaY sqHA== ARC-Authentication-Results: i=1; mx.google.com; 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 h91-v6si21888584pld.132.2018.05.24.19.10.35; Thu, 24 May 2018 19:11:15 -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; 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 S1033350AbeEXO35 (ORCPT + 99 others); Thu, 24 May 2018 10:29:57 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:55082 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1031407AbeEXO3z (ORCPT ); Thu, 24 May 2018 10:29:55 -0400 Received: (qmail 10210 invoked by uid 2102); 24 May 2018 10:29:54 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 24 May 2018 10:29:54 -0400 Date: Thu, 24 May 2018 10:29:54 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Nicolas Boichat cc: Greg Kroah-Hartman , , 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 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 24 May 2018, 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. Oops, sorry, my mistake. My email client wrapped the last line of use_new_scheme(), and as a result I missed the fact that old_scheme_first was getting or'ed into the expression. > >> 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. > > Somewhere in an init script, we would do this (we know in advance that > usb1 port2 is the bus/port where we have our pogo-pin USB interface, > so we can hard-code the path): > echo 1 > /sys/bus/usb/devices/usb1/1-0:1.0/usb1-port2/quirks > > We could try to add ACPI support (just like connect_type), but we > don't strictly need it for our application. Okay, that makes sense. So this change looks okay to me. Acked-by: Alan Stern Alan Stern