Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3481670ybc; Thu, 21 Nov 2019 08:59:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzNYGVP43o+ooFs5AwdL556tjVbxsZ5S89HREbjpsjPXnzrT+ckRKKaaK7k9sB7UjeInCM6 X-Received: by 2002:a5d:4f06:: with SMTP id c6mr12128658wru.211.1574355554464; Thu, 21 Nov 2019 08:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574355554; cv=none; d=google.com; s=arc-20160816; b=oCdm9l9j06FOU3sn+yEZ2R7UELRLa8ZFbQj7eH4w/uh73h/EFSirQ+HKZVxOZ1VHRj 0h620ApVPhC5/dYsi5fueWtWtZ/ZWhZgJlru06Fbg7sARd7QaPCzKZJAtUVklsTyDO9q DTMREstBBv3zgv22A3SCKX/5e02rPfV1CQfeif2AfRnOH9UK6YlFMF4zsr5YgXhYmCiP Hs04O45OEHLF/k5IwxPFscBbfm1AGUYIfI1WUDNbNXVZFTrZEzkkqR4ygWuoE2vAYfCK 6I3Su2IP2+XFIKQHIHGqlnCzZHvxf2pPkKeC7zUv6KPKwz3a64p6NkFYwrtZn0ZupKCL BttQ== 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=teI9L1DoCDOiH8tNp8vu6MfL8Q3uW2CtM5chATZ+920=; b=b/LqoV1ZOLUn2vqAtxsoUgit0vgmetm6o+Tuc/hn9dqJfkCAtSYpnAmq86MeD1Z6Dk nzJMIGR8zRX1PjQBxk0ZaQFpsRFDoipCBpL8FCbXCnoHTD3VzLISfB81xdfsdQhK3j9u j2e8B3ty9WjYGUa9bMlF0B0vEIyScevx0loWoxViZyy+ugBrfjsHOsk6eU3cKZs1VBhs hkMqSv+TCT6I6TbFuyJi75J1mRuCONn0eeE2sWN0SaD0Q/MV/TJuOj2dp7sWKD/1cbOf j6LBMrSl9Ghbu0Wz6bD1FwBfeTCNHGdGvBesTX40as0MuWKMGlzPG3QtkMGQWLWdrvTH S2Tg== 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 d30si2496498edb.403.2019.11.21.08.58.49; Thu, 21 Nov 2019 08:59:14 -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 S1727207AbfKUQy3 (ORCPT + 99 others); Thu, 21 Nov 2019 11:54:29 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:43224 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727187AbfKUQy3 (ORCPT ); Thu, 21 Nov 2019 11:54:29 -0500 Received: (qmail 2590 invoked by uid 2102); 21 Nov 2019 11:54:28 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 21 Nov 2019 11:54:28 -0500 Date: Thu, 21 Nov 2019 11:54:28 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Ikjoon Jang cc: linux-usb@vger.kernel.org, GregKroah-Hartman , RobHerring , MarkRutland , SuwanKim , "GustavoA . R . Silva" , JohanHovold , , , Subject: Re: [PATCH v2 2/2] usb: overridable hub bInterval by device node In-Reply-To: <20191121051819.111593-1-ikjn@chromium.org> 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, 21 Nov 2019, Ikjoon Jang wrote: > This patch enables hub device to override its own endpoint descriptor's > bInterval when the hub has a device node with "hub,interval" property. > > When we know reducing autosuspend delay for built-in HIDs is better for > power saving, we can reduce it to the optimal value. But if a parent hub > has a long bInterval, mouse lags a lot from more frequent autosuspend. > So this enables overriding bInterval for a hard wired hub device only > when we know that reduces the power consumption. > > Signed-off-by: Ikjoon Jang > --- > drivers/usb/core/config.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c > index 5f40117e68e7..d2d9c6d6e00a 100644 > --- a/drivers/usb/core/config.c > +++ b/drivers/usb/core/config.c > @@ -6,6 +6,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -257,6 +258,11 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, > memcpy(&endpoint->desc, d, n); > INIT_LIST_HEAD(&endpoint->urb_list); > > + /* device node property overrides bInterval */ > + if (usb_of_has_combined_node(to_usb_device(ddev))) > + of_property_read_u8(ddev->of_node, "hub, interval", Does it matter that this says "hub, interval" whereas the documentation says "hub,interval" (with no space character)? > + &d->bInterval); > + > /* > * Fix up bInterval values outside the legal range. > * Use 10 or 8 ms if no proper value can be guessed. Acked-by: Alan Stern Alan Stern