Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2151026ybc; Wed, 20 Nov 2019 09:36:49 -0800 (PST) X-Google-Smtp-Source: APXvYqyw4Q70zoW7JrU4HxbRRTbEYkwFjj06Mn6l9vd+irV2H+XLWcvnjyL9WZvrhHfPR/vMj0LU X-Received: by 2002:a17:906:5a83:: with SMTP id l3mr6852969ejq.194.1574271409468; Wed, 20 Nov 2019 09:36:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574271409; cv=none; d=google.com; s=arc-20160816; b=fk8N0lFw0uQ7+gLFHOSVnvbYFX8zipf9rAuFb+mFGZtzf3U1H7qQ8SU7WaPKjXNeIX zMpl8frRDrtXp409a29dRuLNJaoUh0sdd9wxupuz//3++UykIX1idJGuS4Vb92lSNoCD /aaD2uE1r3+TWS7duGdmYpjBMtFhcvHobCgNInZtM2ddEwdQkXnYBS5UIfclOftjCADE BmuUcgo2rtSnng63CiGwYKHL/2sLXUJaUWFzx3EeTAcEpncKoN9lPKgvyrKhL/y0Gmyj /om/gTRr70m1iYQ/MrfujLI9rPK35w52WKcKKSVbCbWnREngKnltBlOO/zL+2FEaDCSP hLNg== 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; bh=U7VsAUA0k8xXgZWdVSvzBZqMXjItjRq2DC6ouccN2iQ=; b=wNLCdmPFCZIt8LUL2H7nABbA0Haf35k+SxP7dpKUrM9gN85WQDRZjlNmQgMAOF6Ybb ejLzVMECU4PjqVNVt2ochwTgAtstrZLVeG/MQBZNqHQXY1KBIM8OY/3RkEsf2+colqPQ mQPnwVs8ZYbQGswCA6BdZQC3PgpGj1g+GlGFZ6htWKxizh+XyTBp2GzHMgpQ66DfCs9F dYJDIAdsakmXj41F5/mVcwtmIa/ELyued4vVtBJEy3ZzXI0hIrbW6FSfG7dkd3zs43wr MysLOkbdFi6FmFIx1zHIxX1JZ545kKb20T09DsvMb2iljT1/GcnbB/UGr/8ptYC6DYPn Xv6w== 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 qh13si17069829ejb.407.2019.11.20.09.36.25; Wed, 20 Nov 2019 09:36:49 -0800 (PST) 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 S1732739AbfKTQTE (ORCPT + 99 others); Wed, 20 Nov 2019 11:19:04 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:34506 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1728972AbfKTQTD (ORCPT ); Wed, 20 Nov 2019 11:19:03 -0500 Received: (qmail 2086 invoked by uid 2102); 20 Nov 2019 11:19:03 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 Nov 2019 11:19:03 -0500 Date: Wed, 20 Nov 2019 11:19:03 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Ikjoon Jang cc: linux-usb@vger.kernel.org, , , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Suwan Kim , "Gustavo A . R . Silva" , Johan Hovold , Nicolas Boitchat Subject: Re: [PATCH 0/2] usb: override hub device bInterval with device node 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 Wed, 20 Nov 2019, Ikjoon Jang wrote: > On Tue, Nov 19, 2019 at 11:14 PM Alan Stern wrote: > > > > On Tue, 19 Nov 2019, Ikjoon Jang wrote: > > > > > On Sun, Nov 17, 2019 at 11:46 PM Alan Stern wrote: > > > > > > > > On Sun, 17 Nov 2019, Ikjoon Jang wrote: > > > > > > > > > This patchset enables hard wired hub device to use different bInterval > > > > > from its descriptor when the hub has a combined device node. > > > > > > > > > > When we know the specific hard wired hub supports changing its polling > > > > > interval, we can adjust hub's interval to reduce the time of waking up > > > > > from autosuspend or connect detection of HIDs. > > > > > > > > In fact, _all_ hubs support changing the polling interval. The value > > > > given in the USB spec is just an upper limit; any smaller value is > > > > equally acceptable. > > > > > > > > So why are you doing this only for hard-wired hubs? Why not for all > > > > hubs? > > > > > > Because we only want to apply it to a specific device instance under > > > our control. > > > > Why? What's so special about that device instance? > > > > For example, why not instead have a poll_interval sysfs attribute for > > all hubs that can be written from userspace? Then people could reduce > > the autoresume latency for any device they want. > > Changing its INT interval during runtime seems not so easy, there's no device > drivers doing this to my knowledge. At least xhci needs to restart > endpoint to change > the interval. So I think patching ep descriptor at enumeration stage > is more convincing. That's a good point. It would be necessary to send a Set-Interface request at the very least if you wanted to change the interval on-the-fly. > > > We apply autosuspend to built-in touchpad device for power savings, > > > > > > Users can attach external hub devices with same VID:PID that we don't want to > > > change the behavior. > > > > Why don't you want to change the behavior? Or allow the user to change > > the behavior? > > > > Yes, that's a difficult question here too, when the hub is external device, > it can't be fully controlled by here. Even though it's the same > VID:PID hub chip, > that's not the 100% same device. We don't know how much this will > impact to the other > external hub devices regarding power consumption and compatibility. > > > > Maybe disabling autosuspend for external HIDs > > > can be more reasonable for that case? > > > > If it makes sense to to save power for your built-in touchpad device, > > why doesn't it also make sense to save power for other external HIDs? > > > > > > And is 250 ms really too long to wait for remote wakeup or connect > > > > detection? What's the real motivation behind this change? > > > > > > When a user starts to move the cursor while touchpad is in autosuspend state, > > > It takes more than >250ms (worst case can be >500ms) to wake up and response. > > > That makes the cursor stuck for a while and warp to another location suddenly. > > > > All right, that's a good reason. But doesn't it apply just as well to > > other devices, not only your built-in touchpad? > > Actually the hub is the one to be applied, I don't care much about the > rare case that > a user connects an additional external hub with same PID and connect > external HID > under that hub. > > We could reduce autosuspend delay for built-in touchpad when we know > that's better > for power savings only if response time of wake up is good enough. but > we don't know > the optimal values for external HIDs. So we could use the default long > delay for external > devices, or just disable autosuspend for all external HIDs, > so user might experience much less cursor lags even with that rare case. All right. Can you resubmit the patch with this explanation added to the Changelog? Alan Stern