Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4347732rwl; Tue, 28 Mar 2023 06:08:37 -0700 (PDT) X-Google-Smtp-Source: AKy350bfPK4mvTFhWhH4vGVLRAWvVUqFvvcfBazHLrbkU8rJGENxfhPR8Z/Fau0eWvoqVvQRFh8G X-Received: by 2002:a17:907:2c62:b0:92f:495b:bc7c with SMTP id ib2-20020a1709072c6200b0092f495bbc7cmr13185225ejc.23.1680008917399; Tue, 28 Mar 2023 06:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680008917; cv=none; d=google.com; s=arc-20160816; b=k0W3TTTNmsqY/DT6As0YgQQ5gQTrsxJHIg26638Fw2EswYYLheQccbigIYuZ03zp7+ f2K0BKr2avH9bAksRqSJN2pXu2g5wdZK398AYTKTp9MLZef2ra4K6p8IWwYHq09qbAdy MUueNTBshCdNc1U11IZ/+wjc06rDt0IHfI59lo32dlU/qTI5x78JIdKMzM4KKS5p2Z88 f/ggM0wTug/e8h8Y2/S/fBAxVPTYS+Ejpy3olUgy511QgPoKtEPoelejuJXWP5bU87iw /8ddFfWwE6o4iFVs5zmENMOpIKIXRyfKFNQdyD+Fd9AoUZKmZSWOJAy2tXamqizkj597 kd1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:from:subject:cc:to :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=p6F4MCsvT2C8gUcp99pkDHUUGuKfspVbwNGAoaBleYU=; b=qxYljfyhWKQoOSM7I5qfBk/ecprriDHZ9xyi4F9A2VOyEYT6pEPL5DN2tloBEORr51 BTL3AaWq78lOqToNjtWTVgYtXCNHWFCHz+ZnakLYbmlML7O1jBB0r+IoiaH74eZZ6GD5 c5pmQfHhoPuS/5HkdNMtdIhfJz0HaPok2ZNeeho5/xie3HdAmhXxUBB31D5StQZhrjiy DZbOIK33USZQzZvFxVI78KqmYmcWjzvYYv2ulHJL/qNQvYl0AqbEdGpGbA8BbAi0UO7b FOsk3FDR7d1UUCMxGBqzwv8cTGko1Wmfktx8wE9v89waNKMKs3BVuHEfm7JZDuzBtbRP 015w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=FS54iuLI; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww3-20020a170907084300b00933f85809b4si27263329ejb.490.2023.03.28.06.08.08; Tue, 28 Mar 2023 06:08:37 -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=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=FS54iuLI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232453AbjC1NBr (ORCPT + 99 others); Tue, 28 Mar 2023 09:01:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232440AbjC1NBl (ORCPT ); Tue, 28 Mar 2023 09:01:41 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FAE4AF0A for ; Tue, 28 Mar 2023 06:01:20 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id n19so6916997wms.0 for ; Tue, 28 Mar 2023 06:01:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1680008479; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=p6F4MCsvT2C8gUcp99pkDHUUGuKfspVbwNGAoaBleYU=; b=FS54iuLIV/siHxesYVQVCWxxAiR29vD+YSeRvlBLKOYKXqt5cjNH6QhhssyXWfmAd6 2F+PdbWh35dJAB/n6jrAWrBWwv0Q7phIaQRijZHwfJuW4r5hAaTRWzx+KqMxwAGLds0B WOH+Z9G4MZFfRAHwWoWksVryIrTxS8p2Q+pfL+LSIRQVkj8eEj+vblnfUgVLCBnXW+07 T1xg5ZzTMDxVI+xe1Vt/ujbBi6Z+MRKUp1RTmDaVbBzGHa3w2XsBcErJduQTArwBCF0z aTxm2NFk2N1R8WauJrFW/tEkCbPF3z0n5FP6vUYjiGZ7ypFi5AmnhziwqyarQW9XWEUV OEzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680008479; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=p6F4MCsvT2C8gUcp99pkDHUUGuKfspVbwNGAoaBleYU=; b=NWW9iT3pFcAXisVfnCnaJkG63cXSA/ctZSr5lSKmuES8Mcwy53BDNtQ08Ke5BlazOa z9Xwx49VreFTYyTGMM5rTPQMCUwaZoKCemjq9YWoK5EuDegWHooWyK1kKh92th7B61Uh DtrgR7xJ9JvOv72XZbHgQu9kBCONvvuCmjlYXrhnyx3idYQZEMp/pQ96IQlUw1qm+ady FaS7X3PLAVctZlXiARNjm32cuWHZl5435D1poPdnImANIaPhE/0W5zPVJybwzzOnEWuH vaYyvpUoi0iH0O67cH4pSDOzP2hDzMpEA8gIrz1ljM3/8H+gzjhirw05z9dC108qrh+U xxpQ== X-Gm-Message-State: AO0yUKWGc+U+KlaZgNKca+OAm0eTzwCEgjeBY6Sq3Ad8w1PliKy+TjhB 7CIEa1ogolCtIRYV1wZa/akVRg== X-Received: by 2002:a05:600c:4f91:b0:3ee:501f:c795 with SMTP id n17-20020a05600c4f9100b003ee501fc795mr16307924wmq.1.1680008479146; Tue, 28 Mar 2023 06:01:19 -0700 (PDT) Received: from localhost ([2a01:e0a:28d:66d0:910e:c4d8:1565:354]) by smtp.gmail.com with ESMTPSA id q7-20020a05600c46c700b003ede2c59a54sm6091687wmo.37.2023.03.28.06.01.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Mar 2023 06:01:10 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 28 Mar 2023 15:01:05 +0200 Message-Id: To: "Alexandre Belloni" Cc: , , , , , , , , , , Subject: Re: [PATCH v2 1/3] rtc: tps6594: add driver for TPS6594 PMIC RTC From: "Esteban Blanc" X-Mailer: aerc 0.14.0 References: <20230328091448.648452-1-eblanc@baylibre.com> <20230328091448.648452-2-eblanc@baylibre.com> <202303280929448e41808d@mail.local> In-Reply-To: <202303280929448e41808d@mail.local> X-Spam-Status: No, score=0.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On Tue Mar 28, 2023 at 11:29 AM CEST, Alexandre Belloni wrote: > Hello, > > On 28/03/2023 11:14:46+0200, Esteban Blanc wrote: > > + /* Start rtc */ > > + ret =3D regmap_set_bits(tps->regmap, TPS6594_REG_RTC_CTRL_1, > > + TPS6594_BIT_STOP_RTC); > > + if (ret < 0) > > + return ret; > > + > > + mdelay(100); > > + > > + /* > > + * RTC should be running now. Check if this is the case. > > + * If not it might be a missing oscillator. > > + */ > > + ret =3D regmap_test_bits(tps->regmap, TPS6594_REG_RTC_STATUS, > > + TPS6594_BIT_RUN); > > + if (ret < 0) > > + return ret; > > + if (ret =3D=3D 0) > > + return -ENODEV; > > + > > + /* Stop RTC until first call to `tps6594_rtc_set_time */ > > + ret =3D regmap_clear_bits(tps->regmap, TPS6594_REG_RTC_CTRL_1, > > + TPS6594_BIT_STOP_RTC); > > + if (ret < 0) > > + return ret; > > + > > This whole block must not be executed when the RTC is already running, > else, you are stopping a perfectly running RTC. I'm not sure to get your point. You mean that during probe, the driver might encounter an RTC device that is already running with a correct timestamp? How would this be possible? A previous bootstage or the driver was removed then re-inserted again? Thanks for your time, --=20 Esteban Blanc BayLibre