Received: by 10.223.185.116 with SMTP id b49csp7232267wrg; Thu, 1 Mar 2018 02:01:38 -0800 (PST) X-Google-Smtp-Source: AG47ELv/JePmhR3+c85VyyKBPEQ3A2j3AKXVf3qvumQAPuMQ+h+BUQxkrso+3BNmDwE2zrhtyey4 X-Received: by 10.99.127.90 with SMTP id p26mr1099269pgn.268.1519898497915; Thu, 01 Mar 2018 02:01:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519898497; cv=none; d=google.com; s=arc-20160816; b=EbKzyCVnA4tRZzYCXCukPG/bbFD7FC5+x5FTegiooTxV/FMQ9yS0RPYEgvTLsMDI1y UYOYfsfRg3kyGAdKy1+YaYZKLBU1Ft4RAzTS9UY+y2peoyvobTt8adxzdnPc/ntwjdZi TOBt1k6TsEOXXGrCaQJNG576G1e+8kOzXvt1BwbqpacN/+41gp4M+eWNwaP6l6TQBPAA A+X605H7EKiM2hNJFuWmcg6X3GaYeo6SUEH4BmOJs/USwGYs1/s/RSDc7Ur1O2ucf7lr w1Z4qDRcvEf8BvW/uFycckioqFoGoN2tE65pMQDN3+OMNfxhs7a9YQEZqQjZNHB9+brp +Oyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=jbWoPIxFdE3uSF1j2fJr8w26EqdvG0LBmVf07qMlZ3w=; b=DM1twb9lzgQ1em3MQyPXlUIZw5cZgA/ju6efBRD9uPRyjhjBosUegcyvIPOREPWaUR oQnVvx0U6y7GIvG1rVHvABLAfuazbug5FF9oUThtAzJ+dZmSRn7B8iuz3b/1Gv1mfQOS zOL2D6h5FR3LkVXmdKTc5o5IaPEFFZOLtiRvGjHSPVS/ziI3xUnznVeTz1nAGCilH12R iBdA7UoN1fpaIH6gG7xJus7s9e9xv0JacR3ic4IuPF7J24dAaerzQq3XwHYA4m3DLTQS Xp+jnQgdA+wn4fuAeOcQFiOfdpJVyPM0cHr6SzO8MDuU5Dzywlm6e5em4oanQkEj0O0y 3ydw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l24si2234411pgo.580.2018.03.01.02.01.22; Thu, 01 Mar 2018 02:01:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967370AbeCAKAB (ORCPT + 99 others); Thu, 1 Mar 2018 05:00:01 -0500 Received: from mail.bootlin.com ([62.4.15.54]:36489 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967231AbeCAJ74 (ORCPT ); Thu, 1 Mar 2018 04:59:56 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 0EB2C20650; Thu, 1 Mar 2018 10:59:54 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id AB6022037A; Thu, 1 Mar 2018 10:59:43 +0100 (CET) Date: Thu, 1 Mar 2018 10:59:44 +0100 From: Alexandre Belloni To: Philipp Rossak Cc: wens@csie.org, a.zummo@towertech.it, maxime.ripard@bootlin.com, mturquette@baylibre.com, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-rtc@vger.kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4] rtc: ac100: Fix ac100 determine rate bug Message-ID: <20180301095944.GT1479@piout.net> References: <20180226211901.9805-1-embed3d@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180226211901.9805-1-embed3d@gmail.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 26/02/2018 at 22:19:01 +0100, Philipp Rossak wrote: > This patch fixes a bug, that prevents the Allwinner A83T and the A80 > from a successful boot. > > The bug is there since v4.16-rc1 and appeared after the clk branch was > merged. > > You can find the shortend trace below: > > Unable to handle kernel NULL pointer dereference at virtual address > 00000000 > pgd = (ptrval) > [00000000] *pgd=00000000 > Internal error: Oops: 5 [#1] SMP ARM > Modules linked in: > CPU: 0 PID: 49 Comm: kworker/0:1 Not tainted 4.15.0-10190-gb89e32ccd1be #2 > Hardware name: Allwinner sun8i Family > Workqueue: events deferred_probe_work_func > PC is at clk_hw_get_rate+0x0/0x34 > LR is at ac100_clkout_determine_rate+0x48/0x19c > > [ ... ] > > (clk_hw_get_rate) from (ac100_clkout_determine_rate+0x48/0x19c) > (ac100_clkout_determine_rate) from (clk_core_set_rate_nolock+0x3c/0x1a0) > (clk_core_set_rate_nolock) from (clk_set_rate+0x30/0x88) > (clk_set_rate) from (of_clk_set_defaults+0x200/0x364) > (of_clk_set_defaults) from (platform_drv_probe+0x18/0xb0) > > To fix that bug, we first check if the return of the > clk_hw_get_parent_by_index is non zero. If it is zero we skip that > clock parent. > > The BUG report could be found here: https://lkml.org/lkml/2018/2/10/198 > > Fixes: 04940631b8d2 ("rtc: ac100: Add clk output support") > > Signed-off-by: Philipp Rossak > --- > > Changes in v4: > * add more information to the comment > Changes in v3: > * add information when the bug appeared > * make the comment more clear > Changes in v2: > * add tag Fixes: ... to commit message > * add comment to if statement why we are doing this check > > drivers/rtc/rtc-ac100.c | 24 +++++++++++++++++++++++- > 1 file changed, 23 insertions(+), 1 deletion(-) > Applied, thanks. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com