Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp276950ybl; Thu, 5 Dec 2019 19:59:08 -0800 (PST) X-Google-Smtp-Source: APXvYqxGIDniiAfkwPglqABvW7gBLiAcDZLEKdFYOth9SzCUQd/SkbbN/Z9NM+7Pgc1AEMJKdmt8 X-Received: by 2002:a9d:624e:: with SMTP id i14mr9612614otk.371.1575604748862; Thu, 05 Dec 2019 19:59:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575604748; cv=none; d=google.com; s=arc-20160816; b=ddONE/9jXc2dIgk4rZ0wb8n64G2DfdaQVzH2/Tqm+8ldj/3Qb62cpJmJgDcXJI//cI SmKkQ5nRK4Dgqfi2GCn+lHC0h9Zet+tEJHvtZ/B07FG5gqhHgzvGGNli8ogvnEl+5Ouz BunxLr5z2AFPewxZxv9FuL1DWGFo7dZvO7Tz+3phj/E36RKD/lxYLw/zeMotAhPX0NE3 TrXafYrvHygjD2XPWloI5FgBDbWSWtlx8ySFjxn7M7o8SFEk+UsbE8TKR8GnABJmYxoE PnXpSyDcu0e/wCtAMAM1vva2ertDDqHgK9x6m1CDUNlZnvgD+FB6Iub9S4me9w95j0Md 8LNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NF2TIgmeiKLc8OSPqrcNIp5mQB/f5dRyqwK9nEPTSP4=; b=h9WEoXZViXyOpZP7xx6hBHPl3Ym7bxj24ytrSOges/YPhMyJzhQcy/wDvoCciiPauZ qaFIc4wIh8bg573R297WZYe5MbJ9joQYfbzvLdFCNgSlGu5rqk60Z6szMxRYbnqnieYA Chw/2Wld/3atkLmfZHygpa5CR8uBM4VZprON7ktwS9uXGNy/M1qJhoEb6Mgn5Wjsbgy/ vC4Jj1XQOwDMgoeHrMJ2yVSn+De0/ypuKmB03hIpOT2BEIUmbK1+2sJVUG3qQe1kZUix Q010Kagk2PLGs8S//4u5cCqAPh3nJyeUggkTPwXsRItLz1MouI9zio5ITs8dCmgMh2Jw AYhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PkjNRkn0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t11si6246789oib.23.2019.12.05.19.58.43; Thu, 05 Dec 2019 19:59:08 -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; dkim=pass header.i=@chromium.org header.s=google header.b=PkjNRkn0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726386AbfLFD5m (ORCPT + 99 others); Thu, 5 Dec 2019 22:57:42 -0500 Received: from mail-vk1-f196.google.com ([209.85.221.196]:39453 "EHLO mail-vk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726262AbfLFD5m (ORCPT ); Thu, 5 Dec 2019 22:57:42 -0500 Received: by mail-vk1-f196.google.com with SMTP id x199so1875845vke.6 for ; Thu, 05 Dec 2019 19:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NF2TIgmeiKLc8OSPqrcNIp5mQB/f5dRyqwK9nEPTSP4=; b=PkjNRkn02UgTjGBgc5/9D3h2nMrNLq0Cw2A3QAvH1tiwvsR9DE56ThroE6+bNx5gKp MWhm4fwGPsQUtPxIqrLGNv4HrZYnwpb+hbMNIgcA26V5pVzgzy8RACNZxIE9MW1FBMZ6 9bVrspszxnjn3/VI6m7W3PnqMNha3THczuI6E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NF2TIgmeiKLc8OSPqrcNIp5mQB/f5dRyqwK9nEPTSP4=; b=cjtYDgLacSqC0+lysSxPzMPC/rFeH9kainyF/c/h4wq0GrQ64PqtugXC2A7YdsluQb jhzkw1ImGJDfMoYx2vJ6FP5JzNEJbd1K0uicn9QVbGjChBYQbesaGFMsdmHGIVhZvxqi Y3WK+QsD4pkGosdxu478b3ZwyhQ4C1DE8nFLV6CnYTC/8ryP4ZwQIeKzqsRUtgTvycz8 +ufdPIHeDezUOSRYrgKpIhXbNRgWRNfj2wp8puSx3CRQmHt7uS0krlM9VoPME5bx2cYX Ut1PABf+N5GDgGq/PDpItABtPeSG9MEzyaKgArHzjmcoZqh5Jy32e63fCvbmkl4V41NN 9iJA== X-Gm-Message-State: APjAAAUjM8Q9LRhXhgwucFcf7scZVDtjSRDnOe0obPM3eZhYeC/nAETx NBTfjJEKNfCYCNAWc8z6xwkybli8lwMiIA95NEz0Xw== X-Received: by 2002:a1f:d904:: with SMTP id q4mr9338990vkg.13.1575604661175; Thu, 05 Dec 2019 19:57:41 -0800 (PST) MIME-Version: 1.0 References: <20191203101552.199339-1-ikjn@chromium.org> <20191203165301.GH10631@localhost> <20191204075533.GI10631@localhost> <20191205142641.GL10631@localhost> In-Reply-To: <20191205142641.GL10631@localhost> From: Ikjoon Jang Date: Fri, 6 Dec 2019 11:57:30 +0800 Message-ID: Subject: Re: [PATCH v4 2/2] usb: overridable hub bInterval by device node To: Johan Hovold Cc: linux-usb@vger.kernel.org, GregKroah-Hartman , RobHerring , MarkRutland , AlanStern , SuwanKim , "GustavoA . R . Silva" , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Boichat Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > 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. Thanks! > > Johan