From patchwork Fri Oct 20 18:24:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10020847 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 5CCE960211 for ; Fri, 20 Oct 2017 18:24:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 482FA209CE for ; Fri, 20 Oct 2017 18:24:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39EAE28919; Fri, 20 Oct 2017 18:24:13 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 D0CD7209CE for ; Fri, 20 Oct 2017 18:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752498AbdJTSYM (ORCPT ); Fri, 20 Oct 2017 14:24:12 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:54949 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752425AbdJTSYL (ORCPT ); Fri, 20 Oct 2017 14:24:11 -0400 Received: by mail-pf0-f194.google.com with SMTP id n89so12161725pfk.11; Fri, 20 Oct 2017 11:24:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ckPMJhHnRCxCGhKZ4PsRy+XoU7hgN80MnBmXqChdVkY=; b=D+DdPNqULKe1oU6NFbJwdSFOe3HKEV44s/2tgR8AZ970W1nYxXBVpOuFGwthtpu02J BJQ2sZ2vv6Udmlu8r0en31GSbt72q9IGBs+GQ5SBoxjD5w+TjO2kMI07IcrsMefKoGbn 0YuxQWBtK+EEueIIl96rb8zuiRimkwu0ZFBe320zImJEMkH7CRlH8bCMbApPtTw8qjoT qIXrQpBPFlL5E5StWAwNbkEuCe5A/l2oYWwzTTq4JVOZmnGa7O4nqkcrYiSvIy6aOIWh HRduN8aTeDW2z+oRwJ59BCoVZST132E0rHHzUVI4CE5V/BxMwelB2zGAMbBZlVrtH1rQ vJfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ckPMJhHnRCxCGhKZ4PsRy+XoU7hgN80MnBmXqChdVkY=; b=s6BOj41EQITpdE32gXHA8ltI/Gtk7Xb0CdMVwIZaYL7wEhX8LCE98EUxeMdQoewO7c /vIIgONU2+ON56iUPk5Esg00xBThEpKLRbwjAkXleNO9M0b+A4mzpSnpOvqjB1byc8iq Tzggt+RBp5J1b2pdt0U9A4AGppVtQG7tUvWXCw/HPnZ0JdiKIRrN1PVr3ttSFIrHJp8L A2cMHnGqYatfbSC5bWv4guWB4qGrjmPP/u79+s3hJOKgkHyxZPybNBeC04B4SDK+Yo70 4wZ0PeOS6lTLOau7ZCeFSl4JCB8g63dR3v20qb2L/v6VfC0YeAMepmstBUI+hLXAlzw9 Iqpw== X-Gm-Message-State: AMCzsaUT33tvsfQebZ/vP34i2g2UrB7UhE8afWCASLV9HAfbljFMo0W5 X/wtNwqID9sJFc0OC8c9piI= X-Google-Smtp-Source: ABhQp+RtTjxHGDNlxZe1x5Phzb3kSujhs15bv3R1UWaHd+OpFLXaPMKSJNig/8vftcQl2EeMKG/Zkw== X-Received: by 10.84.133.132 with SMTP id f4mr4797607plf.197.1508523850360; Fri, 20 Oct 2017 11:24:10 -0700 (PDT) Received: from Asurada-Nvidia (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id m25sm2852471pfg.49.2017.10.20.11.24.09 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 20 Oct 2017 11:24:09 -0700 (PDT) Date: Fri, 20 Oct 2017 11:24:07 -0700 From: Nicolin Chen To: Jon Hunter Cc: Thierry Reding , sboyd@codeaurora.org, pdeschrijver@nvidia.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org, mturquette@baylibre.com, pgaikwad@nvidia.com Subject: Re: [PATCH v2] clk: tegra: Use readl_relaxed_poll_timeout_atomic in tegra210_clock_init Message-ID: <20171020182406.GA12980@Asurada-Nvidia> References: <1505502613-11801-1-git-send-email-nicoleotsuka@gmail.com> <20171019092919.GA7252@Asurada> <20171019094422.GI9005@ulmo> <20171019184223.GA7415@Asurada-Nvidia> <731a934a-4e78-b96d-239f-14cf83079605@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <731a934a-4e78-b96d-239f-14cf83079605@nvidia.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Oct 20, 2017 at 11:20:24AM +0100, Jon Hunter wrote: > > On 19/10/17 19:42, Nicolin Chen wrote: > > On Thu, Oct 19, 2017 at 11:44:22AM +0200, Thierry Reding wrote: > >>>> Below is the call trace of tegra210_init_pllu() function: > >>>> start_kernel() > >>>> -> time_init() > >>>> --> of_clk_init() > >>>> ---> tegra210_clock_init() > >>>> ----> tegra210_pll_init() > >>>> -----> tegra210_init_pllu() > > > >> I'm wondering why we're not seeing a splat for this. Usually the kernel > >> will warn if you sleep during atomic context. Does this mean we're just > >> not hitting that case? > > > > Yes. > > > >> readx_poll_timeout() has a might_sleep_if(), and > >> therefore it should always cause the splat. > > > > That's true as long as CONFIG_DEBUG_ATOMIC_SLEEP is enabled locally. > > > >> Any ideas why this has gone unnoticed for all this time? > > > > We can see in the tegra210_init_pllu() function that it'll not call > > tegra210_enable_pllu() if pllu is already enabled (by bootloader). > > I was thinking that same and so I clobbered the PLLU enable bit with > u-boot, however, then the kernel appears to hang on boot when enabling > the PLL. So although this is probably a separate issue, I am curious if > you have booted the mainline with the PLLU disabled? I am not sure if clearing the enable bit only would work. But the test below should be able to verify the situation -- setting the PLLU_BASE register to its reset value. --- To unsubscribe from this list: send the line "unsubscribe linux-clk" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/clk/tegra/clk-tegra210.c b/drivers/clk/tegra/clk-tegra210.c index ea695c4..2279373 100644 --- a/drivers/clk/tegra/clk-tegra210.c +++ b/drivers/clk/tegra/clk-tegra210.c @@ -2602,6 +2602,7 @@ static int tegra210_init_pllu(void) u32 reg; int err; + writel_relaxed(0x1011902, clk_base + PLLU_BASE); tegra210_pllu_set_defaults(&pll_u_vco_params); /* skip initialization when pllu is in hw controlled mode */ reg = readl_relaxed(clk_base + PLLU_BASE);