Received: by 10.223.185.116 with SMTP id b49csp1967602wrg; Mon, 12 Feb 2018 01:51:34 -0800 (PST) X-Google-Smtp-Source: AH8x224AvZSUjEeWId9gjQPrwhwYautixqflkz9EKe8HW09EY/JhemeQETObEp3CaOWI3QprdSCO X-Received: by 2002:a17:902:2901:: with SMTP id g1-v6mr10058985plb.69.1518429094069; Mon, 12 Feb 2018 01:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518429094; cv=none; d=google.com; s=arc-20160816; b=iG000y1VSeOQn5tAJJw/RFdhLuyEHm6VV64PB1lalRXGqiBRWypglS5nOIh6Xtd67f LyOC3zhHCvR6f0MzVuMyDPkrcvYX3pxhjJ93KxRiA64Ks/PKKAlYRQ9BbqM396LbGVMv hFbunb0YFCx140WJFXkJMUyrg0p6bsLtRFUtBOa/i5ZO80FTxHXr7wk2flsDA/2zN4eQ FVtod09JL+KABvtMDo1zQE5nNYlzyVB3qIg49rQPR1oOFnf6pINCM511Jkf7h/dfZUWo DCoWM1qpqldAtSvQyiNkmXDGmeaFwfyyEdmCQ/egSsc5jqayqQj2qcYeP5plYUV4prgQ KqhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:arc-authentication-results; bh=VOQik/0xsFY2VmYIg+P4IqHa3VmYAcEUx9ILyprL1e0=; b=OFawJEYm8NrRFsPD9kZr6V3tjiqOAcfiJeEEBUdfdHCKytBva5GWu7tc6FJcuaJLb8 S8Hij7Sa79akTQSqVB2byAhcO1E5WXN7563fCCxUn0xozKyr5WJ8BHvJd9gYvXGu0K/W RLxmVDf94p6OnOnyIN7V6ULo3bmNiYIPVLf99yPbgtfoXYcihoVZPM6UTwAM41zhntH7 xOjf2fhoYuW0UlzJYsBGcH+y1SOd06ipDWKEAsGH0ZgG5CLyBTuFiYkBywTve1zNbjZw FA29CXHGRoPw3tllq0QwgtM8opw2VHjXgWN93lY3psU2nftTRtzSGpZgCvtK/j0C2qRw Ri3g== 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 v1si4967184pge.759.2018.02.12.01.51.17; Mon, 12 Feb 2018 01:51:34 -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 S932960AbeBLIsK (ORCPT + 99 others); Mon, 12 Feb 2018 03:48:10 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55696 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932804AbeBLIsI (ORCPT ); Mon, 12 Feb 2018 03:48:08 -0500 Received: by mail-wm0-f65.google.com with SMTP id 143so8066079wma.5; Mon, 12 Feb 2018 00:48:07 -0800 (PST) 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=VOQik/0xsFY2VmYIg+P4IqHa3VmYAcEUx9ILyprL1e0=; b=k3DCR93Vhiszosgqyj03AOrkqSBwPrLOFTFrvKUTk/AuGl05Sjs69VdKts0zvwPr5/ oaR5bABJf136CEMRq7InAQE3g2/yAN8P3mxpEsBsRvoMOCBv156/mxSnIHhSn5OuIvU4 N/YXuUYP4Fi8NOIXp7XxEylCm9jVkhPG9+HQv/o052TeIPdB2b28b3t5CY6yDFjxNo1F dY91WKCbm8BjH9f5ZgYQIoWO42x569BQGr6kA8N7q831txtuk5wtsvFAB8hwclYpIiVS mE5zH9ZAsdno2qPf3JZn+X3DajI7EaS6leGswpJpJGqRZenXBSSEyOM2mmdBYLdJ4j0W urjw== X-Gm-Message-State: APf1xPDpmefEwYcNkagz5f45R1BRfaotAvnoKpYGMK7Jov2ZZZbDVGDg OPqLlc06dq5yQnR9/ImKzgBjCN6Y X-Received: by 10.80.177.124 with SMTP id l57mr2119308edd.155.1518425286353; Mon, 12 Feb 2018 00:48:06 -0800 (PST) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com. [74.125.82.43]) by smtp.gmail.com with ESMTPSA id p12sm1697305edh.69.2018.02.12.00.48.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Feb 2018 00:48:06 -0800 (PST) Received: by mail-wm0-f43.google.com with SMTP id x4so7709339wmc.0; Mon, 12 Feb 2018 00:48:06 -0800 (PST) X-Received: by 10.28.9.18 with SMTP id 18mr2806241wmj.37.1518425285851; Mon, 12 Feb 2018 00:48:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.208.197 with HTTP; Mon, 12 Feb 2018 00:47:45 -0800 (PST) In-Reply-To: <1518316987.5562.7.camel@gmail.com> References: <1518316987.5562.7.camel@gmail.com> From: Chen-Yu Tsai Date: Mon, 12 Feb 2018 16:47:45 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [BUG]: A83T - AC100 gets the wrong number of parents To: Philipp Rossak Cc: linux-sunxi , Maxime Ripard , linux-rtc@vger.kernel.org, linux-kernel , linux-arm-kernel , linux-clk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 11, 2018 at 10:43 AM, Philipp Rossak wrote: > Hey, > > When I boot my A83T I get the following bootlog [1]. > > After some debugging, I found out that the function call: > clk_hw_get_num_parents() returns 2. After a look in the devicetree I > found out that this value should be 1, since we only have one parent > clock [3]. Not really. The first parent is registered within the rtc-ac100 driver, which also handles the clocks on the RTC side of the chip. The clock in the device tree is meant to tie the two parts of the chip together: the codec side provides a high speed clock to the RTC side. > Setting the variable num_parents to 1 fixes the problem, but this is no > soultion. A good fix would be to check the return value of clk_hw_get_parent_by_index() here: http://lxr.bootlin.com/linux/v4.16-rc1/source/drivers/rtc/rtc-ac100.c#L186 and skip it if it's NULL. The driver is setup this way because the codec side is not implemented, but the device tree binding is partially defined to include the clock. ChenYu > Regards, > Philipp > > > > [1]: https://pastebin.com/5c7hxjsS > [2]: http://lxr.bootlin.com/linux/v4.15/source/drivers/rtc/rtc-ac100.c# > L180 > [3]: http://lxr.bootlin.com/linux/v4.15/source/arch/arm/boot/dts/sun8i- > a83t-bananapi-m3.dts#L159 > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel