From patchwork Tue Feb 13 09:37:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10215521 X-Patchwork-Delegate: geert@linux-m68k.org 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 F3AF46055C for ; Tue, 13 Feb 2018 09:42:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F354328E46 for ; Tue, 13 Feb 2018 09:42:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E58B128AA1; Tue, 13 Feb 2018 09:42:17 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1427028AA1 for ; Tue, 13 Feb 2018 09:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933912AbeBMJmP (ORCPT ); Tue, 13 Feb 2018 04:42:15 -0500 Received: from relmlor3.renesas.com ([210.160.252.173]:9609 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933805AbeBMJmK (ORCPT ); Tue, 13 Feb 2018 04:42:10 -0500 Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie2.idc.renesas.com with ESMTP; 13 Feb 2018 18:42:08 +0900 Received: from relmlii1.idc.renesas.com (relmlii1.idc.renesas.com [10.200.68.65]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 72D4D7B4C8; Tue, 13 Feb 2018 18:42:08 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.46,506,1511794800"; d="scan'208";a="271039295" Received: from mail-sg2apc01lp0241.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.241]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 13 Feb 2018 18:42:07 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KiHsJmnZDFOwJpsgWqGUHIqt9yd3OnXHodGEifrxhQU=; b=kvfWJXcgVESP6nmbY4j29JAKS3yYfeamAWUrMgvJQZl2qbgELxoOOfPGzW9RiuMT4tkyBp4BhYoheDypzVVbRnOujMd+3Txi1sqNqqSnS5Zgg0vFAECz5xLrplOfdqG6ahqIdaf7VgD2o3mf1P57V+63SYIDgcCotB73gU/D/Qk= Received: from localhost.localdomain (211.11.155.138) by SG2PR06MB0983.apcprd06.prod.outlook.com (2a01:111:e400:5213::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.485.10; Tue, 13 Feb 2018 09:42:05 +0000 From: Yoshihiro Shimoda To: mathias.nyman@intel.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH] usb: host: xhci-plat: revert "usb: host: xhci-plat: enable clk in resume timing" Date: Tue, 13 Feb 2018 18:37:23 +0900 Message-Id: <1518514643-13064-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [211.11.155.138] X-ClientProxiedBy: OSBPR01CA0048.jpnprd01.prod.outlook.com (2603:1096:603:1e::36) To SG2PR06MB0983.apcprd06.prod.outlook.com (2a01:111:e400:5213::25) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 480d70c5-e805-462d-96d8-08d572c60b65 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(8559017)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:SG2PR06MB0983; X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0983; 3:BSDZTscAL42sPFz7t8E2/LMMAwLwtRb3FSjZrK4GYlKIQVEpHFAgqIeyJZqH/JkjVxOD5lXhP9F23KMgckYE0glJ5boIu0fbabpV5ngUlfaWGo1wYXvw8NcSfpPN3MhAy9ltMT+jgtH48ShwP92oUHqjat/ZNFFR0A5QZMvTUAJyBiWMq0BOXgNHWDKAbZ9/E1D9sAlrBGcxH+s/4tOPznSOnJATci2xzTCtfft8Cnv4vi7RwU1XhbvFiehySOmE; 25:GfOMYuBWXrQ8FSuI9uV9oFPARH0Tn5XagQ0lzxH3RnufSWdsVGZb2J8MAU1bTfNLB/2hlgGYbL5NG2XpeXYsOJud7MmpmPCgj9RIGfE+3XhVRLnNIpIVHrfkr/TOSPbtJjydautT822obBj/n6MlAXxLM4dG4U37QyksaW5cjx32NKcMdueE/l8pmHHnG3eC2dJPy9vq9F/iDnBm4iZupExpE7tOCt3MGfolVzVND5pDrW8iAtPVCZmH0p9JyVkN4ONf3lXPr3O+Hkzv5AT4bWmE21syvPFlYM4pB5ZV9CP5U1Si1YgVn6ADOl8dN39PJhi9XASYdtaCHIRBxSYM8g==; 31:7M0TWdgJNWeGp2etelFITzpjKBPY7RTLk7cpWrsA2ajZpnfSFoPG25AivlLa6v1FyogCOA1vkNp1lyV7YpU8WALVSgQGOBztDDD+ch0gO4XLN1UUdYBnJ+mo51Qt04hGpIByZdjaMEiq1N1v4ZDI3BkcHmZPfL16r/5GK+PireQCC5bmsUPKl8jwqB+EtTf4dbw1fptpxOV0mn8YJXLCB4ftWOKlkDnbOXNd+5/c/ko= X-MS-TrafficTypeDiagnostic: SG2PR06MB0983: X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0983; 20:LdN+ndrprjNCeMSTBrgOOiWLxCSiwj9mI5w1zoYSilpDENA88rvaetsQ9cNdiimq362aY3BpKrh1o0rqsaWscNKBxC9uZa+YT6snlNDEdcYCX3957XuIubwTFBeD0k950xqCOmneuGoNncjwWmU+15XZaZvYyeNPXiOTolGQMczAyEWQ3OSh9PxHpEFPZb+CVmMs/YcXVgEaSXPleuu7aVv3BNtJOAJj0QJJiSOfcTOhMisvXCzqq28qSmOaXNaSLuyYPBH36B2jkYTkjNrOOgF+vh7/ATKWkamc3AIFeh7GB1a159o87uh6ZYtoVXN1MsUIT+k3MxUH5Hw01lTntdtoKjq4py1wn8fXTNLtRmXdtAOa8ozyAMwnw37+CLQN56NBQwMUxYDJQv6yyaw60Po4IUYkQZE0srbsfiMVCEQJ1OMBHUU2wyuJR2zROFSawNA8+xVr0+jgiY9/qht0toECYyPD3QmTvukATKWe+juJQHeSCdebOqIDZik4Kd3g; 4:E2tgyNTZGuvYGdOaamp+T4n4oc4SGlJKiMIGxxXcFeMZiBhIiBhMylB6Sjo7CVQoKl5yj5lUtgtC33H89PLpwcFKSRWMz1lNb9LMFxoB877azq/MpTpRSRIk+yPKo9OC7w9NR72BzXmN0mYpZX2iFKo0y176mY1bvm1/KByiNGys5I8UzMQFkMny4/zUTXCKsKAus4ovoUPrmkRqEDZhHGHHf3J+pNCV+CFk48R8b3DNvJWcdEUq96dUlkgr2+YpytC58twibhny027XcU9hPw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(93006095)(3002001)(3231101)(2400082)(944501161)(10201501046)(6055026)(6041288)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:SG2PR06MB0983; BCL:0; PCL:0; RULEID:; SRVR:SG2PR06MB0983; X-Forefront-PRVS: 0582641F53 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39860400002)(346002)(39380400002)(366004)(396003)(376002)(189003)(199004)(4326008)(6506007)(386003)(6512007)(16526019)(53936002)(6346003)(305945005)(1857600001)(5660300001)(68736007)(81156014)(42882006)(8936002)(7736002)(50226002)(107886003)(81166006)(26005)(97736004)(6486002)(6666003)(78352004)(8676002)(498600001)(66066001)(106356001)(52116002)(6116002)(3846002)(51416003)(16586007)(316002)(36756003)(48376002)(47776003)(105586002)(50466002)(59450400001)(25786009)(2906002)(3720700003); DIR:OUT; SFP:1102; SCL:1; SRVR:SG2PR06MB0983; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; Received-SPF: None (protection.outlook.com: localhost.localdomain does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SG2PR06MB0983; 23:k5YpXfspJ+g2lhAEmOe4cHXcMq6p6iyOLN4iCJGCy?= =?us-ascii?Q?hoVzJkCJF0BmuKqnn7XwsoMGaTMJKF+6ME7rlSUMTLNmVJ8L4Act+khq7Sm/?= =?us-ascii?Q?L3coQWA1QZFB2toMV5T8iHHkjBFOqZmMOqLz1gQ8B6d1vSoqfnPo3UOkwNEg?= =?us-ascii?Q?NfWxbgZq1SVs19Cot6bb/w1bKIz9mGYNf/72GV/yqpDfoPXmTE66jvBc5ugc?= =?us-ascii?Q?fknbl8KvKaDk4+cZ3B611/KiVtuCmTKBgj/i25PoSS5JpfyrFM6L0H59Ps4g?= =?us-ascii?Q?7YYUlu/5IwAge4vgAHaUj6coXKiaUu6aoCaBTK77UM+YM/OK5S4v5TOaBWAR?= =?us-ascii?Q?HwuK7fQfH3ydLSEGQpXwQr3S9aSjhIkf8AGU0759Qv3nIzv/5kBe3HEkQju2?= =?us-ascii?Q?Is71UExG7hxNmPd8XxNJmXbFrSTvVRAMdzcWZou64+dpmb1/hOZA2q8YQLj1?= =?us-ascii?Q?U0VXrEuv4X20daRaE/sOmOIV4SvyXfNyUF4u/kibEph6pX5K5lczbls753qV?= =?us-ascii?Q?ewX8hAXfmomxbFea0vQ0HcwMIWifRwmhDOkTVw3ywXd1y6UnMimGZMTZd1NK?= =?us-ascii?Q?YOJ7lXaHcAAj8qI/k0QCMJYWEg5YkSs0d5vF7PTmiAwt/09BBMY99cbVpG0B?= =?us-ascii?Q?5ZoTEDiJZgrKLrSDkmp7JQqLhRLf0FYCxVgh8v9/gOrkoOvcckI/qeHEXpjP?= =?us-ascii?Q?6Lox8//UV/SWg5Q3ojen/gwoIEMBuPpKmbTBDStP5Zjwn9gcxs7gRMMdnriu?= =?us-ascii?Q?YLqciArME/j1mbfLwB8aCWu+kKMZ8ak5k1i/xILYaS/ALC2cQMvw7jP5U6gw?= =?us-ascii?Q?xTovEaVIsVe3ZKe6lVUG0pe3ptGa5gfGx6fy6q93i8NUMJd2eDpm63SNLhW3?= =?us-ascii?Q?Nk/49BX0hQurA6WDP6rex7HL/XUOovr8yIekLjriwzqW4+5PVAsXmi7+HWEd?= =?us-ascii?Q?Hh2iiNtvqS+Y8Cj3F1FnH6cjR18ZbQJYNGArXVVYeT+XPD+yJvDcBGXETudn?= =?us-ascii?Q?urDAaQugD0e4YmzRl+7IdMjPKeQNVX7mEdUpEtj49hra8eJoojN9ivqfmYIb?= =?us-ascii?Q?+DYJmAzqRjHP4p/UJKl1WU/Z8+BGQe8ZB23JLdgZcQePUmgoIrZgkrTBENdL?= =?us-ascii?Q?xfzAke4601dofwygOK4elAguTYnjKMorBELtibWMzVipGqq8VjJTEsl3u+ek?= =?us-ascii?Q?KO+Vp8VrrmXcOw=3D?= X-Microsoft-Exchange-Diagnostics: 1; SG2PR06MB0983; 6:4Yv1gybxvkPtQQaXTMNgbXTr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y4ctqmEeEwiyjtzzi+JSyrPsUX18F0haXrjVKSAbKcWMXLx8jEURsDYtT1PssV05y7PxNn5ra2M= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2018 09:42:05.6684 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 480d70c5-e805-462d-96d8-08d572c60b65 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0983 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch reverts the commit 835e4241e714 ("usb: host: xhci-plat: enable clk in resume timing") because this driver also has runtime PM and the commit 560869100b99 ("clk: renesas: cpg-mssr: Restore module clocks during resume") will restore the clock on R-Car H3 environment. If the xhci_plat_suspend() disables the clk, the system cannot enable the clk in resume like the following behavior: < In resume > - genpd_resume_noirq() runs and enable the clk (enable_count = 1) - cpg_mssr_resume_noirq() restores the clk register. -- Since the clk was disabled in suspend, cpg_mssr_resume_noirq() will disable the clk and keep the enable_count. - Even if xhci_plat_resume() calls clk_prepare_enable(), since the enable_count is 1, the clk will be not enabled. After this patch is applied, the cpg-mssr driver will save the clk as enable, so the clk will be enabled in resume. Fixes: 835e4241e714 ("usb: host: xhci-plat: enable clk in resume timing") Signed-off-by: Yoshihiro Shimoda --- drivers/usb/host/xhci-plat.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 6f03830..6652e2d 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -360,7 +360,6 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) { struct usb_hcd *hcd = dev_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); - int ret; /* * xhci_suspend() needs `do_wakeup` to know whether host is allowed @@ -370,12 +369,7 @@ static int __maybe_unused xhci_plat_suspend(struct device *dev) * reconsider this when xhci_plat_suspend enlarges its scope, e.g., * also applies to runtime suspend. */ - ret = xhci_suspend(xhci, device_may_wakeup(dev)); - - if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk)) - clk_disable_unprepare(xhci->clk); - - return ret; + return xhci_suspend(xhci, device_may_wakeup(dev)); } static int __maybe_unused xhci_plat_resume(struct device *dev) @@ -384,9 +378,6 @@ static int __maybe_unused xhci_plat_resume(struct device *dev) struct xhci_hcd *xhci = hcd_to_xhci(hcd); int ret; - if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk)) - clk_prepare_enable(xhci->clk); - ret = xhci_priv_resume_quirk(hcd); if (ret) return ret;