Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp877345pxy; Wed, 5 May 2021 16:41:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMSwe45ffxSI66AQCeD+KmRjJL7hZ3e+cUSYPtJe5x5cFbQ4252LdVKDdJv9Ie59llbjis X-Received: by 2002:a17:906:c14c:: with SMTP id dp12mr1274918ejc.312.1620258102750; Wed, 05 May 2021 16:41:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620258102; cv=none; d=google.com; s=arc-20160816; b=L1LUyHylwutzlHo+9XfQJV8cmH7JqjaU7jtJAy290sYJHDyMXF9WkBeuDCGPmzsNgj jgpuJ9t31HO3BK+ypXkUcagj5CoigslDLz4q9cyP51RFBEA4+RL19SZj74++qohHghzp XCnsQ8dwgb9lKnZt8gewGApHuCgPJUNSzeIEAv34NiRRMAXMCFuAmoyvWWVOTmAipFvd s6ojxLmS6g/aRGIucIiaZ7JqQ2Gej4OOEZ6OGHmjYD5evtOmy98hq+8CdHYf29Lf8Qvz Agbixc70shqxbrAzGa8KxXgSF7hYtshnAfECxTscszPorlopjpUxUwrkWCOdC78WWQUy P0xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=XnP8SPohUuOUrcF5CvnUQpW+7Amf898SU0gjNiJgV3k=; b=yn2khOrIX8Zj1qo1o/pzrRdI2L4ZQRKgTzP2AYvcPMiuK1V3pH4NZgwib9hXkRRgkX bxK4PJUp2rch9TpaOukuwJCsmuo+0QdDFJBxmuD5Q4ddVq0kAlP/ncVfVez2y9wW8ugI xczzebkc/I79nAGCvnQmSvCqTPUx9d9h0QS/ySSSNEYHf+R91eG4rLij812WBOea+3um PHxAXJJY9GqWRbMCySTg9nzMGVrbiguUaU0PSXT4r6CvgqFInEj0fE4f3evHt8Y/ErbA y+0FxxARAMlUJSjgFl83bBkgSra3xDe4aTEz8ArnGQh+ypG/Cek/kpKCmR4iq8/rUo6V YNzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q14si658738ejd.316.2021.05.05.16.41.18; Wed, 05 May 2021 16:41:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230197AbhEEXB6 (ORCPT + 99 others); Wed, 5 May 2021 19:01:58 -0400 Received: from mail-oi1-f169.google.com ([209.85.167.169]:42717 "EHLO mail-oi1-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbhEEXB6 (ORCPT ); Wed, 5 May 2021 19:01:58 -0400 Received: by mail-oi1-f169.google.com with SMTP id v24so3737241oiv.9; Wed, 05 May 2021 16:01:01 -0700 (PDT) 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; bh=XnP8SPohUuOUrcF5CvnUQpW+7Amf898SU0gjNiJgV3k=; b=uZHnLcFCorP7hN7f+KbmkKVtC8VUYLczc4M5Uv4Ml6KvMppoKDSguaXNeZ7GpO4dF5 MfDLJ1z7rnVFNli7Fer8t4UXl7N/6vRmPZFcQagflt1qsAYjzTctjpyN9sfGIHyDqZYn voGbgtHuazwEmfQUvycZ2HzMJr5w3URAJu7j3Qt5cGWTNnVU+Pwz1c38EwzGAkt6DHu8 D89LQtI5vpWHXxCldYZDMUX+Vmb6Q+E7o87I/ToE1yLf3OGjseoWs4Jfs/0MiXYWsS2l UZViQUW31KwtktlabKF+RBNTKVd6rAZ9qeMx2ECF93RDqOkxr/7J0iROoxgWVta2yk76 AOug== X-Gm-Message-State: AOAM532LIrEh4Y++HUbtt/GDPgNcMEGXqHwJBIJKMj8J2LKnkTFlsgKg yHqjWLse7VBcngOm5Cr7pw== X-Received: by 2002:aca:2813:: with SMTP id 19mr8842971oix.23.1620255660629; Wed, 05 May 2021 16:01:00 -0700 (PDT) Received: from robh.at.kernel.org (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.gmail.com with ESMTPSA id r14sm217795oth.3.2021.05.05.16.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 16:00:59 -0700 (PDT) Received: (nullmailer pid 3001129 invoked by uid 1000); Wed, 05 May 2021 23:00:57 -0000 Date: Wed, 5 May 2021 18:00:57 -0500 From: Rob Herring To: Sebastian Reichel Cc: Fabio Estevam , linux-arm-kernel@lists.infradead.org, Miquel Raynal , Alessandro Zummo , Shawn Guo , dri-devel@lists.freedesktop.org, Rob Herring , linux-mtd@lists.infradead.org, Saravana Kannan , linux-kernel@vger.kernel.org, Sascha Hauer , NXP Linux Team , devicetree@vger.kernel.org, linux-rtc@vger.kernel.org, kernel@collabora.com, Philipp Zabel , Alexandre Belloni , David Airlie , Pengutronix Kernel Team Subject: Re: [PATCHv2 1/5] rtc: m41t80: add support for fixed clock Message-ID: <20210505230057.GA3001067@robh.at.kernel.org> References: <20210428222953.235280-1-sebastian.reichel@collabora.com> <20210428222953.235280-2-sebastian.reichel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210428222953.235280-2-sebastian.reichel@collabora.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 29 Apr 2021 00:29:49 +0200, 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 has undefined behaviour. For example when using > the hardware watchdog the system will likely do arbitrary reboots. > > Referencing the m41t62 directly results in a deadlock. The kernel > will see, that i.MX6 system clock needs the RTC clock and do probe > deferral. But the i.MX6 I2C module never becomes usable without the > i.MX6 CKIL clock and thus the RTC's clock will not be probed. So > from the kernel's perspective this is a chicken-and-egg problem. > > Technically everything is fine by not touching anything, since > the RTC clock correctly enables the clock on reset (i.e. on > battery backup power loss) and also the bootloader enables it > in case an something (e.g. an unpatched kernel) disabled this > incorrectly. > > A workaround for this issue is describing the square wave pin > as fixed-clock, which is registered early and basically how > this pin is used on the i.MX6. > > Suggested-by: Saravana Kannan > Signed-off-by: Sebastian Reichel > --- > Documentation/devicetree/bindings/rtc/rtc-m41t80.txt | 9 +++++++++ > drivers/rtc/rtc-m41t80.c | 12 ++++++++++++ > 2 files changed, 21 insertions(+) > Reviewed-by: Rob Herring