From patchwork Sun Nov 17 03:32:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ikjoon Jang X-Patchwork-Id: 11247991 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 53EBB138C for ; Sun, 17 Nov 2019 03:32:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 324552084C for ; Sun, 17 Nov 2019 03:32:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="KyAxbJ7Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726511AbfKQDck (ORCPT ); Sat, 16 Nov 2019 22:32:40 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37862 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbfKQDck (ORCPT ); Sat, 16 Nov 2019 22:32:40 -0500 Received: by mail-pl1-f193.google.com with SMTP id bb5so7527135plb.4 for ; Sat, 16 Nov 2019 19:32:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vs97VLHwrjNmXAs3KmNunTfygPvSITJlC0MBfMzcaAk=; b=KyAxbJ7QjPWlzidZ9Hy+/kS5UOn7yzjfJZSETN9Uz60Rg9FifpEHOA+oyVmlmXeqLw /FIe2gL/GOAhS9T5RJJyTXC3389epjMQ5vmm2J98pWb0Ct67tyqLnUy7GF75/wcDuzUW JGUUY0CGeOTIyUUvLLFh6KsO4mtBEI46BUaaQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vs97VLHwrjNmXAs3KmNunTfygPvSITJlC0MBfMzcaAk=; b=nQR3aaonBXTXbCveGkkftw4G7mOV9W3pjUv8g5TblclXZEjotSdCmu62OROy9IJbeq 7Z8UBgP6Y46bM5yN8oW4HTcSW8QoeBFSa0cCR0lHpPiSRHT3v42a5LUsFWiUexvsfWU8 V/SyTQn6q6SXf/klmWhYuRV3wcuE69y4ntPt9jNzadt+hVgo8KaLhsKrV1SghKTM1ndE IhpYROKb4cuNxKrg549xpcGvx3ziJuYL9sXmtvaigtqh769L6JvCGmmwOkKGvKG76TOW tXxteNMcfpKrf2reOBc0/l7xsMLsCHXOfT6jpUja1Ki1CFWKNu9G0XAF0PQz9zeeDctH NOVg== X-Gm-Message-State: APjAAAU4+zHN5cYsbRJZ3eJEsTuYQJzTaug2ht+izks4yqNkrnMbo8+Z eD9d87y4efPvZylMNikIyyv2VC1o9WZVaA== X-Google-Smtp-Source: APXvYqzHAQhYp8fNINjjPUWkd0MOy9SXxzzg5tWBkiGTCGadZ7EkYEkFk4nG09bRMrnr33/HOr0rWw== X-Received: by 2002:a17:902:5a41:: with SMTP id f1mr23668391plm.168.1573961558911; Sat, 16 Nov 2019 19:32:38 -0800 (PST) Received: from ikjn-glaptop.roam.corp.google.com (2001-b400-e27e-4718-13bf-d274-f5e0-91a5.emome-ip6.hinet.net. [2001:b400:e27e:4718:13bf:d274:f5e0:91a5]) by smtp.gmail.com with ESMTPSA id b5sm4596448pjp.13.2019.11.16.19.32.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Nov 2019 19:32:38 -0800 (PST) From: Ikjoon Jang To: linux-usb@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Rob Herring , Mark Rutland , Alan Stern , Suwan Kim , "Gustavo A . R . Silva" , Johan Hovold , Nicolas Boitchat , Ikjoon Jang Subject: [PATCH 1/2] dt-bindings: usb: add "hub,interval" property Date: Sun, 17 Nov 2019 11:32:30 +0800 Message-Id: <20191117033230.259647-1-ikjn@chromium.org> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add "hub,interval" property to usb-device, so hub device can override endpoint descriptor's bInterval. Some existing hub devices have adjustable interval so the device is allowed to use different bInterval. This is useful when the hub's default bInterval is too big, so child device's waking up from autosuspend takes much time. Signed-off-by: Ikjoon Jang --- Documentation/devicetree/bindings/usb/usb-device.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/usb/usb-device.txt b/Documentation/devicetree/bindings/usb/usb-device.txt index 036be172b1ae..44bef2ff2704 100644 --- a/Documentation/devicetree/bindings/usb/usb-device.txt +++ b/Documentation/devicetree/bindings/usb/usb-device.txt @@ -66,6 +66,9 @@ Required properties for host-controller nodes with device nodes: - #size-cells: shall be 0 +Optional properties for hub nodes +- hub,interval: bInterval of status change endpoint. The range is 1-255. + Example: &usb1 { /* host controller */ @@ -75,6 +78,7 @@ Example: hub@1 { /* hub connected to port 1 */ compatible = "usb5e3,608"; reg = <1>; + hub,interval = <8>; }; device@2 { /* device connected to port 2 */ From patchwork Sun Nov 17 03:33:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ikjoon Jang X-Patchwork-Id: 11247993 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67C85138C for ; Sun, 17 Nov 2019 03:33:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 47ABB2084C for ; Sun, 17 Nov 2019 03:33:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="akRkk8HH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726801AbfKQDdP (ORCPT ); Sat, 16 Nov 2019 22:33:15 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:45248 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726599AbfKQDdO (ORCPT ); Sat, 16 Nov 2019 22:33:14 -0500 Received: by mail-pf1-f193.google.com with SMTP id z4so8583108pfn.12 for ; Sat, 16 Nov 2019 19:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+NoD3EUOCGUvMC6d9X/brhPNv/r5QebdFkK7wUmW6FA=; b=akRkk8HH2AXBy3S4qn4X4qmVpyG5H/A21FhC71FZ7xJj0WZ183dhITiiJNfScujL2P C1s/NVshiZIFI+Nixj/MX8rloZeYG6NQbwsv2IeNQa2x9wOIxBA9HvSwYE7c8qFAOC7X d68X85meG3xL4SToBO/4eDl4HoPhioyYvFb2A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+NoD3EUOCGUvMC6d9X/brhPNv/r5QebdFkK7wUmW6FA=; b=ZwxjlgPXcnBzEB1u/A4o8E9MRGt05dFPW6Dxvpy6zi1zbjWW3P5KP1O9dPCEGTEKnH kQtEK7NBY1BH7AJf9n3vgt94W8/Igt50zf5ktPrdyq1ggOZZLOOtpzX9T4a4TmP8510n Dnccyqywf/jbM7jrVN/aTuy8LBNLNudfhDQDaf/w9x9xUUkyo+DdcKL4WhlY/7fFrhEs gHKLBtEPgUgiwSLipIIf/2N4sepmYxClrZI+yGYwKlxupN26s6TDAH5izO+sKl0S3xmJ 6Y+8HevfFh0ViM8ixsUmnKf9RThahp10zuJf7z49ragO+gIc5Um9GhXtn6XMByFX9fGt MoXQ== X-Gm-Message-State: APjAAAVPt42MJH7Vls1FmFcn4r24fmRz+qnxdEweCHdUZIL6xADOMnKu 2l+7+3CNKozhbVie3pbhXHJlg640JDpB2A== X-Google-Smtp-Source: APXvYqyJ3AadsblxQaCmis/WfFKQ1ihIy+pUanb3b5iZ1mEtzyFLXa81fQMeHeVGvcWlWocjY/WKGA== X-Received: by 2002:a63:dd51:: with SMTP id g17mr771867pgj.388.1573961593006; Sat, 16 Nov 2019 19:33:13 -0800 (PST) Received: from ikjn-glaptop.roam.corp.google.com (2001-b400-e27e-4718-13bf-d274-f5e0-91a5.emome-ip6.hinet.net. [2001:b400:e27e:4718:13bf:d274:f5e0:91a5]) by smtp.gmail.com with ESMTPSA id j7sm13780748pgl.38.2019.11.16.19.33.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Nov 2019 19:33:12 -0800 (PST) From: Ikjoon Jang To: linux-usb@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Rob Herring , Mark Rutland , Alan Stern , Suwan Kim , "Gustavo A . R . Silva" , Johan Hovold , Nicolas Boitchat , Ikjoon Jang Subject: [PATCH 2/2] usb: overridable hub bInterval by device node Date: Sun, 17 Nov 2019 11:33:05 +0800 Message-Id: <20191117033305.259789-1-ikjn@chromium.org> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This patch enables hub device to override its own endpoint descriptor's bInterval when the hub has a device node with "hub,interval" property, Some existing hub devices have adjustable interval so the device is allowed to use different bInterval. This is useful when the hub's default bInterval is too big, so child device's waking up from autosuspend takes much time. 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..234ca6124c98 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 (unlikely(usb_of_has_combined_node(to_usb_device(ddev)))) + of_property_read_u8(ddev->of_node, "hub, interval", + &d->bInterval); + /* * Fix up bInterval values outside the legal range. * Use 10 or 8 ms if no proper value can be guessed.