From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A964B71 for ; Wed, 16 Jun 2021 09:14:36 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id E05DE580064; Wed, 16 Jun 2021 05:14:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 16 Jun 2021 05:14:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm3; bh=O Q3mH14ssHehAX5EBuHe0ZN2vZKDVl/XkALKv3ydHts=; b=kRkGMEktwO4/GNbKL B/M6Cs/SVuLdcXQbvM/ZQuzuGVu+MEHIYcPbqTtxEfqQfs5n0MZd2v3L5dHENFyI qm5qTiH7zpI68Uo6yxBtUXTgGTWKQ8qvVXvfuYxXNPPcEMsxtp9tCHhwz4EItqzK jjizIw9c/R2yTp8og2V9fMqGH20A3dp9TARyTxit1xSwBqrQr5CJvecXeN78+E4s iaI6ZfqRnE4N/ppWya61GA2i3iWuv/r+qPEjrNm2NSjHdqsdUwLPamOmV0m6Sksw jOwP/UTAXcdhCYn3wO+epfkGBfqOQUn2njycYxL1NvRLWBw0hoynt+iGgDfciNBe 9r4pg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=OQ3mH14ssHehAX5EBuHe0ZN2vZKDVl/XkALKv3ydH ts=; b=A9fvZqOB5fAh2U3yGwclU35hepaDf0GnTr59uPJSIjkrAC49P+/gWEm+x 10zJttYuB/rnUKEfw9kL/lyjTaO550YCIrX/Euf9OS8SahTIx/EK8pSYOXMzibcz u+p1Js1ZgEtO3u24fsZai4iOzxNdtsOzJBzx9GdnFWAu536z120kMFDbiwxagct+ gZB8+F7Qmb1sIazCkWY5Y5Qy8BZMXVfMjDdLyR+MKeR46ecDYQckIL9SgJN2eMz0 42zcfMtzHgpPWFThXljU4EOe35Zl9jvVNUZZV1DuFmzmSqmjoaQGauHPCW1N/Q/U 142cHenOo+DQEUOkww1/NWuDlPo8A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvledgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtugfgjgesthhqredttddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpefgjeettdejgffgffdvteeutdehtdehgeehueetkeefgefhtdetjeekledu gedvudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Jun 2021 05:14:33 -0400 (EDT) Date: Wed, 16 Jun 2021 11:14:31 +0200 From: Maxime Ripard To: Andre Przywara Cc: Chen-Yu Tsai , Jernej Skrabec , Rob Herring , Icenowy Zheng , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Ondrej Jirman , Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Subject: Re: [PATCH v7 06/19] rtc: sun6i: Add support for RTCs without external LOSCs Message-ID: <20210616091431.6tm3zdf77p2x3upc@gilmour> References: <20210615110636.23403-1-andre.przywara@arm.com> <20210615110636.23403-7-andre.przywara@arm.com> X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20210615110636.23403-7-andre.przywara@arm.com> Hi, On Tue, Jun 15, 2021 at 12:06:23PM +0100, Andre Przywara wrote: > Some newer Allwinner RTCs (for instance the one in the H616 SoC) lack > a pin for an external 32768 Hz oscillator. As a consequence, this LOSC > can't be selected as the RTC clock source, and we must rely on the > internal RC oscillator. > To allow additions of clocks to the RTC node, add a feature bit to ignore > any provided clocks for now (the current code would think this is the > external LOSC). Later DTs and code can then for instance add the PLL > based clock input, and older kernel won't get confused. >=20 > Signed-off-by: Andre Przywara Honestly, I don't really know if it's worth it at this point. If we sums this up: - The RTC has 2 features that we use, mostly centered around 2 registers set plus a global one - Those 2 features are programmed in a completely different way - Even the common part is different, given the discussion around the clocks that we have. What is there to share in that driver aside from the probe, and maybe the interrupt handling? Instead of complicating this further with more special case that you were (rightfully) complaining about, shouldn't we just acknowledge the fact that it's a completely separate design and should be treated as such, with a completely separate driver? Maxime 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=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 35418C48BE6 for ; Wed, 16 Jun 2021 09:16:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0119E61107 for ; Wed, 16 Jun 2021 09:16:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0119E61107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kDM/vSygoS3dF9ejNp0l3y2IYnxJ4v/Go5GPNYyQ+P0=; b=2LV19NynmDgZiP m5MSn5OtOZkMXXQymc0G5mQEg3KBI8OUeoFzZ++Iguw++0FkfhAHRYL8Sj6YITQfKXXfKtd9vYo6L 0nhyIS9+YUc7cubgQDcAWlLDTElyqbRdj+YUe2lXSlgfC6VxSWrckN4sy+LN/KlaZreoDdi6b7lvp edIwGSORibrhF9y1Khz+DbJz6lXsKTaDW75MKLON30PAbsoG+WHMhGW+KxxhQ3dV3onJ0djxDoS1T KWaVVVy/n0h919e5azPnoN5dPXxAvoTeJ0PpBpNvz1NAuNx26ZiW8PAuiyonN/P4P1YXmuh0RAqmp jA0x8QZAqB+YQCyBuhFA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltRdA-005XXo-IG; Wed, 16 Jun 2021 09:14:40 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltRd6-005XWf-VM for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 09:14:38 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id E05DE580064; Wed, 16 Jun 2021 05:14:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 16 Jun 2021 05:14:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm3; bh=O Q3mH14ssHehAX5EBuHe0ZN2vZKDVl/XkALKv3ydHts=; b=kRkGMEktwO4/GNbKL B/M6Cs/SVuLdcXQbvM/ZQuzuGVu+MEHIYcPbqTtxEfqQfs5n0MZd2v3L5dHENFyI qm5qTiH7zpI68Uo6yxBtUXTgGTWKQ8qvVXvfuYxXNPPcEMsxtp9tCHhwz4EItqzK jjizIw9c/R2yTp8og2V9fMqGH20A3dp9TARyTxit1xSwBqrQr5CJvecXeN78+E4s iaI6ZfqRnE4N/ppWya61GA2i3iWuv/r+qPEjrNm2NSjHdqsdUwLPamOmV0m6Sksw jOwP/UTAXcdhCYn3wO+epfkGBfqOQUn2njycYxL1NvRLWBw0hoynt+iGgDfciNBe 9r4pg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=OQ3mH14ssHehAX5EBuHe0ZN2vZKDVl/XkALKv3ydH ts=; b=A9fvZqOB5fAh2U3yGwclU35hepaDf0GnTr59uPJSIjkrAC49P+/gWEm+x 10zJttYuB/rnUKEfw9kL/lyjTaO550YCIrX/Euf9OS8SahTIx/EK8pSYOXMzibcz u+p1Js1ZgEtO3u24fsZai4iOzxNdtsOzJBzx9GdnFWAu536z120kMFDbiwxagct+ gZB8+F7Qmb1sIazCkWY5Y5Qy8BZMXVfMjDdLyR+MKeR46ecDYQckIL9SgJN2eMz0 42zcfMtzHgpPWFThXljU4EOe35Zl9jvVNUZZV1DuFmzmSqmjoaQGauHPCW1N/Q/U 142cHenOo+DQEUOkww1/NWuDlPo8A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvledgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtugfgjgesthhqredttddtvdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpefgjeettdejgffgffdvteeutdehtdehgeehueetkeefgefhtdetjeekledu gedvudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Jun 2021 05:14:33 -0400 (EDT) Date: Wed, 16 Jun 2021 11:14:31 +0200 From: Maxime Ripard To: Andre Przywara Cc: Chen-Yu Tsai , Jernej Skrabec , Rob Herring , Icenowy Zheng , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Ondrej Jirman , Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org Subject: Re: [PATCH v7 06/19] rtc: sun6i: Add support for RTCs without external LOSCs Message-ID: <20210616091431.6tm3zdf77p2x3upc@gilmour> References: <20210615110636.23403-1-andre.przywara@arm.com> <20210615110636.23403-7-andre.przywara@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210615110636.23403-7-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210616_021437_144884_49BEDA4C X-CRM114-Status: GOOD ( 15.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Tue, Jun 15, 2021 at 12:06:23PM +0100, Andre Przywara wrote: > Some newer Allwinner RTCs (for instance the one in the H616 SoC) lack > a pin for an external 32768 Hz oscillator. As a consequence, this LOSC > can't be selected as the RTC clock source, and we must rely on the > internal RC oscillator. > To allow additions of clocks to the RTC node, add a feature bit to ignore > any provided clocks for now (the current code would think this is the > external LOSC). Later DTs and code can then for instance add the PLL > based clock input, and older kernel won't get confused. > > Signed-off-by: Andre Przywara Honestly, I don't really know if it's worth it at this point. If we sums this up: - The RTC has 2 features that we use, mostly centered around 2 registers set plus a global one - Those 2 features are programmed in a completely different way - Even the common part is different, given the discussion around the clocks that we have. What is there to share in that driver aside from the probe, and maybe the interrupt handling? Instead of complicating this further with more special case that you were (rightfully) complaining about, shouldn't we just acknowledge the fact that it's a completely separate design and should be treated as such, with a completely separate driver? Maxime _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel