Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6756924rwl; Wed, 22 Mar 2023 15:26:27 -0700 (PDT) X-Google-Smtp-Source: AK7set/vr4ERxvUylv4GCiZFBvPMG1DX9okT9mIhveLrCFZmSCbp5PCvFQfRywCdZQ+50CHz35U9 X-Received: by 2002:a05:6a20:ba87:b0:d9:949e:a72 with SMTP id fb7-20020a056a20ba8700b000d9949e0a72mr752949pzb.60.1679523987247; Wed, 22 Mar 2023 15:26:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679523987; cv=none; d=google.com; s=arc-20160816; b=yB+qjGGVSZtZkBPVXmej6ORyIlEFuTLfPAUTl2YVgWH5LRLTDxVcUi2Psb+RmT7th8 xaKeW8ckuF0EMcbpQyDq92TV8SfYPpMrqEpjg0rWpKv+50i2rPg6fF8BcDYvvuIIFLbu n1vY6XNmc+mIoudyfnHdmmJnuePQl64aXo0e8v8sZYyingk0KiCJSvhBFyj+GXDbKy/b qLUYe+szunOMnG5dqmQB07EaBdyu+RbQSpg/Su+ghBGfezGSmyAPoQ11LGG60JNjEHeg WvApmYyW6pc14IIKLSovq9JPQwERjWbvIdvBKR19gT5+vE6VQrId2L/kgnGblqmW2Ubc k2RQ== 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:dkim-signature; bh=3mjbfAka6B37e0KLGUhxUpe2dBgCPhl+V2vV2LCTJ5E=; b=RnDUJdaSEjR9D1S3FMNhWRM99dne3i67Qn/Sq3X55hJ2EsMgP2gv9hKxnhNo0NVUgi YiL/0ME5iUY7b8bU7H/P5Ksi/e5ME1gZ5HUmlsTIVHuhdJdCgLdZJ8PN2yv7+eNiJIjK ckYRQdTPUTorrfPdjKACvbr+pYoP4iywzQkUCD9H2xWpbPjyAXOh4YGCZ1Y7DjGGAs2w pTYwqSu5qlYkZ3TUr1fyT1jYWrsSJT1+SN3EApfkRQ7VcGOZ5Ob6/71DS+zmIYZ6iE9b vppumjXotONFb8OyTkzuklFTE0xi6ZoZnQPfygNnsJqqpfZvJIzTPsMNFYBTwL8+RVdL p80Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BOJeM2yb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs184-20020a6328c1000000b0050f6925a3fesi11794730pgb.596.2023.03.22.15.26.11; Wed, 22 Mar 2023 15:26:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=BOJeM2yb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229885AbjCVWTI (ORCPT + 99 others); Wed, 22 Mar 2023 18:19:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjCVWTH (ORCPT ); Wed, 22 Mar 2023 18:19:07 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9C9835B5; Wed, 22 Mar 2023 15:19:04 -0700 (PDT) Received: (Authenticated sender: alexandre.belloni@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 3862A1BF207; Wed, 22 Mar 2023 22:19:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679523543; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3mjbfAka6B37e0KLGUhxUpe2dBgCPhl+V2vV2LCTJ5E=; b=BOJeM2ybRH5eO7IdR+XNOl1FwdIrfDZl8WJBfo05uMnsQ68RwMvKvYWarJNDKZQ/qFk5RQ iujueB5qtsuYAv9VKqSMoMoifOcac5tHFuuPw/gA5zZqsKqKNhq5I/rbAqOsHKx9Ucz5e6 lOBvt3FfXcvcLX5HlnhedHCSVGthILVGJ3LrzWiVe64VPPZa1VuM2SVuujaucHV+iGupCb d11/XmzV6bcNets90AKh08DthMaYyJxs0V1SaR17bFGlVVE0Arc7fk0xE05fKdR1uY8/T4 gv/OB2jEH0Awmzp5ZK8pgzjFkJcTYgP0LWMvG+h294ivNcXbjH6q/00KSoqO1A== Date: Wed, 22 Mar 2023 23:19:01 +0100 From: Alexandre Belloni To: Frieder Schrempf Cc: Frieder Schrempf , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, Alessandro Zummo , Krzysztof Kozlowski , Rob Herring , Sascha Hauer , Shawn Guo Subject: Re: [PATCH 0/7] Enable backup switch mode on RTCs via devicetree Message-ID: <2023032222190171a38d5f@mail.local> References: <20230201143431.863784-1-frieder@fris.de> <7268b05b-bbb1-ec4d-6a05-f5ccbdfeed90@kontron.de> <31b0a8b1-d027-d47a-e10d-614c09211734@kontron.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31b0a8b1-d027-d47a-e10d-614c09211734@kontron.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On 22/03/2023 14:14:50+0100, Frieder Schrempf wrote: > On 06.03.23 14:27, Frieder Schrempf wrote: > > On 13.02.23 10:18, Frieder Schrempf wrote: > >> Hi Alexandre, > >> > >> On 01.02.23 17:26, Frieder Schrempf wrote: > >>> On 01.02.23 17:15, Alexandre Belloni wrote: > >>>> Hello, > >>>> > >>>> You can't do that, this breaks an important use case and it is the > >>>> reason why I didn't use device tree in the beginning. What is wrong with > >>>> setting BSM from userspace? You will anyway have to set the time and > >>>> date from userspace for it to be saved. > >>> > >>> Ok, I was already afraid there is something I missed. Can you give a > >>> short explanation of what use case this would break? > >>> > >>> There is nothing wrong with setting BSM from userspace. It's just the > >>> fact that users expect BSM to be enabled in any case as there is a > >>> battery on the board. It is much more effort to ensure that production, > >>> user, etc. are aware of an extra step required than to let the kernel > >>> deal with it behind the scenes. > >> > >> Would you mind elaborating on your argument that this would break stuff? > >> I currently don't see how an additional optional devicetree property > >> would break anything. > > > > Ping!? > > It seems like you decided to ignore me for whatever reasons there are. > I'm sure we can sort it out in some way if you would respond, please. I do what I can with the time I have. There are 2 issues: - the first one is that this is encoding device configuration in the device tree which is forbidden. BSM is not really hardware related. The worse that could happen is that the backup voltage is not present and so the RTC will never switch to the backup source. - the second one is why I got to a userspace solution. There are RTC where it is crucial to be able to change BSM dynamically. Those RTCs have a standby mode: they will only draw current from the backup source once they have seen VDD once. This is useful when you install a battery in a product and this products stays on the shelf for a while before being used. However, if your production line needs to powerup the device to flash it or perform tests, the RTC will get out of standby mode and you need a way to get it back to standby. This is possible with the current interface, I'm not going to have a second interface. Regards, -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com