From patchwork Tue Jun 13 01:59:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Chen X-Patchwork-Id: 9782973 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA6F860212 for ; Tue, 13 Jun 2017 02:02:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 982522870D for ; Tue, 13 Jun 2017 02:02:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C9212870F; Tue, 13 Jun 2017 02:02:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EF0DE2870D for ; Tue, 13 Jun 2017 02:02:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fWvmjUcuaAePKf3kEslC70ZExpcO4rhtnGAf4vkg/2s=; b=Xs604AkOacCoDJ wNY8x3k2waY8Qv4Z8L6K/PX+ALj7Qw1TQAVhiVZRYO1cjyymcaB924A/rQnDj/EU330oYKBjyjSTW ZW4i239/GdDpE2FVNxmh0T4gvY6KR5O3JIK/nk+sHGZw+2ejQs3UD/39Y9UFqi7ARJX6ywMJ5JScv tvj8aVZGAVxxWE9h3MrdevZIBtwMb0Lp26DyfeJJEi+bL4J/xejmdSTwvhN4/UvcbQYwiuU11WP0Q BYIsCLjrK7egNmx/pG88Gpsf4KCc9qryMLUp8kMftMToCVYQfv+zyvxpkANAYf3ql7aCF9jylEFqe gVHHDArI/T4r+dcAxNKQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dKb9l-0002LL-W8; Tue, 13 Jun 2017 02:02:10 +0000 Received: from mail-cys01nam02on0072.outbound.protection.outlook.com ([104.47.37.72] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dKb8d-0000nD-Jp for linux-arm-kernel@lists.infradead.org; Tue, 13 Jun 2017 02:01:04 +0000 Received: from MWHPR03CA0020.namprd03.prod.outlook.com (10.175.133.158) by BY1PR0301MB0901.namprd03.prod.outlook.com (10.160.195.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Tue, 13 Jun 2017 02:00:36 +0000 Received: from BN1AFFO11FD016.protection.gbl (2a01:111:f400:7c10::117) by MWHPR03CA0020.outlook.office365.com (2603:10b6:300:117::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12 via Frontend Transport; Tue, 13 Jun 2017 02:00:36 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD016.mail.protection.outlook.com (10.58.52.76) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1143.11 via Frontend Transport; Tue, 13 Jun 2017 02:00:34 +0000 Received: from b29397-desktop.ap.freescale.net (b29397-desktop.ap.freescale.net [10.192.242.114]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v5D1xlmS024438; Mon, 12 Jun 2017 19:00:25 -0700 From: Peter Chen To: , , , , , , , , Subject: [PATCH v15 4/7] usb: core: add power sequence handling for USB devices Date: Tue, 13 Jun 2017 09:59:23 +0800 Message-ID: <1497319166-17287-5-git-send-email-peter.chen@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497319166-17287-1-git-send-email-peter.chen@nxp.com> References: <1497319166-17287-1-git-send-email-peter.chen@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131417928352767420; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39450400003)(39840400002)(39410400002)(39400400002)(39850400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(9170700003)(76176999)(2950100002)(50986999)(2171002)(498600001)(2906002)(2201001)(86362001)(8676002)(5003940100001)(104016004)(33646002)(38730400002)(81166006)(50226002)(54906002)(8936002)(36756003)(189998001)(7416002)(7406005)(5660300001)(50466002)(8656002)(77096006)(4326008)(356003)(85426001)(48376002)(305945005)(106466001)(53936002)(47776003)(105606002)(39060400002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB0901; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; MX:1; A:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD016; 1:lzaNZhsc9JrWV9hMHQ69UjE2D1R/JGF1g6yyZ/tef+4MzYb0BIyH1aF1oL7enPN3pObjNbGSdDImqbVigAKzc5n8BJp9Zsjrp/g6FL6T2HA8ekg+oq2wBzaYCSpxgxtuK11O7zQ0AHM833W5xobz0CUEHjPjMZu7xcAmNcs1bUBsSC553YqvEYfpUJIkKTLneOdn4Irc2c5vBxNqrV39jL0IOZHDH1elp0lNk1eamvBe/QjaohH06+BYwSdxp8YB+nzwpjC4TJUGnzOQiDRchqS3etcp4NVItDD1U2nY+4uerkMHDlRRgtfXU6BZGxeFoeOAhRAAh7CMfbjqG8Wk7mAknhtzpIF22x4EiUrwaaKzj1fvsEN0OHl9M1X/iFm7jA7cQi9j0yQQwjEZAysR6rb+Rimr22YPVHuaQ7R91cj5Tcpl3tGaF2cvpE7gmwwCFUPSAREjGpGmQr7bbUMHzMHdAVZUANiiyBDMKpmafZ2prAzJrILZ8txPzPUkVLAayiJwl7Xj8WBWRetCv1nBnCgSjCkr43Wcm9zBi+BBv7ECYdbkL+wadG97Zp+FHsJ67zwE3J3rSOAFxGAOfwfRhqx7ca/RHd/ZEiq2S/zOv4VER9kjVxFXYrVSbwLUAvg6Yb3/eY/ssLtk2GgiQUfBvTjfVuzzhiTxb96kykKPjjh4DuN0fyfj22fgA0L9EEIKjxgC3pJbYrET9e+0EHMoyT44HCuBQBL5QRbaHL9KZ6Q= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY1PR0301MB0901: X-MS-Office365-Filtering-Correlation-Id: c0145006-bbb3-4208-3c5b-08d4b1fffb0a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131430075)(201703131517081); SRVR:BY1PR0301MB0901; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0301MB0901; 3:nxif695YKpYokhuZlQMGo6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Icr+WTzfaRXH64upgnCO96sla/iN0wzOrwIQELqD3DKVtNjD9oeRG4otMpcK/4rnjYiy6RDFtF70DxwWbsfo5H21hoUzKBiB0QNXODx5/W9CxIMO+OASWaAj31Q8Ykqe0Au/RBRJP+uAoRG82qiYr6ARIQj3Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(35762410373642); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(20161123561025)(20161123565025)(20161123559100)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(20161123556025)(20161123563025)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY1PR0301MB0901; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY1PR0301MB0901; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR0301MB0901; 4:Bc8w7mDPahHLy5QMpo7IiphfOshGB7+GidvFHwm+?= =?us-ascii?Q?nI0s1ar6F1qkjJCl3AntVauEU4cyrqdZ9ZrW4hRZWnNb+5yVu0q6ZMxu18kE?= =?us-ascii?Q?0EQcBtGJUznUdEIwW0PpW6sUkHJq1c+HhOZrAhl4Bl3TCgO2TKoDxD4eTr7l?= =?us-ascii?Q?PiYz0F0i1H72OGiX5rMoP0QH2FSD2zX/z7cVQxaY0j/JvpgaYDV/NygPJ16+?= =?us-ascii?Q?c538IBr6IhRMHSJC6SlaC/2Q/TPKN0psNXdBqyp84GilPZHyaB9QItQR6ADr?= =?us-ascii?Q?MZQEQIYnEBpI6ohAsIYewj4e2Sh1SO86+4tKGSlXqnW80YUpFUdJBxngJUUy?= =?us-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LJC0Bl0FQ3ANOTlGbuhwICjw3HwyWAa3P1A6QnZHZXryj1ugEnHN2MG6BpOKglUnODgwDf/FDc+gL/c91si9FFSkW7lk+C9lLu7Bmwma2OXWPzmC210n6K07++hZ0Rhl+8+7NJtzP6ypHs/iiGewfXzD9eEPHLWRxb3nPE/fknTR6h25uPJcaadrFSd+DGabIJtzNqGu7xCtL85BOVlmVXAvzohoskmyg== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2017 02:00:34.9959 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0301MB0901 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170612_190059_803279_237FAF4C X-CRM114-Status: GOOD ( 17.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, Peter Chen , heiko@sntech.de, stephen.boyd@linaro.org, frank.li@nxp.com, gary.bisson@boundarydevices.com, festevam@gmail.com, stillcompiling@gmail.com, arnd@arndb.de, vaibhav.hiremath@linaro.org, krzk@kernel.org, mka@chromium.org, devicetree@vger.kernel.org, mail@maciej.szmigiero.name, pawel.moll@arm.com, linux-pm@vger.kernel.org, s.hauer@pengutronix.de, troy.kisky@boundarydevices.com, linux-arm-kernel@lists.infradead.org, hverkuil@xs4all.nl, oscar@naiandei.net, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, p.zabel@pengutronix.de, jun.li@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some hard-wired USB devices need to do power sequence to let the device work normally, the typical power sequence like: enable USB PHY clock, toggle reset pin, etc. But current Linux USB driver lacks of such code to do it, it may cause some hard-wired USB devices works abnormal or can't be recognized by controller at all. In this patch, it calls power sequence library APIs to finish the power sequence events. It will do power on sequence at hub's probe for all devices under this hub (includes root hub). At hub_disconnect, it will do power off sequence which is at powered on list. Signed-off-by: Peter Chen Tested-by Joshua Clayton Tested-by: Maciej S. Szmigiero Reviewed-by: Vaibhav Hiremath Acked-by: Alan Stern --- drivers/usb/Kconfig | 1 + drivers/usb/core/hub.c | 49 +++++++++++++++++++++++++++++++++++++++++++++---- drivers/usb/core/hub.h | 1 + 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 939a63b..b6f626e 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -39,6 +39,7 @@ config USB tristate "Support for Host-side USB" depends on USB_ARCH_HAS_HCD select USB_COMMON + select POWER_SEQUENCE select NLS # for UTF-8 strings ---help--- Universal Serial Bus (USB) is a specification for a serial bus diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 9dca59e..0439d4f 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -1619,6 +1620,7 @@ static void hub_disconnect(struct usb_interface *intf) hub->error = 0; hub_quiesce(hub, HUB_DISCONNECT); + of_pwrseq_off_list(&hub->pwrseq_list); mutex_lock(&usb_port_peer_mutex); /* Avoid races with recursively_mark_NOTATTACHED() */ @@ -1646,12 +1648,42 @@ static void hub_disconnect(struct usb_interface *intf) kref_put(&hub->kref, hub_release); } +#ifdef CONFIG_OF +static int hub_of_pwrseq_on(struct usb_hub *hub) +{ + struct device *parent; + struct usb_device *hdev = hub->hdev; + struct device_node *np; + int ret; + + if (hdev->parent) + parent = &hdev->dev; + else + parent = bus_to_hcd(hdev->bus)->self.sysdev; + + for_each_child_of_node(parent->of_node, np) { + ret = of_pwrseq_on_list(np, &hub->pwrseq_list); + /* Maybe no power sequence library is chosen */ + if (ret && ret != -ENOENT) + return ret; + } + + return 0; +} +#else +static int hub_of_pwrseq_on(struct usb_hub *hub) +{ + return 0; +} +#endif + static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) { struct usb_host_interface *desc; struct usb_endpoint_descriptor *endpoint; struct usb_device *hdev; struct usb_hub *hub; + int ret = -ENODEV; desc = intf->cur_altsetting; hdev = interface_to_usbdev(intf); @@ -1756,6 +1788,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) INIT_DELAYED_WORK(&hub->leds, led_work); INIT_DELAYED_WORK(&hub->init_work, NULL); INIT_WORK(&hub->events, hub_event); + INIT_LIST_HEAD(&hub->pwrseq_list); usb_get_intf(intf); usb_get_dev(hdev); @@ -1769,11 +1802,14 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) if (id->driver_info & HUB_QUIRK_CHECK_PORT_AUTOSUSPEND) hub->quirk_check_port_auto_suspend = 1; - if (hub_configure(hub, endpoint) >= 0) - return 0; + if (hub_configure(hub, endpoint) >= 0) { + ret = hub_of_pwrseq_on(hub); + if (!ret) + return 0; + } hub_disconnect(intf); - return -ENODEV; + return ret; } static int @@ -3593,14 +3629,19 @@ static int hub_suspend(struct usb_interface *intf, pm_message_t msg) /* stop hub_wq and related activity */ hub_quiesce(hub, HUB_SUSPEND); - return 0; + return pwrseq_suspend_list(&hub->pwrseq_list); } static int hub_resume(struct usb_interface *intf) { struct usb_hub *hub = usb_get_intfdata(intf); + int ret; dev_dbg(&intf->dev, "%s\n", __func__); + ret = pwrseq_resume_list(&hub->pwrseq_list); + if (ret) + return ret; + hub_activate(hub, HUB_RESUME); return 0; } diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h index 34c1a7e..27f56a6 100644 --- a/drivers/usb/core/hub.h +++ b/drivers/usb/core/hub.h @@ -78,6 +78,7 @@ struct usb_hub { struct delayed_work init_work; struct work_struct events; struct usb_port **ports; + struct list_head pwrseq_list; /* powered pwrseq node list */ }; /**