Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp832982ybl; Fri, 6 Dec 2019 07:01:04 -0800 (PST) X-Google-Smtp-Source: APXvYqxSb1SA2v1YheLasO37fP1LX7ErSLEySJCwYgTvcwjSqQJXbvOD4qMSvfXTwP0E3poGzRP+ X-Received: by 2002:aca:dd43:: with SMTP id u64mr12176967oig.101.1575644464358; Fri, 06 Dec 2019 07:01:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575644464; cv=none; d=google.com; s=arc-20160816; b=fmxsECODI+gV2ZIsHNOLb6f5mDE+swEVUf6YKoAdYjO75KXbzL63XhtjH5xKDUXS58 9EjwQj1xl9tr43Onzkj4qwHehDqCR+rwbIAK013BD8Tk2xhCsyjCOySBp2QMFIQfveas txgiw+0owHf1s5mn5Ie1whZOeVv4v0I5RKaP3tVELFioHyDERImI7QLClFm3dKbIiyQb FHtcKWL2FszKlaNW+YpA5Clp9FzXsDm6LuBwgCmD3MsfjK0v4I7iEmS7iZASfGrCloHI p8r1NVT4mH/7+057qyKHG2/MI78uLMA1i0IPWoXJ0CpivpfNinTBwHZeCj6ZILdN3Go+ 0dug== 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=Z/i+PTfzPjuNBspRqwl+CtzrVJInLp1knlFrdCN5NC8=; b=CwPzi7j/efdUMYsdWb0Yx4K3vc9xgjeJIT/B1W7RfkJLiqH+nSgNzJaV4bcKfNgySH vzzwd21/k/JIewTJLMZDrLNQZzdv1933fmxEWx/JRnwYqBbq+zcUchRYDPSVPTAQjhnZ t8zi5PO9aaKz2c5PT7R2ek2kyorsA65tK4clZSm9SL1DHCexjVeX9sJlymrBEkAxWnMJ ygs+61PFjPw8ISd1TUghKJWZaO/MQLpVd89vwQOcIc3wZeOZeNYLlwnnaZyEZiWrrZyw LAYDzCkpHjTr6hE6OnvROFxPLy8gyEV1NZnKeOk/yzSripUEYrQsA+ZVk2d/CdpRy8bM 3M+Q== 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 s2si7015941otd.190.2019.12.06.07.00.48; Fri, 06 Dec 2019 07:01:04 -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 S1726284AbfLFPAS (ORCPT + 99 others); Fri, 6 Dec 2019 10:00:18 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:45556 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726246AbfLFPAS (ORCPT ); Fri, 6 Dec 2019 10:00:18 -0500 Received: (qmail 1696 invoked by uid 2102); 6 Dec 2019 10:00:16 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 6 Dec 2019 10:00:16 -0500 Date: Fri, 6 Dec 2019 10:00:16 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Ikjoon Jang cc: Johan Hovold , , GregKroah-Hartman , RobHerring , MarkRutland , SuwanKim , "GustavoA . R . Silva" , , , Nicolas Boichat Subject: Re: [PATCH v4 2/2] usb: overridable hub bInterval by 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 Fri, 6 Dec 2019, Ikjoon Jang wrote: > On Thu, Dec 5, 2019 at 10:26 PM Johan Hovold wrote: > > > > On Thu, Dec 05, 2019 at 03:32:38PM +0800, Ikjoon Jang wrote: > > > On Wed, Dec 4, 2019 at 3:55 PM Johan Hovold wrote: > > > > > > But related to my question above, why do you need to do this during > > > > enumeration? Why not just set the lower interval value in the hub > > > > driver? > > > > > > Because I want device tree's bInterval to be checked against the same rules > > > defined in usb_parse_endpoint(). e.g. although hardware says its maximum > > > is 255, but the practical limit is still 0 to 16, so the code can > > > print warnings when bInterval from device node is too weird. > > > > But that could be handled refactoring the code in question or similar. > > > > Yes, that should be worked. I can't exactly figure out how to refactor > the code for now, but maybe parsed endpoint descriptors are being > checked with default hard wired bInterval value and after that > an overridden value should be checked again. > > Actually I don't care about the details of software policies. I just want > all devices to be handled in the same manner without any further > special treatments. > > > The fundamental problem here is that you're using devicetree, which is > > supposed to only describe the hardware, to encode policy which should be > > deferred to user space. > > The hub hardware has a default bInterval inside which is actually > adjustable. So I can think setting bInterval is to describe the hardware > rather than policy. If the hardware is adjustable, why don't you adjust the hardware instead of changing the software? > > So I think you need to figure out an interface that allows user space to > > set the polling interval for any hub at runtime instead. > > Changing the interval at runtime is an another way to solve the > power consumption problem, but it's not so easy. At least xhci needs > to restart an endpoint and no devices are changing the interval after > enumeration stage. Restarting endpoints is easy; just call usb_set_interface(). Alan Stern