Linux-RTC Archive on lore.kernel.org
 help / color / Atom feed
From: Sebastian Reichel <sebastian.reichel@collabora.com>
To: linux-clk@vger.kernel.org, linux-rtc@vger.kernel.org
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Russell King <linux@armlinux.org.uk>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-kernel@vger.kernel.org, kernel@collabora.com,
	Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: [RFCv1] rtc: m41t80: disable clock provider support
Date: Fri,  8 Nov 2019 18:01:35 +0100
Message-ID: <20191108170135.9053-1-sebastian.reichel@collabora.com> (raw)

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.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
---
Hi,

This is a downstream workaround/hack for the issue described in the
commit message. I would like to upstream a board based on Congatec's
QMX6, which requires a proper solution for this. Do you think it
would be ok to have an always-on flag for clocks similar to regulators?

-- Sebastian
---
 drivers/rtc/rtc-m41t80.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index 5f46f85f814b..81743d93d03e 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -973,7 +973,7 @@ static int m41t80_probe(struct i2c_client *client,
 		}
 	}
 #endif
-#ifdef CONFIG_COMMON_CLK
+#if 0
 	if (m41t80_data->features & M41T80_FEATURE_SQ)
 		m41t80_sqw_register_clk(m41t80_data);
 #endif
-- 
2.24.0.rc1


             reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-08 17:01 Sebastian Reichel [this message]
2019-11-08 17:53 ` Alexandre Belloni
2019-11-08 22:34   ` Sebastian Reichel
2019-11-09  0:24     ` Stephen Boyd
2019-11-09  1:41       ` Sebastian Reichel
2019-11-09  6:53         ` Stephen Boyd
2019-11-12 15:15           ` Sebastian Reichel
2019-11-12 22:20             ` Stephen Boyd
2019-11-13 22:27               ` Sebastian Reichel

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191108170135.9053-1-sebastian.reichel@collabora.com \
    --to=sebastian.reichel@collabora.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kernel@collabora.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org
	public-inbox-index linux-rtc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git