From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A51F4FA372C for ; Fri, 8 Nov 2019 17:53:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7AC1520673 for ; Fri, 8 Nov 2019 17:53:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730221AbfKHRxd (ORCPT ); Fri, 8 Nov 2019 12:53:33 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:59851 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726349AbfKHRxd (ORCPT ); Fri, 8 Nov 2019 12:53:33 -0500 X-Originating-IP: 92.137.17.54 Received: from localhost (alyon-657-1-975-54.w92-137.abo.wanadoo.fr [92.137.17.54]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 9FDA56000B; Fri, 8 Nov 2019 17:53:29 +0000 (UTC) Date: Fri, 8 Nov 2019 18:53:29 +0100 From: Alexandre Belloni To: Sebastian Reichel Cc: linux-clk@vger.kernel.org, linux-rtc@vger.kernel.org, Alessandro Zummo , Russell King , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, kernel@collabora.com Subject: Re: [RFCv1] rtc: m41t80: disable clock provider support Message-ID: <20191108175329.GH216543@piout.net> References: <20191108170135.9053-1-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191108170135.9053-1-sebastian.reichel@collabora.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/11/2019 18:01:35+0100, Sebastian Reichel wrote: > Congatec's QMX6 system on module (SoM) uses a m41t62 as RTC. The > modules SQW clock output defaults to 32768 Hz. This behaviour is > used to provide the i.MX6 CKIL clock. Once the RTC driver is probed, > the clock is disabled and all i.MX6 functionality depending on > the 32 KHz clock have undefined behaviour (e.g. the hardware watchdog > run to fast or slow). > > The normal solution would be to properly describe the clock tree > in DT, but from the kernel's perspective this is a chicken-and-egg > problem: CKIL is required very early, but the clock is only provided > after the I2C RTC has been probed. > > Technically everything is fine by not touching anything, so this > works around the issue by disabling the clock handling from the > RTC driver. I guess the proper solution would be to simply mark the > clock as always-enabled, but this does not seem to be supported by > the clock framework. > You need to have a consumer so this clock is not disabled by the CCF after seeing nobody uses it. If you need it early, you can have a look at rtc-sun6i.c but I would like that to not become a recurrent pattern, especially for discrete RTCs. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com