From patchwork Mon May 28 07:08:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Nazzareno Trimarchi X-Patchwork-Id: 10429927 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 4F12F60327 for ; Mon, 28 May 2018 07:08:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D28F28BBE for ; Mon, 28 May 2018 07:08:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31D2928BC0; Mon, 28 May 2018 07:08:56 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 3F1C928BBE for ; Mon, 28 May 2018 07:08:55 +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:To:Subject:Message-ID:Date:From: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=phq3ZXDqwwTERsFUzI3TUoPgOKQbXgKoNzBUKD4H1cY=; b=ThG/P4KkYts3mh wzk8Z5t11TNAfhMV5E4g9QX12gvExkzGnj/uJ0sl1BRnEw5tuTwaIfbGcRuX9GZ89sEzRFslhZ6Zz IG6vrmZTGzbWlTTNgHNTO3nsmr4J0QaadsioWtUVgC87wOTTIX5SDclKtxbNwkOzItlhjcyphykH1 ne8OgVAO0Rs1WrSYwdbvnjuwYoccwjO3CgJOJYKouayBtkYfLrjYXX+hLbGYBYpfJnZ+2DIo01lRP DQ0VltdKWS4jYi5t22JmeSb9YYCBpwj3mhOYf6ILO07e43bS223uiCS9WnU2M8nEi043UinU1hSqd NofyOyQYTpuvnYIuROXQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNCGy-00076e-Kg; Mon, 28 May 2018 07:08:52 +0000 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fNCGi-0006ug-48 for linux-arm-kernel@lists.infradead.org; Mon, 28 May 2018 07:08:48 +0000 Received: by mail-wr0-x22d.google.com with SMTP id i12-v6so18514017wrc.4 for ; Mon, 28 May 2018 00:08:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XBRtFfnPg+Lsaig3em1m0tg9V18E6YRbh2wZTl5Aync=; b=O3afUuJPacHsJTfWXwy1ruEjeg5Dbnlb66zq/WCNNuQ/y9r8XKxNKB0t9kar/BRrbc tl4zrXcT3SOBs9rrCpXGmiBOMustropYNocOSYornSFWMihwDX0WiKJEavJUBmCqWly7 2P+4PI+tjF1KxK6Q0ywvVzbEnhj6tMYj/PwYg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XBRtFfnPg+Lsaig3em1m0tg9V18E6YRbh2wZTl5Aync=; b=As51dUPSKP1sZ9jcADgGbbIMTKLUKZGOSLCyZsG6C1GpeNB2Kjauq6HTCrXvBTCck/ 9Y3ATpVp32xmCec4qXI/no+VgiYbaSoohJkQlTMKScWtqXIw0KbKjPz2bRI3BJN9T1d2 MwQwSiwq2Un/zQxigrFAFcyPzbv14Y2TVeh2fCgOGiq96/ASwKi59nchCZPyCLzuMN45 5D/4nFLKc4Z5tnv7fMLKblE2FzH50SnLDpvjDpt928TX2xgQHnuLRKL6a0Rl1nhDiw8k /ypVDitqVSbqd+yjL5V6bhO3xZI2w9XOd/OCDMnbxmor59D71G+/M0zqDUzpNIxDtkdd pe1g== X-Gm-Message-State: ALKqPwd0iCEKfZIRU4/Yzf5gp4q1ptUKVRJ1PcNUnbqaepG81Y8PIeBS 9lAHTAiFJv433OxG0WfFEqz1Fke3UC0cNT/aZQRdvg== X-Google-Smtp-Source: AB8JxZqvnpDgXZrRGT6b9to39YKaJQbRm8xS95LQrrhriOpZz2cKbOe9ljI88WGwcPQSBx5tGuHWbrAXmHiJ9ksj1Dk= X-Received: by 2002:adf:ad8a:: with SMTP id w10-v6mr10423944wrc.83.1527491303577; Mon, 28 May 2018 00:08:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:8684:0:0:0:0:0 with HTTP; Mon, 28 May 2018 00:08:22 -0700 (PDT) In-Reply-To: <20180514111726.lnxpegipqklyetmv@flea> References: <20180514075727.uxggyhmbahvhestx@flea> <20180514082744.ydmfg5mzsbol5onu@flea> <20180514090618.r5xc3elzpvfp47f4@flea> <20180514111726.lnxpegipqklyetmv@flea> From: Michael Nazzareno Trimarchi Date: Mon, 28 May 2018 09:08:22 +0200 Message-ID: Subject: Re: Allwinner A64: Issue on external rtc clock to wifi chip To: Maxime Ripard X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180528_000836_688041_378E8738 X-CRM114-Status: GOOD ( 22.00 ) 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: devicetree , linux-sunxi , linux-kernel , Chen-Yu Tsai , Jagan Teki , linux-arm-kernel 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 Hi Maxime On Mon, May 14, 2018 at 1:17 PM, Maxime Ripard wrote: > On Mon, May 14, 2018 at 03:12:49PM +0530, Jagan Teki wrote: >> On Mon, May 14, 2018 at 2:36 PM, Maxime Ripard >> wrote: >> > On Mon, May 14, 2018 at 02:34:22PM +0530, Jagan Teki wrote: >> >> On Mon, May 14, 2018 at 1:57 PM, Maxime Ripard >> >> wrote: >> >> > On Mon, May 14, 2018 at 01:34:56PM +0530, Jagan Teki wrote: >> >> >> On Mon, May 14, 2018 at 1:27 PM, Maxime Ripard >> >> >> wrote: >> >> >> > Hi, >> >> >> > >> >> >> > On Mon, May 14, 2018 at 12:37:49PM +0530, Jagan Teki wrote: >> >> >> >> Hi Maxime and All, >> >> >> >> >> >> >> >> We are trying to bring-up AP6330 Wifi chip for A64 board. We noticed >> >> >> >> to have an external rtc clock has driven from wifi chip. >> >> >> >> >> >> >> >> So the devicetree is configured according to this as below. >> >> >> >> >> >> >> >> / { >> >> >> >> wifi_pwrseq: wifi-pwrseq { >> >> >> >> compatible = "mmc-pwrseq-simple"; >> >> >> >> clocks = <&rtc 1>; >> >> >> >> clock-names = "ext_clock"; >> >> >> >> reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ >> >> >> >> post-power-on-delay-ms = <400>; >> >> >> >> }; >> >> >> >> }; >> >> >> >> >> >> >> >> &rtc { >> >> >> >> clock-output-names = "rtc-osc32k", "rtc-osc32k-out"; >> >> >> >> clocks = <&osc32k>; >> >> >> >> #clock-cells = <1>; >> >> >> >> }; >> >> >> >> >> >> >> >> &mmc1 { >> >> >> >> pinctrl-names = "default"; >> >> >> >> pinctrl-0 = <&mmc1_pins>; >> >> >> >> vmmc-supply = <®_dcdc1>; >> >> >> >> vqmmc-supply = <®_eldo1>; >> >> >> >> mmc-pwrseq = <&wifi_pwrseq>; >> >> >> >> bus-width = <4>; >> >> >> >> non-removable; >> >> >> >> status = "okay"; >> >> >> >> >> >> >> >> brcmf: wifi@1 { >> >> >> >> reg = <1>; >> >> >> >> compatible = "brcm,bcm4329-fmac"; >> >> >> >> interrupt-parent = <&r_pio>; >> >> >> >> interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* WL-WAKE-AP: PL3 */ >> >> >> >> interrupt-names = "host-wake"; >> >> >> >> }; >> >> >> >> }; >> >> >> >> >> >> >> >> And observed rtc-osc32k-out clock is never enabled[1] and the value of >> >> >> >> LOSC_OUT_GATING is 0x0 which eventually not enabling >> >> >> >> LOSC_OUT_GATING_EN >> >> >> >> >> >> >> >> Pls. let us know if we miss anything here? >> >> >> >> >> >> >> >> [1] https://paste.ubuntu.com/p/X2By4q8kD2/ >> >> >> > >> >> >> > Could you paste your config and the logs from a boot to? >> >> >> >> >> >> .config >> >> >> https://paste.ubuntu.com/p/w9w2KB7RFc/ >> >> >> >> >> >> dmesg >> >> >> https://paste.ubuntu.com/p/mrZGk5bWRR/ >> >> > >> >> > This is kind of weird. Have you tested with a 4.17 kernel? We have >> >> > runtime_pm changes lined up in next, so that might be a regression >> >> > there, even though we tested it with Quentin at some point. >> >> >> >> This is 4.17-rc4 do you want to try it on 4.16 ? >> > >> > No, this is next-20180503. Please try with 4.17-rc4 >> >> Couldn't find any different in behaviour [2] >> >> [2] https://paste.ubuntu.com/p/m3PGBwrv6W/ > > It's hard to tell without the board, but have you looked at the return > value of devm_clk_get in the pwrseq code? > > Enabling the clk ftrace events would also help. > The driver has one bug. Michael > Maxime > > -- > Maxime Ripard, Bootlin (formerly Free Electrons) > Embedded Linux and Kernel engineering > https://bootlin.com diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c index 2e6fb27..a66f40c 100644 --- a/drivers/rtc/rtc-sun6i.c +++ b/drivers/rtc/rtc-sun6i.c @@ -74,7 +74,7 @@ #define SUN6I_ALARM_CONFIG_WAKEUP BIT(0) #define SUN6I_LOSC_OUT_GATING 0x0060 -#define SUN6I_LOSC_OUT_GATING_EN BIT(0) +#define SUN6I_LOSC_OUT_GATING_EN 0 You need to pass bit_idx that is 0 and not BIT(0)