From patchwork Tue Dec 26 13:32:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Grinberg X-Patchwork-Id: 10133143 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 16C2060211 for ; Tue, 26 Dec 2017 13:33:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0896A2CD5E for ; Tue, 26 Dec 2017 13:33:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F16142CDD5; Tue, 26 Dec 2017 13:33:14 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham 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 8BE032CD5E for ; Tue, 26 Dec 2017 13:33:14 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=Nsakxn6sNKYrAskKX5A5FpscGbOn5ecsX6/LTH0guEU=; b=dDZ LxPULbJyA7CQZhlsuLxkck2/C/XkumHACC0w+4DUMuh029y6EW+gOqJONlxBfO6mD1Rd583uljcLR mZR6JVrGPQFdnobSwOHm/t2SZ86EpBUNLE3myG8bC/2hmq8IADv6i6fjYaRhNglcnQtLF1RXnG5mD y9f3ys776kacEyUvZWsP3TMy5fQeFUhjiAV8HBveCCsdPcJvVnXTlpEdw+yJrz7YQL6wVRkg3LlGl BRNgWr/jLyCj3UDOnEAFgS44WjocrY+NxS+zrPXUqG7Bsb7d43TJPDOsBU2+yssKENSXv5EinvJSU /T8uLhfw2RfsBsy9IEcxSJVdxGkqhBA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eTpM0-0005Uq-Su; Tue, 26 Dec 2017 13:33:12 +0000 Received: from softlayer.compulab.co.il ([50.23.254.55] helo=compulab.co.il) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eTpLw-0005Si-NQ for linux-arm-kernel@lists.infradead.org; Tue, 26 Dec 2017 13:33:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=compulab.co.il; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zAM+xrIBS6NWwGzzmC2HHsLBtbH99Wa5hRTADuX24D0=; b=tSaySiol08JNgEWAJjzdi+PJmH 7uKuFNH6wAyEO4Hx398WK/nYNCXGUZkhFTU3Nuicp3Vv3akrUWuu0nIsO66Iz2O/6yBHQhv4wBHUX INcp7zi/104mWsGC+0XoNbDEJ9Dmk7l8lZlWH62iM+uqv2g9x0mr0eZSFliqvWfvtdcwKDxm7Mmfu Ou+pDMFHK0G++QYzd2rkZ6FFFENj8cuGMY9EoIHTShLS9rciUk8puaCuq+5KrsuyqDYznXrED59Ns hJeM34Pz6ulnoBpsVXdHDzSrHL/Wv5J+mXWLXKwppzusDxLN8nc+izHXyvYKnYSBd0Orh+4K6plfe L4iskomg==; Received: from [37.142.126.90] (port=35402 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.87) (envelope-from ) id 1eTpLk-0001B0-QF; Tue, 26 Dec 2017 15:32:57 +0200 Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 97E4D482370; Tue, 26 Dec 2017 15:32:55 +0200 (IST) Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dCbzDBRJQy2b; Tue, 26 Dec 2017 15:32:55 +0200 (IST) Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 1E06D482373; Tue, 26 Dec 2017 15:32:55 +0200 (IST) X-Virus-Scanned: amavisd-new at zimbra-mta.compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VRmPHxYV46mk; Tue, 26 Dec 2017 15:32:55 +0200 (IST) Received: from compulab.co.il (grinberg-linux.compulab.local [192.168.11.13]) by zimbra-mta.compulab.co.il (Postfix) with SMTP id E4ADE482370; Tue, 26 Dec 2017 15:32:54 +0200 (IST) Received: (nullmailer pid 11701 invoked by uid 1000); Tue, 26 Dec 2017 13:32:55 -0000 From: Igor Grinberg To: Robert Jarzmik , Daniel Mack , Haojian Zhuang Subject: [PATCH] ARM: pxa: ulpi: fix ulpi timeout and slowpath warn Date: Tue, 26 Dec 2017 15:32:53 +0200 Message-Id: <20171226133253.11653-1-grinberg@compulab.co.il> X-Mailer: git-send-email 2.13.6 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - softlayer.compulab.co.il X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Get-Message-Sender-Via: softlayer.compulab.co.il: acl_c_recent_authed_mail_ips_text_entry: grinberg@compulab.co.il|compulab.co.il X-Authenticated-Sender: softlayer.compulab.co.il: grinberg@compulab.co.il X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171226_053308_862066_969A4584 X-CRM114-Status: GOOD ( 12.32 ) 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: Michael Turquette , Stephen Boyd , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Igor Grinberg MIME-Version: 1.0 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 Both cm-x300 and pxa3xx-ulpi use the plain clk_{en,dis}able() API. With the new clocking framework this results in warnings of type: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:714 clk_core_enable+0x90/0x9c Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0-rc5-cm-x300+ #15 Hardware name: CM-X300 module [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (__warn+0xd8/0x100) [] (__warn) from [] (warn_slowpath_null+0x3c/0x48) [] (warn_slowpath_null) from [] (clk_core_enable+0x90/0x9c) [] (clk_core_enable) from [] (clk_core_enable_lock+0x18/0x2c) [] (clk_core_enable_lock) from [] (cm_x300_u2d_init+0x4c/0xe8) [] (cm_x300_u2d_init) from [] (pxa3xx_u2d_probe+0xe0/0x244) [] (pxa3xx_u2d_probe) from [] (platform_drv_probe+0x38/0x88) ... ------------[ cut here ]------------ and alike... And finally, it results in: ------------[ cut here ]------------ pxa310_ulpi_poll: ULPI access timed out! OTG transceiver init failed ------------[ cut here ]------------ It might be that disabling the warning in kernel config would also do the job, but IMO a better solution would be to switch to clk_prepare_enable() and clk_disable_unprepare() APIs. Signed-off-by: Igor Grinberg --- arch/arm/mach-pxa/cm-x300.c | 4 ++-- arch/arm/mach-pxa/pxa3xx-ulpi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 912e905a6af6..9ccfb10a9e0f 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c @@ -521,7 +521,7 @@ static int cm_x300_u2d_init(struct device *dev) pr_err("failed to get CLK_POUT: %d\n", err); return err; } - clk_enable(pout_clk); + clk_prepare_enable(pout_clk); err = cm_x300_ulpi_phy_reset(); if (err) { @@ -536,7 +536,7 @@ static int cm_x300_u2d_init(struct device *dev) static void cm_x300_u2d_exit(struct device *dev) { if (cpu_is_pxa310()) { - clk_disable(pout_clk); + clk_disable_unprepare(pout_clk); clk_put(pout_clk); } } diff --git a/arch/arm/mach-pxa/pxa3xx-ulpi.c b/arch/arm/mach-pxa/pxa3xx-ulpi.c index c00450764352..b3e2016f24b1 100644 --- a/arch/arm/mach-pxa/pxa3xx-ulpi.c +++ b/arch/arm/mach-pxa/pxa3xx-ulpi.c @@ -256,7 +256,7 @@ int pxa3xx_u2d_start_hc(struct usb_bus *host) if (!u2d) return 0; - clk_enable(u2d->clk); + clk_prepare_enable(u2d->clk); if (cpu_is_pxa310()) { pxa310_u2d_setup_otg_hc(); @@ -276,7 +276,7 @@ void pxa3xx_u2d_stop_hc(struct usb_bus *host) if (cpu_is_pxa310()) pxa310_stop_otg_hc(); - clk_disable(u2d->clk); + clk_disable_unprepare(u2d->clk); } EXPORT_SYMBOL_GPL(pxa3xx_u2d_stop_hc);